Documentation ¶
Index ¶
- Constants
- func CatalogDecrypt(key, data []byte) (*message.Catalog, error)
- func CatalogEncrypt(catalog message.Catalog) ([]byte, []byte, error)
- func Decrypt(key interface{}, message []byte) ([]byte, error)
- func Encrypt(key interface{}, message []byte) ([]byte, error)
- func GenerateKeyPair(kt keyType) (string, string, error)
- func JSONDecrypt(key []byte, ciphertext []byte, v interface{}) error
- func JSONEncrypt(key []byte, data interface{}) ([]byte, error)
- func MessageDecrypt(key []byte, message []byte) ([]byte, error)
- func MessageEncrypt(key []byte, plaintext []byte) ([]byte, error)
- func PEMToPrivKey(pemData []byte) (interface{}, error)
- func PEMToPubKey(pemData []byte) (interface{}, error)
- func PrivKeyToPEM(key interface{}) (string, error)
- func PubKeyToPEM(key interface{}) (string, error)
- func Sign(key interface{}, message []byte) ([]byte, error)
- func Verify(key interface{}, message []byte, hash []byte) (bool, error)
Constants ¶
View Source
const ( // KeyTypeRSA RSA key KeyTypeRSA = iota // KeyTypeECDSA Elliptic curve key KeyTypeECDSA // KeyTypeED25519 ED25519 key KeyTypeED25519 )
Variables ¶
This section is empty.
Functions ¶
func CatalogDecrypt ¶
CatalogDecrypt decrypts a catalog with the given key
func CatalogEncrypt ¶
CatalogEncrypt encrypts a catalog with a random key.
func GenerateKeyPair ¶
GenerateKeyPair generates a public/private keypair based on the given type
func JSONDecrypt ¶
JSONDecrypt decrypts data back from a encrypted marshalled JSON structure
func JSONEncrypt ¶
JSONEncrypt encrypts a structure that is marshalled to JSON
func MessageDecrypt ¶
MessageDecrypt decrypts a binary message
func MessageEncrypt ¶
MessageEncrypt encrypts a binary message
func PEMToPrivKey ¶
PEMToPrivKey Converts a PEM & PKCS8 encoded private key
func PEMToPubKey ¶
PEMToPubKey Converts a PEM & PKCS8 encoded public key
func PrivKeyToPEM ¶
PrivKeyToPEM Convert a private key into PKCS8/PEM format
func PubKeyToPEM ¶
PubKeyToPEM Convert a public key into PKCS8/PEM format
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.