store

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Key store implements different methods of storing the node identity seed on disk

Index

Constants

This section is empty.

Variables

View Source
var (
	// SeedVersion1 (binary seed)
	SeedVersion1 = versioned.MustParse("1.0.0")
	// SeedVersion11 (json mnemonic)
	SeedVersion11 = versioned.MustParse("1.1.0")
	// SeedVersionLatest link to latest seed version
	SeedVersionLatest = SeedVersion11
)
View Source
var (
	ErrKeyDoesNotExist = fmt.Errorf("key does not exist")
	ErrInvalidKey      = fmt.Errorf("invalid key data")
)

Functions

func IsTPMEnabled

func IsTPMEnabled() bool

Types

type FileStore

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

func NewFileStore

func NewFileStore(path string) *FileStore

func (*FileStore) Annihilate

func (f *FileStore) Annihilate() error

func (*FileStore) Exists

func (f *FileStore) Exists() (bool, error)

func (*FileStore) Get

func (f *FileStore) Get() (ed25519.PrivateKey, error)

func (*FileStore) Kind

func (f *FileStore) Kind() string

func (*FileStore) Set

func (f *FileStore) Set(key ed25519.PrivateKey) error

type Store

type Store interface {
	// Get returns the key from the store
	Get() (ed25519.PrivateKey, error)
	// Updates, or overrides the current key
	Set(key ed25519.PrivateKey) error
	// Check if key there is a key stored in the
	// store
	Exists() (bool, error)
	// Destroys the key
	Annihilate() error
	// Kind returns store kind
	Kind() string
}

type TPMStore

type TPMStore struct{}

func NewTPM

func NewTPM() *TPMStore

func (*TPMStore) Annihilate

func (t *TPMStore) Annihilate() error

Destroys the key

func (*TPMStore) Exists

func (t *TPMStore) Exists() (bool, error)

Check if key there is a key stored in the store

func (*TPMStore) Get

func (t *TPMStore) Get() (ed25519.PrivateKey, error)

Get returns the key from the store

func (*TPMStore) Kind

func (f *TPMStore) Kind() string

func (*TPMStore) Set

func (t *TPMStore) Set(key ed25519.PrivateKey) error

Updates, or overrides the current key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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