Documentation ¶
Index ¶
- func RSADecrypt(cipherText, priKey []byte) ([]byte, error)
- func RSADecryptWithFile(cipherText []byte, priKeyPath string) ([]byte, error)
- func RSAEncrypt(plainText, pubKey []byte) ([]byte, error)
- func RSAEncryptWithFile(plainText []byte, pubKeyPath string) ([]byte, error)
- func RSAGenerateKey(bits int, priKeyFile, pubKeyFile string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RSADecrypt ¶
RSA解密 cipherText 需要解密的byte数据 path 私钥文件路径
func RSADecryptWithFile ¶
RSA解密 cipherText 需要解密的byte数据 priKeyPath 私钥文件路径
func RSAEncrypt ¶
RSA加密 plainText 要加密的数据 path 公钥匙文件地址
func RSAEncryptWithFile ¶
RSA加密 plainText 要加密的数据 pubKeyPath 公钥匙文件地址
func RSAGenerateKey ¶
openssl genrsa -out rsa_private_key.pem 2048 openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem openssl pkcs8 -topk8 -in rsa_private_key.pem -out pkcs8_rsa_private_key.pem -nocrypt 生成RSA私钥和公钥,保存到文件中 bits 证书大小
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.