identity

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

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
)

Functions

func NewManager

func NewManager(root string, debug bool) (pkg.IdentityManager, error)

NewManager creates an identity daemon from seed The daemon will auto generate a new seed if the path does not exist debug flag is used to change the behavior slightly when zos is running in debug mode. Right now only the key store uses this flag. In case of debug migrated keys to tpm are not deleted from disks. This allow switching back and forth between tpm and non-tpm key stores.

func NewStore

func NewStore(root string, delete bool) (store.Store, error)

NewStore tries to build the best key store available for this ndoe. On a machine with no tpm support, that would be a file store. If TPM is supported, TPM will be used. There is a special case if tpm is supported, but a file seed exits, this file key will be migrated to the TPM store then deleted (only if delete is set to true)

Types

type KeyPair

type KeyPair struct {
	PrivateKey ed25519.PrivateKey
	PublicKey  ed25519.PublicKey
}

KeyPair holds a public and private side of an ed25519 key pair

func GenerateKeyPair

func GenerateKeyPair() (k KeyPair, err error)

GenerateKeyPair creates a new KeyPair from a random seed

func KeyPairFromKey

func KeyPairFromKey(sk ed25519.PrivateKey) KeyPair

func (KeyPair) Identity

func (k KeyPair) Identity() string

Identity implements the Identifier interface

func (*KeyPair) Save

func (k *KeyPair) Save(path string) error

Save saves the seed of a key pair in a file located at path

Directories

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

Jump to

Keyboard shortcuts

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