shared

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2016 License: MIT Imports: 17 Imported by: 1

Documentation

Index

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 DecryptSymmetric(key, ciphertext []byte) (plaintext []byte, err error)

func DecryptWithPrivateKey

func DecryptWithPrivateKey(recipientPvtKey *rsa.PrivateKey, cipher []byte) ([]byte, error)

func EncryptSymmetric

func EncryptSymmetric(key, plaintext []byte) (ciphertext []byte, err error)

TODO: Thanks to http://blog.giorgis.io/golang-aes-encryption

func EncryptWithPublicKey

func EncryptWithPublicKey(recipientPubKey *rsa.PublicKey, plainText []byte) (cipher []byte, failure error)

func GenerateKeyPairPemFile

func GenerateKeyPairPemFile(outputPemFilePath string) error

func GenerateMessageSignature

func GenerateMessageSignature(senderPrivKey *rsa.PrivateKey, plainText []byte) ([]byte, error)

func GeneratePrivateKey

func GeneratePrivateKey() (*rsa.PrivateKey, error)

func PrintPemFilePublicKeyAsHex

func PrintPemFilePublicKeyAsHex(inputPemFile string) error

func ReadPemKey

func ReadPemKey(filePath string) (*rsa.PrivateKey, error)

func StartWatcher

func StartWatcher(path string, eventHandler WatcherEventHandler) (*fsnotify.Watcher, error)

func VerifySenderMessage

func VerifySenderMessage(senderPublicKey *rsa.PublicKey, plainText, signature []byte) error

Types

type AllowedPublicKey

type AllowedPublicKey struct {
	Name      string
	PublicKey *rsa.PublicKey
}

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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL