Documentation ¶
Index ¶
- func FormatAlipayPrivateKey(privateKey string) (pKey string)
- func FormatAlipayPublicKey(publicKey string) (pKey string)
- func RsaDecryptData(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(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 ¶
func RsaDecryptData(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
Types ¶
Click to show internal directories.
Click to hide internal directories.