keystore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypter

func Decrypter(cipherType byte, pk keys.PrivateKey) (cipher.Decrypter, error)

Decrypter use the correct function to get the decrypter from private key

func Signer

func Signer(chain string, pk keys.PrivateKey) (mailbox.Signer, error)

Signer use the correct function to get the decrypter from private key

Types

type EncryptedKey

type EncryptedKey struct {
	Address    string    `json:"address"`
	CipherText []byte    `json:"cipher-text"`
	CurveType  string    `json:"curve-type"`
	ID         string    `json:"id"`
	Timestamp  time.Time `json:"timestamp"`
	Version    string    `json:"version"`
	// KDF Key Definition Function
	StorageCipher string             `json:"storage-cipher"`
	KDF           string             `json:"kdf"`
	ScryptParams  *scrypt.DeriveOpts `json:"scrypt-params"`
}

EncryptedKey the data object when storing or retrieving a private key

type Store

type Store interface {
	GetSigner(address []byte, chain string, deriveKeyOptions multi.OptionsBuilders) (mailbox.Signer, error)
	GetDecrypter(address []byte, decrypterType byte, deriveKeyOptions multi.OptionsBuilders) (cipher.Decrypter, error)
	Store(private keys.PrivateKey, curveType string, deriveKeyOptions multi.OptionsBuilders) (address []byte, err error)
	HasAddress(address []byte) bool
	GetAddresses() ([][]byte, error)
}

Store private keys but does not return them, instead return decrypter or signer.

Directories

Path Synopsis
kdf

Jump to

Keyboard shortcuts

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