key

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Address    types.Address `json:"address"`
	PrivateKey string        `json:"private_key"`
	Encrypted  bool          `json:"encrypted"`
}

Key represents a private key

func LoadKey

func LoadKey(path string) (*Key, error)

func New

func New(password string) (*Key, error)

New create key using ecdsa (secp256r1) if password is empty, encrypted is false

func NewWithPrivateKey

func NewWithPrivateKey(privateKey crypto.PrivateKey, password string) (*Key, error)

func (*Key) GetPrivateKey

func (key *Key) GetPrivateKey(password string) (crypto.PrivateKey, error)

func (*Key) Marshal

func (key *Key) Marshal() ([]byte, error)

func (*Key) Pretty

func (key *Key) Pretty() (string, error)

func (*Key) Unmarshal

func (key *Key) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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