Documentation ¶
Index ¶
- func OpenSingleKeystore(path, pass string, pf PassPhraser) (*ecdsa.PrivateKey, error)
- type EthConfig
- type KeystoreConfig
- type MultiKeystore
- func (m *MultiKeystore) Generate() (*ecdsa.PrivateKey, error)
- func (m *MultiKeystore) GenerateWithPassword(pass string) (*ecdsa.PrivateKey, error)
- func (m *MultiKeystore) GetDefault() (*ecdsa.PrivateKey, error)
- func (m *MultiKeystore) GetDefaultAddress() (common.Address, error)
- func (m *MultiKeystore) GetKeyByAddress(addr common.Address) (*ecdsa.PrivateKey, error)
- func (m *MultiKeystore) GetKeyWithPass(addr common.Address, pass string) (*ecdsa.PrivateKey, error)
- func (m *MultiKeystore) List() []accounts.Account
- func (m *MultiKeystore) SetDefault(addr common.Address) error
- type PassPhraser
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 KeystoreConfig ¶ added in v0.4.1
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 ¶
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.