key

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCastingPublicKeyToECDSA     = errors.New("error casting public key to ECDSA")
	ErrConvertingPrivateKeyToECDSA = errors.New("error converting private key to ECDSA")
)

Functions

func Generate

func Generate() (prk string, a string, err error)

Generate returns a private key and its public address as two strings.

func GenerateN

func GenerateN(N int) (map[string]string, error)

GenerateN returns a map of private keys and public addresses. If N <= 0, generates a single entry.

func SignMessage added in v1.0.2

func SignMessage(k, m string) (s string, err error)

Sign message using EIP 191 with the personal_sign format

func ValidPrivateKey

func ValidPrivateKey(k string) bool

ValidPrivateKey tests if the key is a well formated private key

func ValidPublicAddress

func ValidPublicAddress(a string) bool

ValidPublicAddress tests if the address is a well formated public address

Types

This section is empty.

Jump to

Keyboard shortcuts

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