Documentation ¶
Index ¶
- Variables
- func GenerateRSAKey(bits int) (priKey, pubKey []byte, err error)
- func GenerateRSAKeyInFile(bits int, filePath string) (err error)
- func GenerateRSAKeyWithPwd(passwd string, bits int) (priKey, pubKey string, err error)
- func RSADecryptOAEP(cipherText, privCipherKey []byte) (plainText []byte, err error)
- func RSAEncrypt(plainText, key []byte) (cryptText []byte, err error)
- func RSAEncryptOAEP(plainText []byte, pubCipherKey []byte) (cipherText []byte, err error)
- func RsaDecrypt(cryptText, key []byte) (plainText []byte, err error)
- func RsaSignPKCS1v15(msg, Key []byte) (cryptText []byte, err error)
- func RsaVerifySignPKCS1v15(msg []byte, sign []byte, Key []byte) bool
- type RSASecurity
Constants ¶
This section is empty.
Variables ¶
View Source
var RSA = &RSASecurity{}
Functions ¶
func GenerateRSAKey ¶
GenerateRSAKey 创建RSA 常用位数 1024 2048 4096
func GenerateRSAKeyInFile ¶
GenerateRSAKeyInFile 创建公私钥并写入文件
func GenerateRSAKeyWithPwd ¶
GenerateRSAKeyWithPwd 创建带密码的RSA
func RSADecryptOAEP ¶
RSADecryptOAEP 私钥解密
func RSAEncrypt ¶
RSAEncrypt rsa加密
func RSAEncryptOAEP ¶
RSAEncryptOAEP 公钥加密
func RsaDecrypt ¶
RsaDecrypt rsa解密
func RsaSignPKCS1v15 ¶
RsaSignPKCS1v15 rsa签名
Types ¶
type RSASecurity ¶
type RSASecurity struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.