Documentation ¶
Overview ¶
Package keytools is the module to reuse the key pair
Index ¶
- func CreateLocalKey(filename, password string) *secp256k1.PrivateKey
- func GetDefaultFile() string
- func GetDefaultFolder() string
- func GetP2PKey(path string) crypto.PrivKey
- func NewLocalKey() *secp256k1.PrivateKey
- func PrintKeysAndAddress(privateKey *secp256k1.PrivateKey)
- func ReadLocalKey(filename string, password string) *secp256k1.PrivateKey
- func RecoverLocalKey(filename, password, privateKey string) *secp256k1.PrivateKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateLocalKey ¶
func CreateLocalKey(filename, password string) *secp256k1.PrivateKey
CreateLocalKey will create a keyfile named *filename* and encrypted with *password* in aes-256-gcm.
func GetDefaultFile ¶
func GetDefaultFile() string
GetDefaultFile returns the default location storing keyfile.
func GetDefaultFolder ¶
func GetDefaultFolder() string
GetDefaultFolder returns the default folder storing keyfile.
func NewLocalKey ¶
func NewLocalKey() *secp256k1.PrivateKey
NewLocalKey will create a privateKey only.
func PrintKeysAndAddress ¶
func PrintKeysAndAddress(privateKey *secp256k1.PrivateKey)
PrintKeysAndAddress will print the **privateKey and its publicKey** to the console.
func ReadLocalKey ¶
func ReadLocalKey(filename string, password string) *secp256k1.PrivateKey
ReadLocalKey will read the local AES-256-GCM encrypted secp256k1 key file to load an ecdsa private key.
func RecoverLocalKey ¶
func RecoverLocalKey(filename, password, privateKey string) *secp256k1.PrivateKey
RecoverLocalKey will recover a keyfile named *filename* with the password from the privateKey string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.