Documentation ¶
Index ¶
- func AesDecrypt(key, cipherText []byte) ([]byte, error)
- func AesDecryptFromBase58(key []byte, cipherText string) ([]byte, error)
- func AesDecryptFromBase64(key []byte, cipherText string) ([]byte, error)
- func AesEncrypt(key, plainText []byte) ([]byte, error)
- func AesEncryptToBase58(key, plainText []byte) (string, error)
- func AesEncryptToBase64(key, plainText []byte) (string, error)
- func BlowfishDecrypt(key, ciphertext []byte) ([]byte, error)
- func BlowfishDecryptFromBase58(key []byte, str string) ([]byte, error)
- func BlowfishEncrypt(key, plaintext []byte) ([]byte, error)
- func BlowfishEncryptToBase58(key, plaintext []byte) (string, error)
- func DecodeBase64(src string) ([]byte, error)
- func DecryptAesCBC(key, cipherText []byte) ([]byte, error)
- func DecryptBlowfishCBC(key, ciphertext []byte) ([]byte, error)
- func DecryptFromBase64(df decryptFunc, key []byte, src string) ([]byte, error)
- func EncodeBase64(src []byte) string
- func EncryptAesCBC(key, plainText []byte) ([]byte, error)
- func EncryptBlowfishCBC(key, plaintext []byte) ([]byte, error)
- func EncryptToBase64(ef encryptFunc, key, src []byte) (string, error)
- func GenerateRSAPairKey() (privateKeyBytes, publicKeyBytes []byte, err error)
- func GenerateRSAPairKeyPEM() (privateKeyPEM, publicKeyPEM []byte, err error)
- func GenerateUUID() string
- func GzipCompress(data []byte) ([]byte, error)
- func GzipDecompress(data []byte) ([]byte, error)
- func HashFile(h hash.Hash, path string) (string, error)
- func HmacHash(h func() hash.Hash, key, str string) string
- func HmacMD5(key, str string) string
- func MD5(v string) string
- func MD5File(path string) (string, error)
- func RSAPrivateKeyFromFile(filename string) (*rsa.PrivateKey, error)
- func RSAPrivateKeyFromPEM(privateKeyPEM []byte) (*rsa.PrivateKey, error)
- func RSAPublicKeyFromFile(filename string) (*rsa.PublicKey, error)
- func RSAPublicKeyFromPEM(publicKeyPEM []byte) (*rsa.PublicKey, error)
- func SHA1(v string) string
- func SHA1File(path string) (string, error)
- func SignRSA(privateKey *rsa.PrivateKey, data []byte) ([]byte, error)
- func SignRSASimple(privateKey *rsa.PrivateKey, data []byte) ([]byte, error)
- func UUID() string
- func VerifyRSA(publicKey *rsa.PublicKey, data, signature []byte) error
- func VerifyRSASimple(publicKey *rsa.PublicKey, data, signature []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecryptFromBase58 ¶
AesDecryptFromBase58 解密被base58过的密文
func AesDecryptFromBase64 ¶
AesDecryptFromBase64 解密被base64过的密文
func AesEncryptToBase58 ¶
AesEncryptToBase58 加密并输出base58后的字符串
func AesEncryptToBase64 ¶
AesEncryptToBase64 加密并输出base64后的字符串
func BlowfishDecrypt ¶
BlowfishDecrypt 使用 Blowfish 算法解密字符串
func BlowfishDecryptFromBase58 ¶
BlowfishDecryptFromBase58 使用 Blowfish 算法解密字符串
func BlowfishEncrypt ¶
BlowfishEncrypt 使用 Blowfish 算法加密字符串
func BlowfishEncryptToBase58 ¶
BlowfishEncryptToBase58 使用 Blowfish 算法加密字符串
func DecryptAesCBC ¶
func DecryptBlowfishCBC ¶
func DecryptFromBase64 ¶
DecryptFromBase64 解密被 Base64 过的密文
func EncryptAesCBC ¶
func EncryptBlowfishCBC ¶
func EncryptToBase64 ¶
EncryptToBase64 加密并输出 Base64 字符串
func GenerateRSAPairKey ¶
GenerateRSAPairKey 生成 RSA 密钥对
func GenerateRSAPairKeyPEM ¶
GenerateRSAPairKeyPEM 生成 RSA 密钥对并保存为 PEM 格式
func GzipDecompress ¶
GzipDecompress 对gzip压缩数据进行解压缩
func RSAPrivateKeyFromFile ¶
func RSAPrivateKeyFromFile(filename string) (*rsa.PrivateKey, error)
RSAPrivateKeyFromFile 从文件中读取 RSA 私钥
func RSAPrivateKeyFromPEM ¶
func RSAPrivateKeyFromPEM(privateKeyPEM []byte) (*rsa.PrivateKey, error)
RSAPrivateKeyFromPEM 从 PEM 格式的私钥中解析 RSA 私钥
func RSAPublicKeyFromFile ¶
RSAPublicKeyFromFile 从文件中读取 RSA 公钥
func RSAPublicKeyFromPEM ¶
RSAPublicKeyFromPEM 从 PEM 格式的公钥中解析 RSA 公钥
func SignRSA ¶
func SignRSA(privateKey *rsa.PrivateKey, data []byte) ([]byte, error)
SignRSA 使用 RSA 私钥对数据进行签名
func SignRSASimple ¶
func SignRSASimple(privateKey *rsa.PrivateKey, data []byte) ([]byte, error)
SignRSASimple 使用 RSA 私钥对数据进行签名
Types ¶
This section is empty.