Documentation
¶
Index ¶
- func Sender(signer TxSigner, tx *types.Transaction) (types.Address, error)
- func Sign(signer Signer, data []byte) ([]byte, error)
- func Verify(pubKey keypair.PublicKey, signature []byte) (types.Address, error)
- func VerifyMultiSignature(data []byte, keys []keypair.PublicKey, m int, sigs [][]byte) error
- type Signature
- type Signer
- type TxSigner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Signature ¶
type Signature struct {
Scheme keypair.SignatureScheme
Value interface{}
}
type Signer ¶
type Signer interface {
//get signer's private key
PrivKey() keypair.PrivateKey
//get signer's public key
PubKey() keypair.PublicKey
Scheme() keypair.SignatureScheme
}
Signer is the abstract interface of user's information(Keys) for signing data.
type TxSigner ¶
type TxSigner interface {
// Sender returns the sender address of the transaction.
Sender(tx *types.Transaction) (types.Address, error)
// SignatureValues returns the raw R, S, V values corresponding to the
// given signature.
SignatureValues(tx *types.Transaction, sig []byte) (r, s, v *big.Int, err error)
// Hash returns the hash to be signed.
Hash(tx *types.Transaction) types.Hash
// Equal returns true if the given signer is the same as the receiver.
Equal(TxSigner) bool
}
Click to show internal directories.
Click to hide internal directories.