Documentation
¶
Overview ¶
Package keys provides key management utilities for TRON accounts.
Index ¶
- func AddNewKey(password string)
- func FromMnemonicSeedAndPassphrase(m, passphrase string, index int) (*btcec.PrivateKey, *btcec.PublicKey)deprecated
- func GenerateKey() (*btcec.PrivateKey, error)
- func GetPrivateKeyFromBytes(privateKeyBytes []byte) (*btcec.PrivateKey, error)
- func GetPrivateKeyFromHex(privateKeyHex string) (*btcec.PrivateKey, error)
- func ListKeys(keystoreDir string)
- func ZeroECDSAKey(key *ecdsa.PrivateKey)
- func ZeroPrivateKey(key *btcec.PrivateKey)
- type Dump
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNewKey ¶
func AddNewKey(password string)
AddNewKey creates a new account in the default keystore directory.
func FromMnemonicSeedAndPassphrase
deprecated
func GenerateKey ¶ added in v0.24.1
func GenerateKey() (*btcec.PrivateKey, error)
GenerateKey generates a new random secp256k1 private key.
func GetPrivateKeyFromBytes ¶ added in v0.24.1
func GetPrivateKeyFromBytes(privateKeyBytes []byte) (*btcec.PrivateKey, error)
GetPrivateKeyFromBytes creates a private key from raw 32-byte key material.
func GetPrivateKeyFromHex ¶ added in v0.24.1
func GetPrivateKeyFromHex(privateKeyHex string) (*btcec.PrivateKey, error)
GetPrivateKeyFromHex parses a hex-encoded private key string.
func ListKeys ¶
func ListKeys(keystoreDir string)
ListKeys prints all accounts in the keystore directory to stdout.
func ZeroECDSAKey ¶ added in v0.26.0
func ZeroECDSAKey(key *ecdsa.PrivateKey)
ZeroECDSAKey overwrites the backing memory of an ECDSA private key's D value. Unlike big.Int.SetInt64(0) which only changes the logical value, this zeros the actual backing array to prevent key material from lingering in memory.
func ZeroPrivateKey ¶ added in v0.26.0
func ZeroPrivateKey(key *btcec.PrivateKey)
ZeroPrivateKey overwrites the private key bytes with zeros.