Documentation
¶
Index ¶
- func HmacSHA1(data, key string) string
- func ImportPrivateKey(pkstr string) (*rsa.PrivateKey, error)
- func ImportPublicKey(pubKey string) (*rsa.PublicKey, error)
- func MD5(v string) string
- func RSADecrypt(ciphertext string, privateKey *rsa.PrivateKey) ([]byte, error)
- func RSAEncrypt(bytes []byte, publicKey *rsa.PublicKey) (string, error)
- func Sha256Hash(msg []byte) []byte
- func SignByPK(privateKey *rsa.PrivateKey, hashMsg []byte) ([]byte, error)
- func VerifySignature(publicKey *rsa.PublicKey, hashMsg []byte, signature []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportPrivateKey ¶
func ImportPrivateKey(pkstr string) (*rsa.PrivateKey, error)
func RSADecrypt ¶
func RSADecrypt(ciphertext string, privateKey *rsa.PrivateKey) ([]byte, error)
RSADecrypt 使用 RSA 私钥对数据进行解密
func RSAEncrypt ¶
RSAEncrypt 使用 RSA 公钥对数据进行加密
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.