keystore

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

README

ref: https://en.wikipedia.org/wiki/Argon2 Argon2 has included in the golang.org/x/crypto Perhaps the better choice than scrypt...

the newest option: Balloon Hashing

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNeedAddress       = errors.New("need address")
	ErrNotFound          = errors.New("key not found")
	ErrNotUnlocked       = errors.New("key not unlocked")
	ErrInvalidPassphrase = errors.New("passphrase is invalid")
)

Functions

This section is empty.

Types

type Key

type Key interface {
	PublicKey() []byte
	PrivateKey() []byte
	Clear()
}

type Keystore

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

func NewKeystore

func NewKeystore(dirPath string) *Keystore

func NewKeystoreWithConfig

func NewKeystoreWithConfig(config *config.Config) *Keystore

func (*Keystore) Contains

func (ks *Keystore) Contains(address string) (bool, error)

func (*Keystore) Delete

func (ks *Keystore) Delete(address string) error

func (*Keystore) GetKey

func (ks *Keystore) GetKey(address string, passphrase []byte) ([]byte, error)

func (*Keystore) GetUnlocked

func (ks *Keystore) GetUnlocked(address string) ([]byte, error)

func (*Keystore) List

func (ks *Keystore) List() []string

func (*Keystore) Lock

func (ks *Keystore) Lock(address string) error

func (*Keystore) SetKey

func (ks *Keystore) SetKey(address string, key []byte, passphrase []byte) error

func (*Keystore) Unlock

func (ks *Keystore) Unlock(address string, passphrase []byte, timeout time.Duration) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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