crypto

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package crypto supports key related functionalities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyPair

func GenerateKeyPair() (pubkey, privkey []byte)

GenerateKeyPair that are public and private key

func PrivkeyToAddress added in v1.2.0

func PrivkeyToAddress(privkey []byte) (addr common.Address, rerr error)

PrivkeyToAddress returns ether address from private key

func PubkeyToAddress added in v1.2.0

func PubkeyToAddress(pubkey []byte) common.Address

PubkeyToAddress returns Ethereum address from public key

func RecoverPubkey

func RecoverPubkey(msg, sig []byte) ([]byte, error)

RecoverPubkey recover public key from signed message

func Sign

func Sign(msg, privkey []byte) ([]byte, error)

Sign given message

Types

This section is empty.

Jump to

Keyboard shortcuts

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