Versions in this module Expand all Collapse all v0 v0.13.6 Aug 13, 2022 Changes in this version + var AES128CBC = cipherWithBlock + var AES128GCM = cipherWithGCM + var AES192CBC = cipherWithBlock + var AES192GCM = cipherWithGCM + var AES256CBC = cipherWithBlock + var AES256GCM = cipherWithGCM + var DESCBC = cipherWithBlock + var DefaultOpts = &Opts + var SM4CBC = cipherWithBlock + var SM4GCM = cipherWithGCM + var TripleDESCBC = cipherWithBlock + func ConvertPrivateKeyToPKCS8(priv interface{}, v ...[]byte) ([]byte, error) + func MarshalPrivateKey(priv interface{}, password []byte, opts *Opts) ([]byte, error) + func ParsePKCS8PrivateKey(der []byte, v ...[]byte) (interface{}, error) + func ParsePKCS8PrivateKeyECDSA(der []byte, v ...[]byte) (*ecdsa.PrivateKey, error) + func ParsePKCS8PrivateKeyRSA(der []byte, v ...[]byte) (*rsa.PrivateKey, error) + func ParsePKCS8PrivateKeySM2(der []byte, v ...[]byte) (*sm2.PrivateKey, error) + func RegisterCipher(oid asn1.ObjectIdentifier, cipher func() Cipher) + func RegisterKDF(oid asn1.ObjectIdentifier, params func() KDFParameters) + type Cipher interface + Decrypt func(key []byte, parameters *asn1.RawValue, encryptedKey []byte) ([]byte, error) + Encrypt func(key, plaintext []byte) (*pkix.AlgorithmIdentifier, []byte, error) + KeySize func() int + OID func() asn1.ObjectIdentifier + type Hash uint + const SHA1 + const SHA224 + const SHA256 + const SHA384 + const SHA512 + const SHA512_224 + const SHA512_256 + const SM3 + func (h Hash) New() hash.Hash + type KDFOpts interface + DeriveKey func(password, salt []byte, size int) (key []byte, params KDFParameters, err error) + GetSaltSize func() int + OID func() asn1.ObjectIdentifier + type KDFParameters interface + DeriveKey func(password []byte, size int) (key []byte, err error) + func ParsePrivateKey(der []byte, password []byte) (interface{}, KDFParameters, error) + type Opts struct + Cipher Cipher + KDFOpts KDFOpts + type PBKDF2Opts struct + HMACHash Hash + IterationCount int + SaltSize int + func (p PBKDF2Opts) DeriveKey(password, salt []byte, size int) (key []byte, params KDFParameters, err error) + func (p PBKDF2Opts) GetSaltSize() int + func (p PBKDF2Opts) OID() asn1.ObjectIdentifier + type ScryptOpts struct + BlockSize int + CostParameter int + ParallelizationParameter int + SaltSize int + func (p ScryptOpts) DeriveKey(password, salt []byte, size int) (key []byte, params KDFParameters, err error) + func (p ScryptOpts) GetSaltSize() int + func (p ScryptOpts) OID() asn1.ObjectIdentifier