Documentation
¶
Index ¶
- Variables
- type Key
- type MemoryKey
- func (ac *MemoryKey) Bytes() []byte
- func (ac *MemoryKey) Clear()
- func (ac *MemoryKey) PrivateKey() *ecdsa.PrivateKey
- 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 PrivateKey() *ecdsa.PrivateKey Clear() }
Key defines crypto key functions
type MemoryKey ¶
type MemoryKey struct { PrivKey *ecdsa.PrivateKey ChainID *big.Int // contains filtered or unexported fields }
MemoryKey is the in-memory crypto key
func NewMemoryKey ¶
NewMemoryKey returns a MemoryKey
func NewMemoryKeyFromBytes ¶
NewMemoryKeyFromBytes parse memory key by the byte array
func NewMemoryKeyFromString ¶
NewMemoryKeyFromString parse memory key by the hex string
func (*MemoryKey) PrivateKey ¶
func (ac *MemoryKey) PrivateKey() *ecdsa.PrivateKey
PrivateKey returns *ecdsa.PrivateKey of the private key
Click to show internal directories.
Click to hide internal directories.