keys

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 21 Imported by: 3

Documentation

Index

Constants

View Source
const KeyDBName = "keys"

KeyDBName is the directory under root where we store the keys

Variables

This section is empty.

Functions

func GetKeyBase

func GetKeyBase(ctx context.CLIContext) (keys.Keybase, error)

GetKeyBase initializes a read-only KeyBase based on the configuration.

func GetKeyBaseFromDir

func GetKeyBaseFromDir(ctx context.CLIContext, rootDir string) (keys.Keybase, error)

GetKeyBaseFromDir initializes a read-only keybase at a particular dir.

func GetKeyInfo

func GetKeyInfo(ctx context.CLIContext, name string) (keys.Info, error)

GetKeyInfo returns key info for a given name. An error is returned if the keybase cannot be retrieved or getting the info fails.

func GetPassphrase

func GetPassphrase(ctx context.CLIContext, name string) (string, error)

GetPassphrase returns a passphrase for a given name. It will first retrieve the key info for that name if the type is local, it'll fetch input from STDIN. Otherwise, an empty passphrase is returned. An error is returned if the key info cannot be fetched or reading from STDIN fails.

func KeysCommand

func KeysCommand(cdc *go_amino.Codec) *cobra.Command

func ReadPassphraseFromStdin

func ReadPassphraseFromStdin(name string) (string, error)

ReadPassphraseFromStdin attempts to read a passphrase from STDIN return an error upon failure.

Types

type KeyOutput

type KeyOutput struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Address string `json:"address"`
	PubKey  string `json:"pub_key"`
	Seed    string `json:"seed,omitempty"`
}

used for outputting keys.Info over REST

func Bech32KeyOutput

func Bech32KeyOutput(ctx context.CLIContext, info keys.Info) (KeyOutput, error)

create a KeyOutput in bech32 format

func Bech32KeysOutput

func Bech32KeysOutput(ctx context.CLIContext, infos []keys.Info) ([]KeyOutput, error)

create a list of KeyOutput in bech32 format

Jump to

Keyboard shortcuts

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