keys

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchPubKeyBySignMsg

func FetchPubKeyBySignMsg(sign, msg string) (*ecdsa.PublicKey, error)

func PubKeyToAddress

func PubKeyToAddress(pubKey *ecdsa.PublicKey) common.Address

func VerifySignature

func VerifySignature(publicKey, sign, msg string) bool

func VerifySignatureByAddress

func VerifySignatureByAddress(address, sign, msg string) bool

Types

type PrivateKey

type PrivateKey struct {
	EthPrivate    *ecdsa.PrivateKey
	LibP2pPrivate crypto.PrivKey
}

func GetFromStore

func GetFromStore(dir, name string) (*PrivateKey, error)

func NewPrivateKey

func NewPrivateKey() (*PrivateKey, error)

func NewPrivateKeyByBase58

func NewPrivateKeyByBase58(keyBase string) (*PrivateKey, error)

func NewPrivateKeyByEthPri

func NewPrivateKeyByEthPri(priKey *ecdsa.PrivateKey) (*PrivateKey, error)

func NewPrivateKeyByLibP2pPri

func NewPrivateKeyByLibP2pPri(priKey crypto.PrivKey) (*PrivateKey, error)

func (*PrivateKey) Encode58Public

func (pri *PrivateKey) Encode58Public() string

func (*PrivateKey) EncodePublic

func (pri *PrivateKey) EncodePublic() []byte

func (*PrivateKey) GetEthAddress

func (pri *PrivateKey) GetEthAddress() common.Address

func (*PrivateKey) PutStore

func (pri *PrivateKey) PutStore(dir, keyName string) error

func (*PrivateKey) Sign

func (pri *PrivateKey) Sign(msg string) (string, error)

Jump to

Keyboard shortcuts

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