Versions in this module Expand all Collapse all v2 v2.3.3 Oct 19, 2023 Changes in this version + const CRYPTO_ALGO_AES + const CRYPTO_ALGO_AES128 + const CRYPTO_ALGO_AES192 + const CRYPTO_ALGO_AES256 + const CRYPTO_ALGO_ASYM_DEFAULT + const CRYPTO_ALGO_ECC_Ed25519 + const CRYPTO_ALGO_ECC_P256 + const CRYPTO_ALGO_ECC_P384 + const CRYPTO_ALGO_ECC_P521 + const CRYPTO_ALGO_ECC_Secp256k1 + const CRYPTO_ALGO_HASH_DEFAULT + const CRYPTO_ALGO_RSA1024 + const CRYPTO_ALGO_RSA2048 + const CRYPTO_ALGO_RSA3072 + const CRYPTO_ALGO_RSA512 + const CRYPTO_ALGO_SHA256 + const CRYPTO_ALGO_SHA3_256 + const CRYPTO_ALGO_SM2 + const CRYPTO_ALGO_SM3 + const CRYPTO_ALGO_SM4 + const CRYPTO_ALGO_SYM_DEFAULT + const CRYPTO_DEFAULT_UID + const SM3 + var AsymAlgoMap = map[string]KeyType + var HashAlgoMap = map[string]HashType + var KeyType2NameMap = map[KeyType]string + var Name2KeyTypeMap = map[string]KeyType + var SymAlgoMap = map[string]KeyType + type BitsSize int + const BITS_SIZE_1024 + const BITS_SIZE_128 + const BITS_SIZE_192 + const BITS_SIZE_2048 + const BITS_SIZE_256 + const BITS_SIZE_3072 + const BITS_SIZE_512 + type DecryptKey interface + Decrypt func(ciphertext []byte) ([]byte, error) + DecryptWithOpts func(ciphertext []byte, opts *EncOpts) ([]byte, error) + EncryptKey func() EncryptKey + type EncOpts struct + BlockMode string + EnableASN1 bool + EnableMAC bool + EncodingType string + Hash HashType + Label []byte + type EncryptKey interface + Encrypt func(data []byte) ([]byte, error) + EncryptWithOpts func(data []byte, opts *EncOpts) ([]byte, error) + type Encryptor interface + Decrypt func(ciphertext []byte) ([]byte, error) + Encrypt func(data []byte) ([]byte, error) + type HashType uint + const HASH_TYPE_SHA256 + const HASH_TYPE_SHA3_256 + const HASH_TYPE_SM3 + type Key interface + Bytes func() ([]byte, error) + String func() (string, error) + Type func() KeyType + type KeyType int + const AES + const ECC_Ed25519 + const ECC_NISTP256 + const ECC_NISTP384 + const ECC_NISTP521 + const ECC_Secp256k1 + const RSA1024 + const RSA2048 + const RSA3072 + const RSA512 + const SM2 + const SM4 + type PrivateKey interface + PublicKey func() PublicKey + Sign func(data []byte) ([]byte, error) + SignWithOpts func(data []byte, opts *SignOpts) ([]byte, error) + ToStandardKey func() crypto.PrivateKey + type PublicKey interface + ToStandardKey func() crypto.PublicKey + Verify func(data []byte, sig []byte) (bool, error) + VerifyWithOpts func(data []byte, sig []byte, opts *SignOpts) (bool, error) + type SignOpts struct + EncodingType string + Hash HashType + UID string + type SymmetricKey interface + Decrypt func(ciphertext []byte) ([]byte, error) + DecryptWithOpts func(ciphertext []byte, opts *EncOpts) ([]byte, error) + Encrypt func(plain []byte) ([]byte, error) + EncryptWithOpts func(plain []byte, opts *EncOpts) ([]byte, error)