keys

package
v0.47.14 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 28 Imported by: 1,861

Documentation

Index

Constants

View Source
const (
	// FlagAddress is the flag for the user's address on the command line.
	FlagAddress = "address"
	// FlagPublicKey represents the user's public key on the command line.
	FlagPublicKey = "pubkey"
	// FlagBechPrefix defines a desired Bech32 prefix encoding for a key.
	FlagBechPrefix = "bech"
	// FlagDevice indicates that the information should be shown in the device
	FlagDevice = "device"
)
View Source
const (
	OutputFormatText = "text"
	OutputFormatJSON = "json"
)

available output formats.

View Source
const (

	// DefaultKeyPass contains the default key password for genesis transactions
	DefaultKeyPass = "12345678"
)

Variables

This section is empty.

Functions

func AddKeyCommand

func AddKeyCommand() *cobra.Command

AddKeyCommand defines a keys command to add a generated or recovered private key to keybase.

func Commands

func Commands(defaultNodeHome string) *cobra.Command

Commands registers a sub-tree of commands to interact with local private key storage.

func DeleteKeyCommand

func DeleteKeyCommand() *cobra.Command

DeleteKeyCommand deletes a key from the key store.

func ExportKeyCommand

func ExportKeyCommand() *cobra.Command

ExportKeyCommand exports private keys from the key store.

func ImportKeyCommand

func ImportKeyCommand() *cobra.Command

ImportKeyCommand imports private keys from a keyfile.

func ImportKeyHexCommand added in v0.47.5

func ImportKeyHexCommand() *cobra.Command

func ListKeyTypesCmd added in v0.47.1

func ListKeyTypesCmd() *cobra.Command

ListKeyTypesCmd lists all key types.

func ListKeysCmd

func ListKeysCmd() *cobra.Command

ListKeysCmd lists all keys in the key store.

func MigrateCommand

func MigrateCommand() *cobra.Command

MigrateCommand migrates key information from legacy keybase to OS secret store.

func MnemonicKeyCommand

func MnemonicKeyCommand() *cobra.Command

MnemonicKeyCommand computes the bip39 memonic for input entropy.

func ParseKeyStringCommand

func ParseKeyStringCommand() *cobra.Command

ParseKeyStringCommand parses an address from hex to bech32 and vice versa.

func RenameKeyCommand added in v0.46.0

func RenameKeyCommand() *cobra.Command

RenameKeyCommand renames a key from the key store.

func ShowKeysCmd

func ShowKeysCmd() *cobra.Command

ShowKeysCmd shows key information for a given key name.

Types

type AddNewKey

type AddNewKey struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Mnemonic string `json:"mnemonic"`
	Account  int    `json:"account,string,omitempty"`
	Index    int    `json:"index,string,omitempty"`
}

AddNewKey request a new key

func NewAddNewKey

func NewAddNewKey(name, password, mnemonic string, account, index int) AddNewKey

NewAddNewKey constructs a new AddNewKey request structure.

type DeleteKeyReq

type DeleteKeyReq struct {
	Password string `json:"password"`
}

DeleteKeyReq requests deleting a key

func NewDeleteKeyReq

func NewDeleteKeyReq(password string) DeleteKeyReq

NewDeleteKeyReq constructs a new DeleteKeyReq structure.

type RecoverKey

type RecoverKey struct {
	Password string `json:"password"`
	Mnemonic string `json:"mnemonic"`
	Account  int    `json:"account,string,omitempty"`
	Index    int    `json:"index,string,omitempty"`
}

RecoverKeyBody recovers a key

func NewRecoverKey

func NewRecoverKey(password, mnemonic string, account, index int) RecoverKey

NewRecoverKey constructs a new RecoverKey request structure.

type UpdateKeyReq

type UpdateKeyReq struct {
	OldPassword string `json:"old_password"`
	NewPassword string `json:"new_password"`
}

UpdateKeyReq requests updating a key

func NewUpdateKeyReq

func NewUpdateKeyReq(old, new string) UpdateKeyReq

NewUpdateKeyReq constructs a new UpdateKeyReq structure.

Jump to

Keyboard shortcuts

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