Versions in this module Expand all Collapse all v2 v2.3.3 Oct 19, 2023 Changes in this version + const BLOCK_MODE_CTR + const BLOCK_MODE_ECB + func CCharArrToGoSlice(buf []C.uchar) []byte + func NewPrivateKey(sdf *SDFHandle, keyId string, keyPwd []byte, tp bccrypto.KeyType) (bccrypto.PrivateKey, error) + func NewSecretKey(sdf *SDFHandle, keyId string, keyPwd []byte, tp bccrypto.KeyType) (bccrypto.SymmetricKey, error) + type ECCSignature struct + R *big.Int + S *big.Int + type SDFHandle struct + func New(lib string, sessionCacheSize int) (*SDFHandle, error) + func (h *SDFHandle) Close() error + func (h *SDFHandle) Decrypt(key SDFKey, cipher []byte) ([]byte, error) + func (h *SDFHandle) ECCInternalSign(key SDFKey, msg []byte) ([]byte, error) + func (h *SDFHandle) Encrypt(key SDFKey, plain []byte) ([]byte, error) + func (h *SDFHandle) ExportECDSAPublicKey(key SDFKey) (interface{}, error) + func (h *SDFHandle) GenKeyPair() (pri *base.ECCrefPrivateKey, pub *base.ECCrefPublicKey, err error) + func (h *SDFHandle) GenerateKey(length int) ([]byte, error) + func (h *SDFHandle) GenerateRandom(length int) ([]byte, error) + func (h *SDFHandle) SymDecrypt(keyHandle base.SessionHandle, mode uint, iv []byte, cipher []byte) ([]byte, error) + func (h *SDFHandle) SymEncrypt(keyHandle base.SessionHandle, mode uint, iv []byte, plain []byte) ([]byte, error) + func (h *SDFHandle) Verify(key SDFKey, msg []byte, sig base.ECCSignature) error + type SDFKey struct + KeyId uint + KeyPwd []byte + KeyType SDFKeyType + type SDFKeyType string + const AES + const ECDSA + const RSA + const SM2 + const SM4 + const UNKNOWN