accounts

package
v0.4.31 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: GPL-3.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenSingleKeystore added in v0.4.1

func OpenSingleKeystore(path, pass string, pf PassPhraser) (*ecdsa.PrivateKey, error)

Types

type EthConfig

type EthConfig struct {
	Passphrase string `required:"false" default:"" yaml:"pass_phrase"`
	Keystore   string `required:"false" default:"" yaml:"key_store"`
}

func (*EthConfig) LoadKey

func (c *EthConfig) LoadKey() (*ecdsa.PrivateKey, error)

type KeystoreConfig added in v0.4.1

type KeystoreConfig struct {
	KeyDir      string            `yaml:"key_store" required:"true"`
	PassPhrases map[string]string `yaml:"pass_phrases"`
}

func NewKeystoreConfig added in v0.4.21

func NewKeystoreConfig(path string) *KeystoreConfig

type MultiKeystore added in v0.4.1

type MultiKeystore struct {
	// contains filtered or unexported fields
}

func NewMultiKeystore added in v0.4.1

func NewMultiKeystore(cfg *KeystoreConfig, pf PassPhraser) (*MultiKeystore, error)

func (*MultiKeystore) Generate added in v0.4.1

func (m *MultiKeystore) Generate() (*ecdsa.PrivateKey, error)

Generate creates new key into keystore

func (*MultiKeystore) GenerateWithPassword added in v0.4.1

func (m *MultiKeystore) GenerateWithPassword(pass string) (*ecdsa.PrivateKey, error)

GenerateWithPassword generates new key with given pass-phrase

func (*MultiKeystore) GetDefault added in v0.4.1

func (m *MultiKeystore) GetDefault() (*ecdsa.PrivateKey, error)

GetDefault returns default key for the keystore

func (*MultiKeystore) GetDefaultAddress added in v0.4.1

func (m *MultiKeystore) GetDefaultAddress() (common.Address, error)

func (*MultiKeystore) GetKeyByAddress added in v0.4.1

func (m *MultiKeystore) GetKeyByAddress(addr common.Address) (*ecdsa.PrivateKey, error)

GetKeyByAddress loads and decrypts key form keystore (if present)

func (*MultiKeystore) GetKeyWithPass added in v0.4.1

func (m *MultiKeystore) GetKeyWithPass(addr common.Address, pass string) (*ecdsa.PrivateKey, error)

func (*MultiKeystore) List added in v0.4.1

func (m *MultiKeystore) List() []accounts.Account

List returns list of accounts addresses into keystore

func (*MultiKeystore) SetDefault added in v0.4.1

func (m *MultiKeystore) SetDefault(addr common.Address) error

SetDefault marks key as default for keystore

type PassPhraser

type PassPhraser interface {
	GetPassPhrase() (string, error)
}

PassPhraser is interface for retrieving pass phrase for Eth keys

If you want to retrieve pass phrases reader different ways (e.g: from file, from env variables, interactively from terminal) you must implement PassPhraser reader a different way and pass it to KeyOpener instance

func NewInteractivePassPhraser

func NewInteractivePassPhraser() PassPhraser

NewInteractivePassPhraser implements PassPhraser that prompts user for pass-phrase and read it from terminal's Stdin

func NewStaticPassPhraser

func NewStaticPassPhraser(p string) PassPhraser

NewStaticPassPhraser inits pass phrase reader with pre-defined pass.

Jump to

Keyboard shortcuts

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