identity

package
v0.2.2-rc7 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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