identity

package
v0.6.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 12 Imported by: 6

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
)
View Source
var (
	// ErrCorruptSeed is raised if seed file is invalid
	ErrCorruptSeed = fmt.Errorf("invalid seed file")
)

Functions

func LoadSeed

func LoadSeed(path string) ([]byte, error)

LoadSeed from path

func NewManager

func NewManager(path string) (pkg.IdentityManager, error)

NewManager creates an identity daemon from seed The daemon will auto generate a new seed if the path does not exist

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 FromSeed

func FromSeed(seed []byte) (pair KeyPair, err error)

FromSeed creates a new key pair from seed

func GenerateKeyPair

func GenerateKeyPair() (k KeyPair, err error)

GenerateKeyPair creates a new KeyPair from a random seed

func LoadKeyPair

func LoadKeyPair(path string) (k KeyPair, err error)

LoadKeyPair reads a seed from a file located at path and re-create a KeyPair using the seed

func LoadLegacyKeyPair

func LoadLegacyKeyPair(path string) (k KeyPair, err error)

LoadLegacyKeyPair load keypair without deprecated message for converted

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

Jump to

Keyboard shortcuts

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