Documentation ¶
Index ¶
- Variables
- 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
- type RsaDecrypter
- type RsaEncrypter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidPriKey = errors.New("invalid private key") ErrInvalidPubKey = errors.New("invalid public key") ErrPubKeyOutOfBound = errors.New("public key out of bound") )
View Source
var ( ErrPrivateKey = errors.New("private key error") ErrPublicKey = errors.New("failed to parse PEM block containing the public key") ErrNotRsaKey = errors.New("key type is not RSA") )
View Source
var ErrPaddingSize = errors.New("padding size error")
Functions ¶
func EcbDecrypt ¶
func EcbDecryptBase64 ¶
func EcbEncrypt ¶
func EcbEncryptBase64 ¶
func HmacBase64 ¶
func NewPublicKey ¶
Types ¶
type DhKey ¶
func GenerateKey ¶
type RsaDecrypter ¶
type RsaDecrypter interface { Decrypt(input []byte) ([]byte, error) DecryptBase64(input string) ([]byte, error) }
func NewRsaDecrypter ¶
func NewRsaDecrypter(file string) (RsaDecrypter, error)
type RsaEncrypter ¶
func NewRsaEncrypter ¶
func NewRsaEncrypter(key []byte) (RsaEncrypter, error)
Click to show internal directories.
Click to hide internal directories.