Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMessagePrefix ¶
AddMessagePrefix adds the Ethereum message prefix to the given data as defined in EIP-191.
func ECPublicKeyToAddress ¶
ECPublicKeyToAddress returns the Ethereum address for the given ECDSA public key.
Types ¶
type Recoverer ¶
type Recoverer interface {
// RecoverHash recovers the address from a hash and signature.
RecoverHash(hash types.Hash, sig types.Signature) (*types.Address, error)
// RecoverMessage recovers the address from a message and signature.
RecoverMessage(data []byte, sig types.Signature) (*types.Address, error)
// RecoverTransaction recovers the address from a transaction.
RecoverTransaction(tx *types.Transaction) (*types.Address, error)
}
Recoverer is an interface for recovering addresses from signatures.
var ECRecoverer Recoverer = &ecRecoverer{}
ECRecoverer is a Recoverer implementation for ECDSA.
type Signer ¶
type Signer interface {
// SignHash signs a hash.
SignHash(hash types.Hash) (*types.Signature, error)
// SignMessage signs a message.
SignMessage(data []byte) (*types.Signature, error)
// SignTransaction signs a transaction.
SignTransaction(tx *types.Transaction) error
}
Signer is an interface for signing data.
func ECSigner ¶
func ECSigner(key *ecdsa.PrivateKey) Signer
ECSigner returns a Signer implementation for ECDSA.
Click to show internal directories.
Click to hide internal directories.