wallet

package
v0.30.37 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(handle int) ctx.Channel

Close closes the wallet identified by wallet handle.

func Create

func Create(config Config, credentials Credentials) ctx.Channel

Create creates the wallet. See Config and Credentials morey info.

func Delete

func Delete(config Config, credentials Credentials) ctx.Channel

Delete permanently deletes the wallet with all of its file structures.

func Export

func Export(handle int, exportCfg Credentials) ctx.Channel

Export generates a single encrypted file of the wallet identified by Config and Credentials. See more info of them.

func GenerateKey

func GenerateKey(seed string) ctx.Channel

GenerateKey generates a wallet master key. Returned key is compatible with "RAW" key derivation method. It allows to avoid expensive key derivation for use cases when wallet keys can be stored in a secure enclave.

func Import

func Import(config Config, credentials Credentials, importCfg Credentials) ctx.Channel

Import creates a new wallet from previously exported (Export function) wallet's export file. See more info of Config and Credentials.

func Open

func Open(config Config, credentials Credentials) ctx.Channel

Open opens a wallet identified by Config and Credentials. See more info of them. The successful wallet handle is Result.Handle().

Types

type Config

type Config struct {
	// ID is the name of the wallet i.e. the last directory in the wallet path
	ID string `json:"id"`

	// StorageType is optional, only use if indy_register_wallet_storage() is
	// called. 'Default' value is for local files sytem wallets.
	StorageType string `json:"storage_type,omitempty"`

	// StorageConfig is optional, use when the wallet root path needs to be set.
	*StorageConfig `json:"storage_config,omitempty"`
}

Config is a config struct for indy wallet functions.

type Credentials

type Credentials struct {
	// Path is used only with export and import functions
	Path string `json:"path,omitempty"`

	// Key with method are the actual credentials.
	Key string `json:"key,omitempty"`

	// KeyDerivationMethod is for the algorithm to use for the Key:
	//  ARGON2I_MOD - derive secured wallet master rekey (used by default)
	//  ARGON2I_INT - derive secured wallet master rekey (less secured but faster)
	//  RAW - raw wallet key master provided (skip derivation)
	//        RAW keys can be generated with indy_generate_wallet_key call
	KeyDerivationMethod string `json:"key_derivation_method,omitempty"`
}

Credentials is a indy specific struct to set wallet credentials for the indy wallet functions for opening and exporting the wallet. The Path is only for export/import. The StorageConfig in the Config struct is for the actual wallet location.

type StorageConfig

type StorageConfig struct {
	Path string `json:"path,omitempty"`
}

StorageConfig is indy specific JSON configuration struct to set wallet location path.

Jump to

Keyboard shortcuts

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