keystore

package
v0.0.0-...-0f51ad2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LightScryptN = 1 << 12
	LightScryptP = 6
	ScryptR      = 8
	ScryptDKLen  = 32
)

Variables

View Source
var (
	ErrDecrypt = errors.New("could not decrypt key with given passphrase")
)

Functions

func EncryptKey

func EncryptKey(key *Key, password string) ([]byte, error)

EncryptKey encrypts a key using the specified scrypt parameters into a json blob that can be decrypted later on.

func StoreKey

func StoreKey(keyPath string, key *Key, password string) error

Types

type Key

type Key struct {
	ID      string
	PrivKey string
}

Key struct type for keystore file

func DecryptKey

func DecryptKey(keyjson []byte, password string) (*Key, error)

DecryptKey decrypts a key from a json blob, returning the private key itself.

func GetKey

func GetKey(keyPath, password string) (*Key, error)

Jump to

Keyboard shortcuts

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