Documentation ¶
Index ¶
- Constants
- func DecryptSymmetric(key, ciphertext []byte) (plaintext []byte, err error)
- func DecryptWithPrivateKey(recipientPvtKey *rsa.PrivateKey, cipher []byte) ([]byte, error)
- func EncryptSymmetric(key, plaintext []byte) (ciphertext []byte, err error)
- func EncryptWithPublicKey(recipientPubKey *rsa.PublicKey, plainText []byte) (cipher []byte, failure error)
- func GenerateKeyPairPemFile(outputPemFilePath string) error
- func GenerateMessageSignature(senderPrivKey *rsa.PrivateKey, plainText []byte) ([]byte, error)
- func GeneratePrivateKey() (*rsa.PrivateKey, error)
- func PrintPemFilePublicKeyAsHex(inputPemFile string) error
- func ReadPemKey(filePath string) (*rsa.PrivateKey, error)
- func StartWatcher(path string, eventHandler WatcherEventHandler) (*fsnotify.Watcher, error)
- func VerifySenderMessage(senderPublicKey *rsa.PublicKey, plainText, signature []byte) error
- type AllowedPublicKey
- type WatcherEventHandler
Constants ¶
View Source
const ( RESPONSE_EOF = "_GOPSEXEC_EOF_" END_OF_TAR_FILENAME = "END_OF_TAR" )
View Source
const ( PROCESS_ID_HTTP_HEADER_NAME = "X-GPE-PID" BASE_PATH_HTTP_HEADER_NAME = "X-GPE-BASE-PATH" IS_DIR_HTTP_HEADER_NAME = "X-GPE-IS-DIR" )
Variables ¶
This section is empty.
Functions ¶
func DecryptSymmetric ¶
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(recipientPvtKey *rsa.PrivateKey, cipher []byte) ([]byte, error)
func EncryptSymmetric ¶
TODO: Thanks to http://blog.giorgis.io/golang-aes-encryption
func EncryptWithPublicKey ¶
func GenerateKeyPairPemFile ¶
func GenerateMessageSignature ¶
func GenerateMessageSignature(senderPrivKey *rsa.PrivateKey, plainText []byte) ([]byte, error)
func GeneratePrivateKey ¶
func GeneratePrivateKey() (*rsa.PrivateKey, error)
func ReadPemKey ¶
func ReadPemKey(filePath string) (*rsa.PrivateKey, error)
func StartWatcher ¶
func StartWatcher(path string, eventHandler WatcherEventHandler) (*fsnotify.Watcher, error)
Types ¶
type AllowedPublicKey ¶
func LoadAllowedPublicKeysFile ¶
func LoadAllowedPublicKeysFile(file string) (allowedKeys []*AllowedPublicKey, returnErr error)
func (*AllowedPublicKey) PublicKeyEquals ¶
func (a *AllowedPublicKey) PublicKeyEquals(otherPubKey *rsa.PublicKey) (bool, error)
type WatcherEventHandler ¶
type WatcherEventHandler interface { OnWatcherEvent(event fsnotify.Event) OnWatcherError(err error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.