Versions in this module Expand all Collapse all v1 v1.0.2 May 29, 2021 v1.0.1 May 25, 2021 Changes in this version + func DecodeEcdsaPrivateKeyFromPem(pemEncodedPrivKey []byte) (*ecdsa.PrivateKey, error) + func DecryptUsingSymmKey(encryptedMsg, privKey []byte) ([]byte, error) + func EncodeEcdsaPrivateKeyToPem(privateKey *ecdsa.PrivateKey) ([]byte, []byte, error) + func EncryptUsingSymmKey(msg, privKey []byte) ([]byte, error) + func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string + func ExportRsaPrivateKeyToFile(fileName string, key *rsa.PrivateKey) error + func ExportRsaPublicKeyAsPemStr(pubkey *rsa.PublicKey) string + func ExportRsaPublicKeyToFile(fileName string, key *rsa.PublicKey) error + func GenerateEcdsaKeyPair() (*ecdsa.PrivateKey, error) + func GenerateRsaKeyPair(bits int) (*rsa.PrivateKey, error) + func GetHash(msg []byte) []byte + func HMAC(message, key []byte, hashFunc func() hash.Hash) []byte + func ParseRsaPrivateKeyFromFile(fileName string) (*rsa.PrivateKey, error) + func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error) + func ParseRsaPublicKeyFromPemStr(pubPEM string) (*rsa.PublicKey, error) + func Sign(msg []byte, key *rsa.PrivateKey) (signature []byte, err error) + func SignEcdsa(msg []byte, key *ecdsa.PrivateKey) ([]byte, error) + func ValidMAC(message, key, messageMAC []byte, hashFunc func() hash.Hash) bool + func Verify(msg []byte, sig []byte, pk *rsa.PublicKey) error + func VerifyEcdsa(msg []byte, sig []byte, pk *ecdsa.PublicKey) bool + type KeyStore struct + func NewKeyStore() *KeyStore + func (store *KeyStore) AddKey(keyName, pem string) error + func (store *KeyStore) AddKeyFromFile(keyName, fileName string) error + func (store *KeyStore) Key(keyName string) (*rsa.PrivateKey, bool)