secure

package
v0.0.0-...-8dc1d63 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(encodedData string, passphrase string) (string, error)

Decrypt takes a base64 encoded string, decrypts it using AES, and returns a string.

func Encrypt

func Encrypt(data string, passphrase string) (string, error)

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

func PublicKeyToAuthorizedKey(pub *rsa.PublicKey) ([]byte, error)

PublicKeyToAuthorizedKey converts a public key to an authorized key for use with the authorized_keys file.

func PublicKeyToPEM

func PublicKeyToPEM(pubkey *rsa.PublicKey) (string, error)

PublicKeyToPEM converts a public key to a string PEM.

func UUID

func UUID() (string, error)

UUID generates a UUID for use as an ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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