store

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

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