key

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKey      = errors.New("provided key is incorrect")
	ErrInvalidAddress  = errors.New("--address option must be specified and valid")
	ErrInvalidPassword = errors.New("invalid password for the encrypted key")
)

Key-related errors.

Functions

func FromNEP2

func FromNEP2(encryptedWif string) (*ecdsa.PrivateKey, error)

FromNEP2 extracts private key from NEP2-encrypted string.

func FromWallet

func FromWallet(w *wallet.Wallet, addrStr string) (*ecdsa.PrivateKey, error)

FromWallet returns private key of the wallet account.

func Get

func Get(keyDesc string, address string) (*ecdsa.PrivateKey, error)

Get returns private key from the followind sources: 1. WIF 2. Raw binary key 3. Wallet file 4. NEP-2 encrypted WIF. Ideally we want to touch file-system on the last step. However, asking for NEP-2 password seems to be confusing if we provide a wallet.

Types

This section is empty.

Jump to

Keyboard shortcuts

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