Documentation ¶
Index ¶
- type Aes
- 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 ¶
This section is empty.
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 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
}