keystore

package
v0.0.0-...-c638c98 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoPub is returned when a public key can't be found
	ErrNoPub = errors.New("Public key not found")
)

Functions

This section is empty.

Types

type Memory

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

Memory is a store that stays in memory. Good for testing.

func NewMemoryStore

func NewMemoryStore(priv *ecdsa.PrivateKey) *Memory

NewMemoryStore creates a new in memory Store

func (*Memory) Add

func (m *Memory) Add(key *ecdsa.PublicKey) error

Add a key to the store

func (*Memory) Find

func (m *Memory) Find(sig *block.Signature) (*ecdsa.PublicKey, error)

Find a key by the given signature

func (*Memory) Priv

func (m *Memory) Priv() *ecdsa.PrivateKey

func (*Memory) Remove

func (m *Memory) Remove(key *ecdsa.PublicKey) error

type Store

type Store interface {
	// Find attempts to find a public key given a signature.
	Find(sig *block.Signature) (*ecdsa.PublicKey, error)

	// Add A key to the store
	Add(key *ecdsa.PublicKey) error

	// Remove does what it sounds like
	Remove(key *ecdsa.PublicKey) error

	// Priv loads a private key
	Priv() *ecdsa.PrivateKey
}

Store provides storage and retreval of keys.

Jump to

Keyboard shortcuts

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