Documentation ¶
Index ¶
- type EcKey
- func (e *EcKey) Decrypt(in []byte) []byte
- func (e *EcKey) Encrypt(data []byte) []byte
- func (e *EcKey) GetPriKeyBytes() []byte
- func (e *EcKey) GetPriKeyHex() string
- func (e *EcKey) GetPubKeyBytes(compressed bool) []byte
- func (e *EcKey) GetPubKeyHex(compressed bool) string
- func (e *EcKey) IsPriKeyNil() bool
- func (e *EcKey) Sign(data []byte) ([]byte, error)
- func (e *EcKey) Verify(data, signature []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EcKey ¶
type EcKey struct {
// contains filtered or unexported fields
}
用于管理公私钥的结构 依赖于ethereum的基础包,但本结构总的数据都是golang基础包中的
func FromPubKeyBytes ¶
根据公钥还原eckey,可以进行签名验证及数据解密
func (*EcKey) GetPubKeyBytes ¶
获取公钥的字节数组 compressed代表是否压缩,true为压缩,false为不压缩
func (*EcKey) GetPubKeyHex ¶
获取hex编码后的公钥 compressed代表是否压缩,true为压缩,false为不压缩
Click to show internal directories.
Click to hide internal directories.