Documentation ¶
Index ¶
- type Signer
- func (ls *Signer) PublicKey() []byte
- func (ls *Signer) PublicKeyBytesToAddress(publicKey []byte) []byte
- func (ls *Signer) PublicKeyToAddress(publicKey ecdsa.PublicKey) []byte
- func (ls *Signer) Sign(message []byte) ([]byte, error)
- func (ls *Signer) Verify(message []byte, signature []byte) (bool, error)
- func (ls *Signer) VerifyWithPublicKey(message []byte, signature []byte, publicKey []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer provides functions to sign a message and verify a signature using the chain-specific signature format. It also provides functions for convertion of a public key to address.
func NewSigner ¶
func NewSigner(privateKey *ecdsa.PrivateKey) *Signer
NewSigner creates a new Signer instance for the provided private key.
func (*Signer) PublicKey ¶
PublicKey returns byte representation of a public key for the private key signer was created with.
func (*Signer) PublicKeyBytesToAddress ¶
PublicKeyBytesToAddress transforms the provided ECDSA public key in a bytes format into chain address represented in bytes.
func (*Signer) PublicKeyToAddress ¶
PublicKeyToAddress transforms the provided ECDSA public key into chain address represented in bytes.
Click to show internal directories.
Click to hide internal directories.