keymanager

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: GPL-3.0 Imports: 12 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchKey = errors.New("no such key")

ErrNoSuchKey is returned whenever a request is made for a key of which a key manager is unaware.

Functions

This section is empty.

Types

type Direct

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

Direct is a key manager that holds all secret keys directly.

func NewDirect

func NewDirect(sks []*bls.SecretKey) *Direct

NewDirect creates a new direct key manager from the secret keys provided to it.

func (*Direct) FetchValidatingKeys

func (km *Direct) FetchValidatingKeys() ([][48]byte, error)

FetchValidatingKeys fetches the list of public keys that should be used to validate with.

func (*Direct) Sign

func (km *Direct) Sign(pubKey [48]byte, root [32]byte, domain uint64) (*bls.Signature, error)

Sign signs a message for the validator to broadcast.

type Interop

type Interop struct {
	*Direct
}

Interop is a key manager that deterministically generates keys.

func NewInterop

func NewInterop(keys uint64, offset uint64) (*Interop, error)

NewInterop creates a key manager using the given number of interop keys at the given offset.

type KeyManager

type KeyManager interface {
	// FetchValidatingKeys fetches the list of public keys that should be used to validate with.
	FetchValidatingKeys() ([][48]byte, error)
	// Sign signs a message for the validator to broadcast.
	Sign(pubKey [48]byte, root [32]byte, domain uint64) (*bls.Signature, error)
}

KeyManager controls access to private keys by the validator.

func NewKeystore

func NewKeystore(path string, passphrase string) (KeyManager, error)

NewKeystore creates a key manager populated with the keys from the keystore at the given path.

type Keystore

type Keystore struct {
	*Direct
}

Keystore is a key manager that loads keys from a standard keystore.

type Unencrypted

type Unencrypted struct {
	*Direct
}

Unencrypted is a key manager that loads keys from an unencrypted store.

func NewUnencrypted

func NewUnencrypted(reader io.Reader) (*Unencrypted, error)

NewUnencrypted creates a keystore with the data supplied by the reader.

Jump to

Keyboard shortcuts

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