keystore

package
v0.0.0-...-11d313d Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeysAreSame

func KeysAreSame(k1, k2 *Key) (same bool)

func StoreKey

func StoreKey(key *Key, keyFilepath, password string) (er error)

Types

type Key

type Key struct {
	Id      uuid.UUID
	Address gthCommon.Address
	// contains filtered or unexported fields
}

func GenerateAndSaveKey

func GenerateAndSaveKey(keyFilepath, password string) (key *Key, er error)

KeyGeneration // saves automatically

func GenerateKey

func GenerateKey() (key *Key, er error)

func RetrieveKey

func RetrieveKey(keyFilepath, password string) (key *Key, er error)

func (*Key) Delete

func (k *Key) Delete() (er error)

func (*Key) SignTx

func (k *Key) SignTx(tx *types.Transaction,
	height string) (sTx *types.Transaction, er error)

type Keystore

type Keystore struct {
	sync.RWMutex
	Dir  string
	Keys map[gthCommon.Address]*Key
}

func GenerateKeystore

func GenerateKeystore(numberOfKeys int,
	dir, basePassword string) (ks *Keystore, er error)

func OpenKeystore

func OpenKeystore(dir, basePassword string) (ks *Keystore, er error)

func (*Keystore) Addresses

func (ks *Keystore) Addresses() (addrss []gthCommon.Address)

func (*Keystore) Delete

func (ks *Keystore) Delete() (er error)

deletes from memory, but not storage

func (*Keystore) DeleteFromStorage_DANGEROUS

func (ks *Keystore) DeleteFromStorage_DANGEROUS() (er error)

DeleteFromStorage_DANGEROUS() should rarely be used unless need to wipe records CAUTION!! MAY LOSE TOKEN!!

func (*Keystore) GetKeyByAddress

func (ks *Keystore) GetKeyByAddress(address string) (key *Key)

func (*Keystore) PickKey

func (ks *Keystore) PickKey() (key *Key)

Jump to

Keyboard shortcuts

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