2020-01-04 03:51:53 +00:00
|
|
|
package keymanager
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/bls"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ErrNoSuchKey is returned whenever a request is made for a key of which a key manager is unaware.
|
|
|
|
var ErrNoSuchKey = errors.New("no such key")
|
|
|
|
|
2020-02-03 17:13:58 +00:00
|
|
|
// ErrCannotSign is returned whenever a signing attempt fails.
|
|
|
|
var ErrCannotSign = errors.New("cannot sign")
|
|
|
|
|
2020-01-04 03:51:53 +00:00
|
|
|
// KeyManager controls access to private keys by the validator.
|
|
|
|
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)
|
|
|
|
}
|