ethsecp256k1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecoveryFromPrivateKey

func RecoveryFromPrivateKey(privateKey string) ([32]byte, error)

Types

type PrivKey

type PrivKey struct {
	// contains filtered or unexported fields
}

PrivKey is a wrapper around an ecdsa.PrivateKey

func NewPrivKey

func NewPrivKey(secret string) (*PrivKey, error)

NewPrivKey creates a new PrivKey from a secret.

func (*PrivKey) PubKey

func (pk *PrivKey) PubKey() *PubKey

func (*PrivKey) Sign

func (pk *PrivKey) Sign(message []byte) (signature []byte, err error)

Sign signs a message.

type PubKey

type PubKey struct {
	// contains filtered or unexported fields
}

PubKey is a wrapper around an ecdsa.PublicKey

func NewPubKey

func NewPubKey(pubKey *ecdsa.PublicKey) *PubKey

NewPubKey creates a new PubKey from an ecdsa.PublicKey.

func (*PubKey) Address

func (pk *PubKey) Address() common.Address

Address returns the eth address of the private key.

func (*PubKey) Verify

func (pk *PubKey) Verify(message []byte, signature []byte) (valid bool)

Verify verifies a signature.

Jump to

Keyboard shortcuts

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