Documentation
¶
Overview ¶
Package keyutil provides utilities for loading private keys that integrate with the Lux CLI key management system (~/.lux/keys/).
Index ¶
Constants ¶
View Source
const ( // LuxKeysDir is the CLI key storage directory LuxKeysDir = ".lux/keys" // MnemonicFile is the mnemonic filename used by CLI MnemonicFile = "mnemonic.txt" // ECPrivateKeyFile is the EC private key filename used by CLI ECPrivateKeyFile = "ec/private.key" )
Variables ¶
This section is empty.
Functions ¶
func LoadKey ¶
func LoadKey() (*secp256k1.PrivateKey, error)
LoadKey attempts to load a private key using the priority order above.
func LoadKeyByName ¶
func LoadKeyByName(name string) (*secp256k1.PrivateKey, error)
LoadKeyByName loads a key from ~/.lux/keys/<name>/ It first tries the EC private key file, then falls back to mnemonic
func MustLoadKey ¶
func MustLoadKey() *secp256k1.PrivateKey
MustLoadKey loads a secp256k1 private key from (in order of priority): 1. LUX_MNEMONIC environment variable (BIP39 mnemonic phrase) 2. Key name provided as first command line argument 3. ~/.lux/keys/default/ if it exists
Panics with a helpful message if no key is provided.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.