Documentation
¶
Index ¶
- func Base64PublicKeyToRSA(base64PublicKey string) (*rsa.PublicKey, error)
- func Base64ToPrivateKey(base64EncodedKey string) (*rsa.PrivateKey, error)
- func Base64ToPrivateKeyByPkcs8(base64EncodedKey string) (*rsa.PrivateKey, error)
- func HmacSha256ToBase64(key string, data string) string
- func PKCS5Padding(data []byte, blockSize int) []byte
- func PKCS5Unpadding(data []byte) ([]byte, error)
- func PrivateKeyPkcs8ToBytes(privateKey *rsa.PrivateKey) []byte
- func PrivateKeyToBytes(privateKey *rsa.PrivateKey) []byte
- func PublicKeyToBytes(publicKey *rsa.PublicKey) []byte
- func RSADecrypt(ciphertext string, privateKey *rsa.PrivateKey) ([]byte, error)
- func RSAEncrypt(data map[string]interface{}, publicKey *rsa.PublicKey) (string, error)
- func RSASign(data map[string]interface{}, privateKey *rsa.PrivateKey) (string, error)
- func RSASignByString(data string, privateKey *rsa.PrivateKey) (string, error)
- func RSAVerify(data map[string]interface{}, publicKey *rsa.PublicKey) error
- func RSAVerifyByString(data string, signature string, publicKey *rsa.PublicKey) error
- func SortParam(param map[string]interface{}, appendFilename bool) string
- func ZeroPadding(data []byte, blockSize int) []byte
- func ZeroUnpadding(data []byte) ([]byte, error)
- type SignAlgo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64PublicKeyToRSA ¶
func Base64ToPrivateKey ¶
func Base64ToPrivateKey(base64EncodedKey string) (*rsa.PrivateKey, error)
func Base64ToPrivateKeyByPkcs8 ¶
func Base64ToPrivateKeyByPkcs8(base64EncodedKey string) (*rsa.PrivateKey, error)
func HmacSha256ToBase64 ¶
func PrivateKeyPkcs8ToBytes ¶
func PrivateKeyPkcs8ToBytes(privateKey *rsa.PrivateKey) []byte
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(privateKey *rsa.PrivateKey) []byte
func PublicKeyToBytes ¶
func RSADecrypt ¶
func RSADecrypt(ciphertext string, privateKey *rsa.PrivateKey) ([]byte, error)
RSADecrypt 使用 RSA 私钥对数据进行解密
func RSAEncrypt ¶
RSAEncrypt 使用 RSA 公钥对数据进行加密
func RSASign ¶
func RSASign(data map[string]interface{}, privateKey *rsa.PrivateKey) (string, error)
RSASign 使用 RSA 私钥对数据进行签名
func RSASignByString ¶
func RSASignByString(data string, privateKey *rsa.PrivateKey) (string, error)
func RSAVerifyByString ¶
RSAVerify 验证 RSA 签名的有效性
func ZeroPadding ¶
ZeroPadding 使用ZeroPadding填充数据
func ZeroUnpadding ¶
ZeroUnpadding 去除ZeroPadding填充数据
Types ¶
Click to show internal directories.
Click to hide internal directories.