Versions in this module Expand all Collapse all v1 v1.4.5 Dec 28, 2022 v1.4.4 Dec 28, 2022 Changes in this version + var ErrInvalidPriKey = errors.New("invalid private key") + var ErrInvalidPubKey = errors.New("invalid public key") + var ErrNotRsaKey = errors.New("key type is not RSA") + var ErrPaddingSize = errors.New("padding size error") + var ErrPrivateKey = errors.New("private key error") + var ErrPubKeyOutOfBound = errors.New("public key out of bound") + var ErrPublicKey = errors.New("failed to parse PEM block containing the public key") + func ComputeKey(pubKey, priKey *big.Int) (*big.Int, error) + func EcbDecrypt(key, src []byte) ([]byte, error) + func EcbDecryptBase64(key, src string) (string, error) + func EcbEncrypt(key, src []byte) ([]byte, error) + func EcbEncryptBase64(key, src string) (string, error) + func Gunzip(bs []byte) ([]byte, error) + func Gzip(bs []byte) []byte + func Hmac(key []byte, body string) []byte + func HmacBase64(key []byte, body string) string + func NewECBDecrypter(b cipher.Block) cipher.BlockMode + func NewECBEncrypter(b cipher.Block) cipher.BlockMode + func NewPublicKey(bs []byte) *big.Int + type DhKey struct + PriKey *big.Int + PubKey *big.Int + func GenerateKey() (*DhKey, error) + func (k *DhKey) Bytes() []byte + type RsaDecrypter interface + Decrypt func(input []byte) ([]byte, error) + DecryptBase64 func(input string) ([]byte, error) + func NewRsaDecrypter(file string) (RsaDecrypter, error) + type RsaEncrypter interface + Encrypt func(input []byte) ([]byte, error) + func NewRsaEncrypter(key []byte) (RsaEncrypter, error)