Documentation ¶
Index ¶
- Variables
- type CachedKeystore
- func (c *CachedKeystore) Add(pubkey validatorpk.PubKey, key []byte, auth string) error
- func (c *CachedKeystore) Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error)
- func (c *CachedKeystore) GetUnlocked(pubkey validatorpk.PubKey) (*encryption.PrivateKey, error)
- func (c *CachedKeystore) Has(pubkey validatorpk.PubKey) bool
- func (c *CachedKeystore) Unlock(pubkey validatorpk.PubKey, auth string) error
- func (c *CachedKeystore) Unlocked(pubkey validatorpk.PubKey) bool
- type FileKeystore
- func (f *FileKeystore) Add(pubkey validatorpk.PubKey, key []byte, auth string) error
- func (f *FileKeystore) Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error)
- func (f *FileKeystore) Has(pubkey validatorpk.PubKey) bool
- func (f *FileKeystore) PathOf(pubkey validatorpk.PubKey) string
- type KeystoreI
- type MemKeystore
- type RawKeystoreI
- type Signer
- type SignerI
- type SyncedKeystore
- func (s *SyncedKeystore) Add(pubkey validatorpk.PubKey, key []byte, auth string) error
- func (s *SyncedKeystore) Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error)
- func (s *SyncedKeystore) GetUnlocked(pubkey validatorpk.PubKey) (*encryption.PrivateKey, error)
- func (s *SyncedKeystore) Has(pubkey validatorpk.PubKey) bool
- func (s *SyncedKeystore) Unlock(pubkey validatorpk.PubKey, auth string) error
- func (s *SyncedKeystore) Unlocked(pubkey validatorpk.PubKey) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyUnlocked = errors.New("already unlocked") ErrLocked = errors.New("key is locked") )
View Source
var ( ErrNotFound = errors.New("key is not found") ErrAlreadyExists = errors.New("key already exists") )
Functions ¶
This section is empty.
Types ¶
type CachedKeystore ¶
type CachedKeystore struct {
// contains filtered or unexported fields
}
func NewCachedKeystore ¶
func NewCachedKeystore(backend RawKeystoreI) *CachedKeystore
func (*CachedKeystore) Add ¶
func (c *CachedKeystore) Add(pubkey validatorpk.PubKey, key []byte, auth string) error
func (*CachedKeystore) Get ¶
func (c *CachedKeystore) Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error)
func (*CachedKeystore) GetUnlocked ¶
func (c *CachedKeystore) GetUnlocked(pubkey validatorpk.PubKey) (*encryption.PrivateKey, error)
func (*CachedKeystore) Has ¶
func (c *CachedKeystore) Has(pubkey validatorpk.PubKey) bool
func (*CachedKeystore) Unlock ¶
func (c *CachedKeystore) Unlock(pubkey validatorpk.PubKey, auth string) error
func (*CachedKeystore) Unlocked ¶
func (c *CachedKeystore) Unlocked(pubkey validatorpk.PubKey) bool
type FileKeystore ¶
type FileKeystore struct {
// contains filtered or unexported fields
}
func NewDefaultFileRawKeystore ¶
func NewDefaultFileRawKeystore(dir string) *FileKeystore
func NewFileKeystore ¶
func NewFileKeystore(dir string, enc *encryption.Keystore) *FileKeystore
func (*FileKeystore) Add ¶
func (f *FileKeystore) Add(pubkey validatorpk.PubKey, key []byte, auth string) error
func (*FileKeystore) Get ¶
func (f *FileKeystore) Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error)
func (*FileKeystore) Has ¶
func (f *FileKeystore) Has(pubkey validatorpk.PubKey) bool
func (*FileKeystore) PathOf ¶
func (f *FileKeystore) PathOf(pubkey validatorpk.PubKey) string
type KeystoreI ¶
type KeystoreI interface { RawKeystoreI Unlock(pubkey validatorpk.PubKey, auth string) error Unlocked(pubkey validatorpk.PubKey) bool GetUnlocked(pubkey validatorpk.PubKey) (*encryption.PrivateKey, error) }
type MemKeystore ¶
type MemKeystore struct {
// contains filtered or unexported fields
}
func NewMemKeystore ¶
func NewMemKeystore() *MemKeystore
func (*MemKeystore) Add ¶
func (m *MemKeystore) Add(pubkey validatorpk.PubKey, key []byte, auth string) error
func (*MemKeystore) Get ¶
func (m *MemKeystore) Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error)
func (*MemKeystore) Has ¶
func (m *MemKeystore) Has(pubkey validatorpk.PubKey) bool
type RawKeystoreI ¶
type RawKeystoreI interface { Has(pubkey validatorpk.PubKey) bool Add(pubkey validatorpk.PubKey, key []byte, auth string) error Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error) }
type SignerI ¶
type SignerI interface {
Sign(pubkey validatorpk.PubKey, digest []byte) ([]byte, error)
}
type SyncedKeystore ¶
type SyncedKeystore struct {
// contains filtered or unexported fields
}
func NewDefaultFileKeystore ¶
func NewDefaultFileKeystore(dir string) *SyncedKeystore
func NewDefaultMemKeystore ¶
func NewDefaultMemKeystore() *SyncedKeystore
func NewSyncedKeystore ¶
func NewSyncedKeystore(backend KeystoreI) *SyncedKeystore
func (*SyncedKeystore) Add ¶
func (s *SyncedKeystore) Add(pubkey validatorpk.PubKey, key []byte, auth string) error
func (*SyncedKeystore) Get ¶
func (s *SyncedKeystore) Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error)
func (*SyncedKeystore) GetUnlocked ¶
func (s *SyncedKeystore) GetUnlocked(pubkey validatorpk.PubKey) (*encryption.PrivateKey, error)
func (*SyncedKeystore) Has ¶
func (s *SyncedKeystore) Has(pubkey validatorpk.PubKey) bool
func (*SyncedKeystore) Unlock ¶
func (s *SyncedKeystore) Unlock(pubkey validatorpk.PubKey, auth string) error
func (*SyncedKeystore) Unlocked ¶
func (s *SyncedKeystore) Unlocked(pubkey validatorpk.PubKey) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.