Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 GenerateKeyPair ¶
GenerateKeyPair creates a new KeyPair from a random seed
func LoadKeyPair ¶
LoadKeyPair reads a seed from a file located at path and re-create a KeyPair using the seed
func LoadLegacyKeyPair ¶
LoadLegacyKeyPair load keypair without deprecated message for converted
type UserIdentity ¶
type UserIdentity struct { // Mnemonic words of Private Key Mnemonic string `json:"mnemonic"` // ThreebotID generated by explorer ThreebotID uint64 `json:"threebotid"` // contains filtered or unexported fields }
UserIdentity defines serializable struct to identify a user
func NewUserIdentity ¶
func NewUserIdentity(key KeyPair, threebotid uint64) *UserIdentity
NewUserIdentity create a new UserIdentity from existing key
func (*UserIdentity) FromMnemonic ¶
func (u *UserIdentity) FromMnemonic(mnemonic string) error
FromMnemonic initialize the Key (KeyPair) from mnemonic argument
func (*UserIdentity) Load ¶
func (u *UserIdentity) Load(path string) error
Load fetch a seed file and initialize key based on mnemonic
func (*UserIdentity) Save ¶
func (u *UserIdentity) Save(path string) error
Save dumps UserIdentity into a versioned file