Documentation ¶
Index ¶
- func AESDecrypt(crypted, key []byte) ([]byte, error)
- func AESDecryptPEM(data, key []byte) ([]byte, error)
- func AESEncrypt(data, key []byte) ([]byte, error)
- func AESEncryptPEM(data, key []byte) ([]byte, error)
- func GenerateAESKey() (key []byte)
- func GeneratePEMAESKey() (key []byte)
- func GeneratePEMRSAKey(bits int) (priKey []byte, pubKey []byte, err error)
- func GenerateRSAKey(bits int) (priKey []byte, pubKey []byte, err error)
- func PKCS5Padding(data []byte, blockSize int) []byte
- func PKCS5UnPadding(data []byte) []byte
- func RSADecrypt(data, priKey []byte) ([]byte, error)
- func RSADecryptPEM(data, priKey []byte) ([]byte, error)
- func RSADecryptPKCS1v15(data, priKey []byte) ([]byte, error)
- func RSADecryptPKCS1v15PEM(data, priKey []byte) ([]byte, error)
- func RSADecryptPKCS1v15_(crypted []byte, priKey *rsa.PrivateKey) ([]byte, error)
- func RSADecrypt_(crypted []byte, priKey *rsa.PrivateKey) ([]byte, error)
- func RSAEncrypt(data, pubKey []byte) ([]byte, error)
- func RSAEncryptPEM(data, pubKey []byte) ([]byte, error)
- func RSAEncryptPKCS1v15(data, pubKey []byte) ([]byte, error)
- func RSAEncryptPKCS1v15PEM(data, pubKey []byte) ([]byte, error)
- func RSAEncryptPKCS1v15_(data []byte, pubKey *rsa.PublicKey) ([]byte, error)
- func RSAEncrypt_(data []byte, pubKey *rsa.PublicKey) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecrypt ¶
func AESDecryptPEM ¶
func AESEncrypt ¶
func AESEncryptPEM ¶
func GenerateAESKey ¶
func GenerateAESKey() (key []byte)
GenerateAESKey 生成 256 位 aes 密钥;用 md5 算的 32 个字节
func GeneratePEMAESKey ¶
func GeneratePEMAESKey() (key []byte)
GeneratePEMAESKey 生成 256 位 PME格式 的 aes 密钥;用 md5 算的 32 个字节
func GeneratePEMRSAKey ¶
GeneratePEMRSAKey 生成 PEM格式 的 rsa 密钥,bits 可以给 1024
func GenerateRSAKey ¶
GenerateRSAKey 生成 rsa 密钥,bits 可以给 1024
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func RSADecryptPKCS1v15_ ¶ added in v1.7.3
func RSADecryptPKCS1v15_(crypted []byte, priKey *rsa.PrivateKey) ([]byte, error)
RSADecrypt_ 使用 RSA 私钥解密,接收 *rsa.PrivateKey 私钥
PKCS1v15
func RSADecrypt_ ¶
func RSADecrypt_(crypted []byte, priKey *rsa.PrivateKey) ([]byte, error)
RSADecrypt_ 使用 RSA 私钥解密,接收 *rsa.PrivateKey 私钥
OAEP: sha256
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.