identity

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 11 Imported by: 3 modules, 6 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

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 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