memory

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package memory provides a basis for file based and in-memory vaults

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Importer

type Importer struct {
	*Vault
}

func (*Importer) Import

type PrivateKey

type PrivateKey struct {
	PrivateKey crypt.PrivateKey
	KeyID      string
}

func (*PrivateKey) ID

func (f *PrivateKey) ID() string

ID get the id of this file key

func (*PrivateKey) PublicKey

func (f *PrivateKey) PublicKey() crypt.PublicKey

PublicKey get the public key associated with this key

type UnparsedKey

type UnparsedKey struct {
	Data string
	ID   string
}

type Vault

type Vault struct {
	// contains filtered or unexported fields
}

Vault is a file system based vault

func New

func New(src []*PrivateKey, name string) (*Vault, error)

New create a new in-mempory vault. Call Unlock before use

func NewUnparsed

func NewUnparsed(data []*UnparsedKey, name string) *Vault

NewUnparsed create a new in-mempory vault from Tezos encoded data. Call Unlock before use

func (*Vault) GetPublicKey

func (v *Vault) GetPublicKey(ctx context.Context, keyID string) (vault.StoredKey, error)

GetPublicKey retrieve a public key

func (*Vault) ImportKey

func (v *Vault) ImportKey(ctx context.Context, priv crypt.PrivateKey, opt utils.Options) (vault.StoredKey, error)

func (*Vault) ListPublicKeys

func (v *Vault) ListPublicKeys(ctx context.Context) vault.StoredKeysIterator

ListPublicKeys list all public key available on disk

func (*Vault) Name

func (v *Vault) Name() string

Name returns backend name

func (*Vault) SignMessage

func (v *Vault) SignMessage(ctx context.Context, message []byte, k vault.StoredKey) (sig crypt.Signature, err error)

Sign sign using the specified key

func (*Vault) Unlock

func (v *Vault) Unlock(ctx context.Context) error

Unlock unlock all encrypted keys on disk

Jump to

Keyboard shortcuts

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