Versions in this module Expand all Collapse all v0 v0.0.2 Jul 28, 2022 Changes in this version + type Cipher interface + Decrypt func(cipherText []byte) ([]byte, error) + Encrypt func(plainText []byte) ([]byte, error) + Sign func(src []byte, hash crypto.Hash) ([]byte, error) + Verify func(src []byte, sign []byte, hash crypto.Hash) error + func NewCipher(key Key, padding Padding, cipherMode CipherMode, signMode SignMode) Cipher + type CipherMode interface + Decrypt func(cipherText []byte, prk *rsa.PrivateKey) ([]byte, error) + Encrypt func(plainText []byte, puk *rsa.PublicKey) ([]byte, error) + func NewOAEPCipher() CipherMode + func NewPKCS1v15Cipher() CipherMode + type Key interface + Modulus func() int + PrivateKey func() *rsa.PrivateKey + PublicKey func() *rsa.PublicKey + func LoadKeyFromDerFile(publicKeyFilePath, privateKeyFilePath string, ...) (Key, error) + func LoadKeyFromPEMByte(pukBytes, prkBytes []byte, ParseKey func([]byte, []byte) (Key, error)) (Key, error) + func LoadKeyFromPEMFile(publicKeyFilePath, privateKeyFilePath string, ...) (Key, error) + func ParsePKCS1Key(publicKey, privateKey []byte) (Key, error) + func ParsePKCS1KeyByCert(publicKey, privateKey []byte) (Key, error) + func ParsePKCS8Key(publicKey, privateKey []byte) (Key, error) + type Padding interface + Padding func(src []byte) [][]byte + func NewNoPadding(modulus int) Padding + func NewOAEPPadding(modulus int) Padding + func NewPKCS1Padding(modulus int) Padding + type SignMode interface + Sign func(src []byte, hash crypto.Hash, prk *rsa.PrivateKey) ([]byte, error) + Verify func(src []byte, sign []byte, hash crypto.Hash, puk *rsa.PublicKey) error + func NewPKCS1v15Sign() SignMode