Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrefixedHash ¶
PrefixedHash is a helper function that calculates a hash for the given message that can be safely used to calculate a signature from.
The hash is calculated as
keccak256("\x19Ethereum Signed Message:\n"${message length}${message}).
This gives context to the signed message and prevents signing of transactions.
Types ¶
type SigningMethodEth ¶
type SigningMethodEth struct {
Name string
}
SigningMethodEth implements the ETH signing method. Expects *ecdsa.PrivateKey for signing and cli.Address for validation.
var SigningMethod *SigningMethodEth
SigningMethod is a specific instance of the ETH signing method.
func (*SigningMethodEth) Alg ¶
func (m *SigningMethodEth) Alg() string
Alg returns the name of this signing method.
func (*SigningMethodEth) Sign ¶
func (m *SigningMethodEth) Sign(signingString string, privateKey interface{}) (string, error)
Sign implements the Sign method from SigningMethod. For this signing method, must be a *ecdsa.PrivateKey structure.
func (*SigningMethodEth) Verify ¶
func (m *SigningMethodEth) Verify(signingString, signature string, address interface{}) error
Verify implements the Verify method from SigningMethod. For this signing method, must be a cli.Address.