Documentation ¶
Index ¶
- func Decrypt(encodedData string, passphrase string) (string, error)
- func Encrypt(data string, passphrase string) (string, error)
- func GenerateRSAKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)
- func ParsePrivatePEM(privPEM string) (*rsa.PrivateKey, error)
- func PrivateKeyToPEM(privkey *rsa.PrivateKey) string
- func PublicKeyToAuthorizedKey(pub *rsa.PublicKey) ([]byte, error)
- func PublicKeyToPEM(pubkey *rsa.PublicKey) (string, error)
- func UUID() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encrypt ¶
Encrypt takes a plainstring, encrypts it with AES, and returns a base 64 encoded string.
func GenerateRSAKeyPair ¶
func GenerateRSAKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)
GenerateRSAKeyPair will generate a private and public key.
func ParsePrivatePEM ¶
func ParsePrivatePEM(privPEM string) (*rsa.PrivateKey, error)
ParsePrivatePEM converts a string PEM into a private key.
func PrivateKeyToPEM ¶
func PrivateKeyToPEM(privkey *rsa.PrivateKey) string
PrivateKeyToPEM converts private key to a PEM string.
func PublicKeyToAuthorizedKey ¶
PublicKeyToAuthorizedKey converts a public key to an authorized key for use with the authorized_keys file.
func PublicKeyToPEM ¶
PublicKeyToPEM converts a public key to a string PEM.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.