Documentation
¶
Index ¶
- func FormatAlipayPrivateKey(privateKey string) (pKey string)
- func FormatAlipayPublicKey(publicKey string) (pKey string)
- func RsaDecryptData(cipherData string, privateKeyFilePath string) (originData string, err error)
- func RsaDecryptDataV2(t PKCSType, cipherData []byte, privateKey string) (originData []byte, err error)
- func RsaDecryptOAEPData(h hash.Hash, t PKCSType, privateKey string, ciphertext, label []byte) (originData []byte, err error)
- func RsaEncryptData(originData string, publicKeyFilePath string) (cipherData string, err error)
- func RsaEncryptDataV2(t PKCSType, originData []byte, publicKey string) (cipherData []byte, err error)
- func RsaEncryptOAEPData(h hash.Hash, t PKCSType, publicKey string, originData, label []byte) (cipherData []byte, err error)
- type PKCSType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAlipayPrivateKey ¶
FormatAlipayPrivateKey 格式化支付宝普通应用秘钥
func FormatAlipayPublicKey ¶
FormatAlipayPublicKey 格式化支付宝普通支付宝公钥
func RsaDecryptData ¶
Deprecated 推荐使用:RsaDecryptDataV2() RSA解密数据
cipherData:加密字符串 privateKeyFilePath:私钥证书文件路径
func RsaDecryptDataV2 ¶ added in v1.0.10
func RsaDecryptDataV2(t PKCSType, cipherData []byte, privateKey string) (originData []byte, err error)
RSA解密数据
t:PKCS1 或 PKCS8 cipherData:加密字符串byte数组 privateKey:私钥
func RsaDecryptOAEPData ¶
func RsaDecryptOAEPData(h hash.Hash, t PKCSType, privateKey string, ciphertext, label []byte) (originData []byte, err error)
RSA解密数据
OAEPWithSHA-256AndMGF1Padding
func RsaEncryptData ¶
Deprecated 推荐使用:RsaEncryptDataV2() RSA加密数据
originData:原始字符串 publicKeyFilePath:公钥证书文件路径
Types ¶
Click to show internal directories.
Click to hide internal directories.