Documentation ¶
Index ¶
- func FormatAlipayPrivateKey(privateKey string) (pKey string)
- func FormatAlipayPublicKey(publicKey string) (pKey string)
- func RsaDecrypt(t PKCSType, cipherData []byte, privateKey string) (originData []byte, err error)
- func RsaDecryptOAEP(h hash.Hash, t PKCSType, privateKey string, ciphertext, label []byte) (originData []byte, err error)
- func RsaEncrypt(t PKCSType, originData []byte, publicKey string) (cipherData []byte, err error)
- func RsaEncryptOAEP(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 RsaDecrypt ¶
RSA解密数据 t:PKCS1 或 PKCS8 cipherData:加密字符串byte数组 privateKey:私钥
func RsaDecryptOAEP ¶
func RsaDecryptOAEP(h hash.Hash, t PKCSType, privateKey string, ciphertext, label []byte) (originData []byte, err error)
RSA解密数据 OAEPWithSHA-256AndMGF1Padding
func RsaEncrypt ¶
RSA加密数据 t:PKCS1 或 PKCS8 originData:原始字符串byte数组 publicKey:公钥
Types ¶
Click to show internal directories.
Click to hide internal directories.