Documentation ¶
Index ¶
- func AesDecryptCBC(encrypted []byte, key []byte) (decrypted []byte, err error)
- func AesEncryptCBC(origData []byte, key []byte) (encrypted []byte, err error)
- func CompPwd(hashPwd, srcPwd string) bool
- func DecodeString(message string) ([]byte, error)
- func EncodeToString(data []byte) string
- func GenPwd(pwd string) (enPwd string, err error)
- func GenerateRsaKey(len int) ([]byte, []byte, error)
- func GenerateRsaKeyStr(len int) (publicKey string, privateKey string, err error)
- func MD5(data []byte) string
- func MD5File(filename string) string
- func ParsePriKey(privateKey []byte) (*rsa.PrivateKey, error)
- func ParsePriKeyPkcs8(privateKeyPkcs8 []byte) (*rsa.PrivateKey, error)
- func ParsePubKey(publicKey []byte) (*rsa.PublicKey, error)
- func PrivateKeyPkcs8ToPem(privateKey *rsa.PrivateKey) ([]byte, error)
- func PrivateKeyToPem(privateKey *rsa.PrivateKey) []byte
- func PublicKeyToPem(publicKey *rsa.PublicKey) ([]byte, error)
- func RSA_Decrypt(encryptedMsg, priKey string) ([]byte, error)
- func RSA_DecryptPkcs8(encryptedMsg, priKey string) ([]byte, error)
- func RSA_Encrypt(message []byte, pubKey string) (string, error)
- func RSA_Sign(priKey string, message []byte) ([]byte, error)
- func RSA_SignPkcs8(priKey string, message []byte) ([]byte, error)
- func RSA_Verify(publicKeyPEM string, message []byte, signature []byte) error
- func RsaDecrypt(encryptedMsg, priKey []byte) ([]byte, error)
- func RsaDecryptPkcs8(encryptedMsg, priKey []byte) ([]byte, error)
- func RsaEncrypt(message []byte, pubKey []byte) ([]byte, error)
- func RsaPriKeyPkcs1To8(priPkcs1Key []byte) (string, error)
- func RsaPriKeyPkcs8To1(priPkcs8Key []byte) (string, error)
- func RsaSign(priKey, message []byte) ([]byte, error)
- func RsaSignKey(pkey *rsa.PrivateKey, message []byte) ([]byte, error)
- func RsaSignPkcs8(priKey, message []byte) ([]byte, error)
- func RsaSignWithHash(pkey *rsa.PrivateKey, message []byte, algorithm uint16) ([]byte, error)
- func RsaVerify(publicKeyPEM, message []byte, signature []byte) error
- func RsaVerifyWithHash(publicKeyPEM, message []byte, signature []byte, algorithm uint16) error
- func SHA256(data []byte) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecryptCBC ¶
AesDecryptCBC key的长度必须为16, 24或者32
func AesEncryptCBC ¶
AesEncryptCBC key的长度必须为16, 24或者32
func DecodeString ¶
func EncodeToString ¶
func GenerateRsaKeyStr ¶
生成密钥对
func ParsePriKeyPkcs8 ¶
func ParsePriKeyPkcs8(privateKeyPkcs8 []byte) (*rsa.PrivateKey, error)
将Pkcs8 格式byte转为私钥
func PrivateKeyPkcs8ToPem ¶
func PrivateKeyPkcs8ToPem(privateKey *rsa.PrivateKey) ([]byte, error)
将RSAP kcs8私钥转换为byte
func RSA_DecryptPkcs8 ¶
私钥解密Pkcs8 Key
func RSA_Verify ¶
RsaVerify 公钥验签
func RsaDecryptPkcs8 ¶
私钥解密 Pkcs8 Key
func RsaPriKeyPkcs1To8 ¶
func RsaPriKeyPkcs8To1 ¶
func RsaSignWithHash ¶
func RsaVerifyWithHash ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.