Documentation ¶
Index ¶
- Variables
- type Key
- type MemoryKey
- func (ac *MemoryKey) Bytes() []byte
- func (ac *MemoryKey) Clear()
- func (ac *MemoryKey) PublicKey() common.PublicKey
- func (ac *MemoryKey) Sign(h hash.Hash256) (common.Signature, error)
- func (ac *MemoryKey) SignWithPassphrase(h hash.Hash256, passphrase []byte) (common.Signature, error)
- func (ac *MemoryKey) Verify(h hash.Hash256, sig common.Signature) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnknownKeyType = errors.New("unknown key")
)
key errors
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key interface { Sign(h hash.Hash256) (common.Signature, error) SignWithPassphrase(h hash.Hash256, passphrase []byte) (common.Signature, error) Verify(h hash.Hash256, sig common.Signature) bool PublicKey() common.PublicKey Clear() }
Key defines crypto key functions
type MemoryKey ¶
type MemoryKey struct { PrivKey *ecdsa.PrivateKey // contains filtered or unexported fields }
MemoryKey is the in-memory crypto key
func NewMemoryKeyFromBytes ¶
NewMemoryKeyFromBytes parse memory key by the byte array
func NewMemoryKeyFromString ¶
NewMemoryKeyFromString parse memory key by the hex string
Click to show internal directories.
Click to hide internal directories.