Versions in this module Expand all Collapse all v0 v0.0.1 May 21, 2023 Changes in this version + var ErrDataBroken = errors.New("data broken, first byte is not zero") + var ErrDataLen = errors.New("data length error") + var ErrDataToLarge = errors.New("message too long for RSA public key size") + var ErrDecryption = errors.New("decryption error") + var ErrKeyPairDismatch = errors.New("data is not encrypted by the private key") + var ErrPrivateKey = errors.New("get private key error") + var ErrPublicKey = errors.New("get public key error") + var RSA = &RSASecurity + func AbiCoder(argTypes []string, argValues []interface{}) ([]byte, error) + func AbiCoderHex(argTypes []string, argValues []interface{}) (string, error) + func AbiDecoder(argTypes []string, input []byte, argValues []interface{}) error + func AbiDecoderWithReturnedValues(argTypes []string, input []byte) ([]interface{}, error) + func AesDecryptByECB(data, key []byte) []byte + func AesDecryptByECBBase64(data, key string) string + func AesEncryptByECB(data, key []byte) []byte + func AesEncryptByECBBase64(data, key string) string + func DesCBCDecrypter(data, key, iv []byte) []byte + func DesCBCEncrypt(data, key, iv []byte) []byte + func DesCFBDecrypter(data, key, iv []byte) []byte + func DesCFBEncrypt(data, key, iv []byte) []byte + func DesCTRDecrypter(data, key, iv []byte) []byte + func DesCTREncrypt(data, key, iv []byte) []byte + func DesECBDecrypter(data, key []byte) []byte + func DesECBEncrypt(data, key []byte) []byte + func DesOFBDecrypter(data, key, iv []byte) []byte + func DesOFBEncrypt(data, key, iv []byte) []byte + func PrivateKeyDecrypt(data, privateKey string) (string, error) + func PrivateKeyEncrypt(data, privateKey string) (string, error) + func PubkeyDecrypt(data, publicKey string) (string, error) + func PubkeyEncrypt(data, publicKey string) (string, error) + func RsaPrivateKeyFromBytes(privatekey []byte) (*rsa.PrivateKey, error) + func RsaPubkeyFromBytes(publickey []byte) (*rsa.PublicKey, error) + func SignMd5WithRsa(data string, privateKey string) (string, error) + func SignSha1WithRsa(data string, privateKey string) (string, error) + func SignSha256WithRsa(data string, privateKey string) (string, error) + func VerifySignMd5WithRsa(data string, signData string, publicKey string) error + func VerifySignSha1WithRsa(data string, signData string, publicKey string) error + func VerifySignSha256WithRsa(data string, signData string, publicKey string) error + type RSASecurity struct + func (rsas *RSASecurity) PriKeyDecrypt(input []byte) ([]byte, error) + func (rsas *RSASecurity) PriKeyEncrypt(input []byte) ([]byte, error) + func (rsas *RSASecurity) PrivateKey() (*rsa.PrivateKey, error) + func (rsas *RSASecurity) PubKeyDecrypt(input []byte) ([]byte, error) + func (rsas *RSASecurity) PubKeyEncrypt(input []byte) ([]byte, error) + func (rsas *RSASecurity) PublicKey() (*rsa.PublicKey, error) + func (rsas *RSASecurity) SetPrivateKey(priStr string) error + func (rsas *RSASecurity) SetPublicKey(pubStr string) error + func (rsas *RSASecurity) SignMd5WithRsa(data string) (string, error) + func (rsas *RSASecurity) SignSha1WithRsa(data string) (string, error) + func (rsas *RSASecurity) SignSha256WithRsa(data string) (string, error) + func (rsas *RSASecurity) VerifySignMd5WithRsa(data string, signData string) error + func (rsas *RSASecurity) VerifySignSha1WithRsa(data string, signData string) error + func (rsas *RSASecurity) VerifySignSha256WithRsa(data string, signData string) error