Documentation ¶
Index ¶
- func SetConfigEnc(name string, key, iv []byte)
- type Aes
- type AesWithKey
- type Ecdsa
- func (ec *Ecdsa) Decrypt(data string, priKey string) (string, error)
- func (ec *Ecdsa) DecryptBytes(data, priKey []byte) ([]byte, error)
- func (ec *Ecdsa) Encrypt(data, pubKey string) (string, error)
- func (ec *Ecdsa) EncryptBytes(data, pubKey []byte) ([]byte, error)
- func (ec *Ecdsa) GenKey() (priKey string, pubKey string, error error)
- func (ec *Ecdsa) GenKeyBytes() (priKey []byte, pubKey []byte, error error)
- func (ec *Ecdsa) Sign(data string, priKey string) (string, error)
- func (ec *Ecdsa) SignBytes(data, priKey []byte) ([]byte, error)
- func (ec *Ecdsa) Verify(data string, signature string, pubKey string) (bool, error)
- func (ec *Ecdsa) VerifyBytes(data, signature, pubKey []byte) bool
- type Hash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetConfigEnc ¶ added in v1.0.7
Types ¶
type Aes ¶
type Aes struct {
// contains filtered or unexported fields
}
func (*Aes) Decrypt ¶
Decrypt 解密为字符串 Decrypt data hex编码的加密后结果 Decrypt key hex编码的16位或32位密钥 Decrypt iv hex编码的16位或32位向量 Decrypt return 解密后的数据,string类型
func (*Aes) DecryptBytes ¶
DecryptBytes 解密为二进制数据 DecryptBytes data 二进制的加密后结果 DecryptBytes key 二进制的16位或32位密钥 DecryptBytes iv 二进制的16位或32位向量 DecryptBytes return 解密后的数据,二进制的字节数组
type AesWithKey ¶ added in v1.0.7
type AesWithKey struct {
// contains filtered or unexported fields
}
func (*AesWithKey) Decrypt ¶ added in v1.0.7
func (ae *AesWithKey) Decrypt(data string) (string, error)
Decrypt 解密为字符串 Decrypt data hex编码的加密后结果 Decrypt return 解密后的数据,string类型
func (*AesWithKey) DecryptBytes ¶ added in v1.0.7
func (ae *AesWithKey) DecryptBytes(data []byte) ([]byte, error)
DecryptBytes 解密为二进制数据 DecryptBytes data 二进制的加密后结果 DecryptBytes return 解密后的数据,二进制的字节数组
func (*AesWithKey) Encrypt ¶ added in v1.0.7
func (ae *AesWithKey) Encrypt(data string) (string, error)
Encrypt 将字符串加密 Encrypt data 用于加密的数据,string类型 Encrypt return 返回hex编码的加密结果
func (*AesWithKey) EncryptBytes ¶ added in v1.0.7
func (ae *AesWithKey) EncryptBytes(data []byte) ([]byte, error)
EncryptBytes 将二进制数据加密 EncryptBytes data 用于加密的数据,二进制的字节数组 EncryptBytes return 返回二进制的加密结果
type Ecdsa ¶
type Ecdsa struct {
// contains filtered or unexported fields
}
func (*Ecdsa) DecryptBytes ¶
DecryptBytes priKey 二进制的私钥信息
func (*Ecdsa) EncryptBytes ¶
EncryptBytes pubKey 二进制的公钥信息
func (*Ecdsa) GenKeyBytes ¶
GenKeyBytes 生成二进制的公钥私钥 GenKeyBytes priKey 二进制的私钥信息 GenKeyBytes pubKey 二进制的公钥信息
func (*Ecdsa) SignBytes ¶
SignBytes 对数据进行签名,返回二进制的数据 SignBytes data 将要签名的二进制数据 SignBytes priKey 二进制的私钥信息
func (*Ecdsa) Verify ¶
Verify 校验签名 Verify data 将要签名的数据 Verify signature hex编码的签名信息 Verify pubKey hex编码的公钥信息 Verify return 校验结果
func (*Ecdsa) VerifyBytes ¶
VerifyBytes 校验签名 VerifyBytes data 将要签名的二进制数据 VerifyBytes signature 二进制的签名信息 VerifyBytes pubKey 二进制的公钥信息 VerifyBytes return 校验结果
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}