keystore

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: CC0-1.0 Imports: 9 Imported by: 2

Documentation

Overview

Package keystore implements an unencrypted file system key store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ed25519KeyPair

type Ed25519KeyPair struct {
	AccountID      string             `json:"account_id"`
	PublicKey      string             `json:"public_key"`
	PrivateKey     string             `json:"private_key,omitempty"`
	SecretKey      string             `json:"secret_key,omitempty"`
	Ed25519PubKey  ed25519.PublicKey  `json:"-"`
	Ed25519PrivKey ed25519.PrivateKey `json:"-"`
}

Ed25519KeyPair is an Ed25519 key pair.

func GenerateEd25519KeyPair

func GenerateEd25519KeyPair(accountID string) (*Ed25519KeyPair, error)

GenerateEd25519KeyPair generates a new Ed25519 key pair for accountID.

func LoadKeyPairFromPath added in v0.0.5

func LoadKeyPairFromPath(path, accountID string) (*Ed25519KeyPair, error)

LoadKeyPairFromPath reads the Ed25519 key pair for the given ccountID from path returns it.

func (*Ed25519KeyPair) Write

func (kp *Ed25519KeyPair) Write(networkID string) (string, error)

Write the Ed25519 key pair to the unencrypted file system key store with networkID and return the filename of the written file.

Jump to

Keyboard shortcuts

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