keystore

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypter

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

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

func Signer

func Signer(protocol string, pk crypto.PrivateKey) (signer.Signer, error)

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

Types

type EncryptedKey

type EncryptedKey struct {
	PublicKeyBytes []byte    `json:"public-key"`
	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 ProtocolAddress added in v0.0.70

type ProtocolAddress struct {
	Address  []byte
	Protocol string
	Network  string
}

func FlattenAddressesMap added in v0.0.70

func FlattenAddressesMap(in map[string]map[string][][]byte) []ProtocolAddress

type Store

type Store interface {
	GetSigner(address []byte, protocol, network string, deriveKeyOptions multi.OptionsBuilders) (signer.Signer, error)
	GetDecrypter(address []byte, protocol, network string, decrypterType byte, deriveKeyOptions multi.OptionsBuilders) (cipher.Decrypter, error)
	Store(protocol, network string, private crypto.PrivateKey, deriveKeyOptions multi.OptionsBuilders) (crypto.PublicKey, error)
	HasAddress(searchAddress []byte, protocol, network string) bool
	GetAddresses(protocol, network string) (map[string]map[string][][]byte, error)
}

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

Directories

Path Synopsis
kdf
Package keystoretest is a generated GoMock package.
Package keystoretest is a generated GoMock package.

Jump to

Keyboard shortcuts

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