Versions in this module Expand all Collapse all v0 v0.2.1 Apr 11, 2024 v0.2.0 Mar 17, 2024 Changes in this version + func BcryptHash(str string) (string, error) + func BcryptMatch(hash string, str string) bool + func GenCertificate() (cert tls.Certificate, err error) + func GenerateKeyPair() (rawCert, rawKey []byte, err error) + func GenerateRSAKey(bits int) (Private []byte, Public []byte, err error) + func GenerateRandomSeed() int64 + func GenerateSM2Key() (pubKey, priKey []byte, err error) + func GenerateTLSConfig() (*tls.Config, error) + func LoadX509KeyPairTLSConfig(certFile, keyFile string) (*tls.Config, error) + func PKCS7Padding(plainText []byte, blockSize int) []byte + func PKCS7UnPadding(plainText []byte, blockSize int) ([]byte, error) + func RSA_DecryptOAEP(cipherText []byte, privateKey []byte, label []byte) ([]byte, error) + func RSA_DecryptPKCS1v15(cipherText []byte, privateKey []byte) ([]byte, error) + func RSA_EncryptOAEP(plainText []byte, publicKey []byte, label []byte) ([]byte, error) + func RSA_EncryptPKCS1v15(plainText []byte, publicKey []byte) ([]byte, error) + func RandNByte(n int) []byte + func RsaSignPKCS1v15(src []byte, privateKey []byte) ([]byte, error) + func RsaVerifyPKCS1v15(src []byte, sign []byte, publicKey []byte) error + func SM2DecryptAsn1(priKey, cipherText []byte) (plainText []byte, err error) + func SM2EncryptAsn1(pubKey, plainText []byte) (cipherText []byte, err error) + type CbcAESCrypt struct + func NewAESCrypt(SecretKey []byte) (*CbcAESCrypt, error) + func NewAESCryptFromHex(HexSecretKey string) (*CbcAESCrypt, error) + func (a *CbcAESCrypt) Decrypt(cipherText []byte) ([]byte, error) + func (a *CbcAESCrypt) Encrypt(plainText []byte) ([]byte, error)