Documentation ¶
Index ¶
- Variables
- func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
- func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)
- func Decrypt(ciphertext, key []byte) ([]byte, error)
- func DecryptMap(data map[string][]byte, key []byte) (result map[string][]byte, err error)
- func Encrypt(plaintext, key []byte) ([]byte, error)
- func EncryptMap(data map[string][]byte, key []byte) (result map[string][]byte, err error)
- func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)
- func SignPKCS1v15(text []byte, priv *rsa.PrivateKey) ([]byte, error)
- func VerifyPKCS1v15(text, signature []byte, pub *rsa.PublicKey) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRsaPemDecode = errors.New("rsa pem decode error") ErrRsaConvert = errors.New("rsa convert not ok") )
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
func DecryptMap ¶ added in v2.4.3
func EncryptMap ¶ added in v2.4.3
func GenerateKeyPair ¶
func PKCS7Padding ¶ added in v2.4.3
func PKCS7UnPadding ¶ added in v2.4.3
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
func SignPKCS1v15 ¶
func SignPKCS1v15(text []byte, priv *rsa.PrivateKey) ([]byte, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.