keystore

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: CC0-1.0 Imports: 9 Imported by: 0

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 a Ed25519 key pair.

func GenerateEd25519KeyPair

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

GenerateEd25519KeyPair generates a new Ed25519 key pair for accountID.

func LoadKeyPair

func LoadKeyPair(networkID, accountID string) (*Ed25519KeyPair, error)

LoadKeyPair reads the Ed25519 key pair for the given networkID and accountID from the unencrypted file system key store and returns it.

func LoadKeyPairFromPath

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

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

func NewEd25519KeyPair added in v0.0.15

func NewEd25519KeyPair(privateKey string, accountId string) *Ed25519KeyPair

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