signer

package
v0.0.0-...-966b6e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKey

func NewKey() (string, error)

Types

type Signer

type Signer interface {
	// EthereumAddress returns the ethereum address this signer uses.
	EthereumAddress() common.Address
	SignTx(transaction *types.Transaction, chainID *big.Int) (*types.Transaction, error)
	GetSharedKey(their ecdsa.PublicKey) [32]byte
	GenNonce() []byte
	EncryptAndGetHash(key [32]byte, nonce []byte, message []byte) ([32]byte, []byte, error)
	DecryptMessage(sharedKey [32]byte, cipherText []byte, nonce []byte) (string, error)

	VerifySignature(publicKey ecdsa.PublicKey, signature, messageHash []byte) bool
	Sign(hash [32]byte) ([]byte, error)
	GetPublicKey() *ecdsa.PublicKey
	PublicKeyFromBytes(pbKey []byte) (*ecdsa.PublicKey, error)
	BytesFromPublicKey(key *ecdsa.PublicKey) []byte
	// contains filtered or unexported methods
}

func New

func New(nodePrivateKey string) (Signer, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL