keymanager

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const IncorrectPasswordErrMsg = "invalid checksum"

IncorrectPasswordErrMsg defines a common error string representing an EIP-2335 keystore password was incorrect.

View Source
const (
	KeysReloaded = "Reloaded validator keys into keymanager"
)

KeysReloaded is a "key reloaded" message.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountLister

type AccountLister interface {
	ListKeymanagerAccounts(ctx context.Context, cfg ListKeymanagerAccountConfig) error
}

type Deleter

type Deleter interface {
	DeleteKeystores(ctx context.Context, publicKeys [][]byte) ([]*KeyStatus, error)
}

Deleter can delete keystores from the keymanager.

type IKeymanager

IKeymanager defines a general keymanager interface for Prysm wallets.

type Importer

type Importer interface {
	ImportKeystores(
		ctx context.Context, keystores []*Keystore, passwords []string,
	) ([]*KeyStatus, error)
}

Importer can import new keystores into the keymanager.

type KeyChangeSubscriber

type KeyChangeSubscriber interface {
	SubscribeAccountChanges(pubKeysChan chan [][fieldparams.BLSPubkeyLength]byte) event.Subscription
}

KeyChangeSubscriber allows subscribing to changes made to the underlying keys.

type KeyStatus

type KeyStatus struct {
	Status  KeyStatusType `json:"status"`
	Message string        `json:"message"`
}

KeyStatus is a json representation of the status fields for the keymanager apis

type KeyStatusType

type KeyStatusType string

KeyStatusType is a category of key status

const (
	StatusImported  KeyStatusType = "imported"
	StatusError     KeyStatusType = "error"
	StatusDuplicate KeyStatusType = "duplicate"
	StatusUnknown   KeyStatusType = "unknown"
	StatusNotFound  KeyStatusType = "not_found"
	StatusDeleted   KeyStatusType = "deleted"
	StatusNotActive KeyStatusType = "not_active"
)

type KeyStoreExtractor

type KeyStoreExtractor interface {
	ExtractKeystores(ctx context.Context, publicKeys []bls.PublicKey, password string) ([]*Keystore, error)
}

KeyStoreExtractor allows keys to be extracted from the keymanager.

type KeysFetcher

type KeysFetcher interface {
	FetchValidatingPrivateKeys(ctx context.Context) ([][32]byte, error)
	PublicKeysFetcher
}

KeysFetcher for validating private and public keys.

type Keystore

type Keystore struct {
	Crypto      map[string]interface{} `json:"crypto"`
	ID          string                 `json:"uuid"`
	Pubkey      string                 `json:"pubkey"`
	Version     uint                   `json:"version"`
	Description string                 `json:"description"`
	Name        string                 `json:"name,omitempty"` // field deprecated in favor of description, EIP2335
	Path        string                 `json:"path"`
}

Keystore json file representation as a Go struct.

type Kind

type Kind int

Kind defines an enum for either local, derived, or remote-signing keystores for Prysm wallets.

const (
	// Local keymanager defines an on-disk, encrypted keystore-capable store.
	Local Kind = iota
	// Derived keymanager using a hierarchical-deterministic algorithm.
	Derived
	// Web3Signer keymanager capable of signing data using a remote signer called Web3Signer.
	Web3Signer
)

func ParseKind

func ParseKind(k string) (Kind, error)

ParseKind from a raw string, returning a keymanager kind.

func (Kind) String

func (k Kind) String() string

String marshals a keymanager kind to a string value.

type ListKeymanagerAccountConfig

type ListKeymanagerAccountConfig struct {
	ShowPrivateKeys          bool
	WalletAccountsDir        string
	KeymanagerConfigFileName string
}

type PublicKeyAdder

type PublicKeyAdder interface {
	AddPublicKeys(publicKeys []string) ([]*KeyStatus, error)
}

PublicKeyAdder allows adding public keys to the keymanager.

type PublicKeyDeleter

type PublicKeyDeleter interface {
	DeletePublicKeys(publicKeys []string) ([]*KeyStatus, error)
}

PublicKeyDeleter allows deleting public keys set in keymanager.

type PublicKeysFetcher

type PublicKeysFetcher interface {
	FetchValidatingPublicKeys(ctx context.Context) ([][fieldparams.BLSPubkeyLength]byte, error)
}

PublicKeysFetcher for validating public keys.

type Signer

type Signer interface {
	Sign(context.Context, *validatorpb.SignRequest) (bls.Signature, error)
}

Signer allows signing messages using a validator private key.

Directories

Path Synopsis
Package local defines an implementation of an on-disk, EIP-2335 keystore.json approach towards defining validator accounts in Prysm.
Package local defines an implementation of an on-disk, EIP-2335 keystore.json approach towards defining validator accounts in Prysm.
v1
Package v1 defines mappings of types as defined by the web3signer official specification for its v1 version i.e.
Package v1 defines mappings of types as defined by the web3signer official specification for its v1 version i.e.

Jump to

Keyboard shortcuts

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