Versions in this module Expand all Collapse all v1 v1.4.4 Nov 14, 2019 Changes in this version + func AESCBCPKCS7Decrypt(key, src []byte) ([]byte, error) + func AESCBCPKCS7Encrypt(key, src []byte) ([]byte, error) + func AESCBCPKCS7EncryptWithIV(IV []byte, key, src []byte) ([]byte, error) + func AESCBCPKCS7EncryptWithRand(prng io.Reader, key, src []byte) ([]byte, error) + func GetRandomBytes(len int) ([]byte, error) + func NewDefaultSecurityLevel(keyStorePath string) (bccsp.BCCSP, error) + func NewDefaultSecurityLevelWithKeystore(keyStore bccsp.KeyStore) (bccsp.BCCSP, error) + func NewDummyKeyStore() bccsp.KeyStore + func NewFileBasedKeyStore(pwd []byte, path string, readOnly bool) (bccsp.KeyStore, error) + func NewInMemoryKeyStore() bccsp.KeyStore + func NewWithParams(securityLevel int, hashFamily string, keyStore bccsp.KeyStore) (bccsp.BCCSP, error) + type CSP struct + Decryptors map[reflect.Type]Decryptor + Encryptors map[reflect.Type]Encryptor + Hashers map[reflect.Type]Hasher + KeyDerivers map[reflect.Type]KeyDeriver + KeyGenerators map[reflect.Type]KeyGenerator + KeyImporters map[reflect.Type]KeyImporter + Signers map[reflect.Type]Signer + Verifiers map[reflect.Type]Verifier + func New(keyStore bccsp.KeyStore) (*CSP, error) + func (csp *CSP) AddWrapper(t reflect.Type, w interface{}) error + func (csp *CSP) Decrypt(k bccsp.Key, ciphertext []byte, opts bccsp.DecrypterOpts) (plaintext []byte, err error) + func (csp *CSP) Encrypt(k bccsp.Key, plaintext []byte, opts bccsp.EncrypterOpts) ([]byte, error) + func (csp *CSP) GetHash(opts bccsp.HashOpts) (h hash.Hash, err error) + func (csp *CSP) GetKey(ski []byte) (k bccsp.Key, err error) + func (csp *CSP) Hash(msg []byte, opts bccsp.HashOpts) (digest []byte, err error) + func (csp *CSP) KeyDeriv(k bccsp.Key, opts bccsp.KeyDerivOpts) (dk bccsp.Key, err error) + func (csp *CSP) KeyGen(opts bccsp.KeyGenOpts) (k bccsp.Key, err error) + func (csp *CSP) KeyImport(raw interface{}, opts bccsp.KeyImportOpts) (k bccsp.Key, err error) + func (csp *CSP) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) (signature []byte, err error) + func (csp *CSP) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (valid bool, err error) + type Decryptor interface + Decrypt func(k bccsp.Key, ciphertext []byte, opts bccsp.DecrypterOpts) (plaintext []byte, err error) + type Encryptor interface + Encrypt func(k bccsp.Key, plaintext []byte, opts bccsp.EncrypterOpts) (ciphertext []byte, err error) + type Hasher interface + GetHash func(opts bccsp.HashOpts) (h hash.Hash, err error) + Hash func(msg []byte, opts bccsp.HashOpts) (hash []byte, err error) + type KeyDeriver interface + KeyDeriv func(k bccsp.Key, opts bccsp.KeyDerivOpts) (dk bccsp.Key, err error) + type KeyGenerator interface + KeyGen func(opts bccsp.KeyGenOpts) (k bccsp.Key, err error) + type KeyImporter interface + KeyImport func(raw interface{}, opts bccsp.KeyImportOpts) (k bccsp.Key, err error) + type Signer interface + Sign func(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) (signature []byte, err error) + type Verifier interface + Verify func(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (valid bool, err error)