keystore

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Overview

Package keystore provides functions to store and load private keys to/from EIP 2335 (https://eips.ethereum.org/EIPS/eip-2335) compatible keystore files. Passwords are expected/created in files with same identical names as the keystores, except with txt extension.

Index

Constants

This section is empty.

Variables

View Source
var ConfirmInsecureKeys confirmInsecure

ConfirmInsecureKeys is syntactic sugar to highlight the security implications of insecure keys.

Functions

func LoadKeys

func LoadKeys(dir string) ([]*bls_sig.SecretKey, error)

LoadKeys returns all secrets stored in dir/keystore-*.json 2335 keystore files using password stored in dir/keystore-*.txt.

func StoreKeys

func StoreKeys(secrets []*bls_sig.SecretKey, dir string) error

StoreKeys stores the secrets in dir/keystore-%d.json EIP 2335 keystore files with new random passwords stored in dir/keystore-%d.txt.

func StoreKeysInsecure added in v0.11.0

func StoreKeysInsecure(secrets []*bls_sig.SecretKey, dir string, _ confirmInsecure) error

StoreKeysInsecure stores the secrets in dir/keystore-insecure-%d.json EIP 2335 keystore files with new random passwords stored in dir/keystore-insecure-%d.txt.

🚨 The keystores are insecure and should only be used for testing large validator sets as it speeds up encryption and decryption at the cost of security.

Types

type KeymanagerReq added in v0.13.0

type KeymanagerReq struct {
	Keystores []keystore `json:"keystores"`
	Passwords []string   `json:"passwords"`
}

KeymanagerReq represents the keymanager API request body for POST request. Refer: https://ethereum.github.io/keymanager-APIs/#/Local%20Key%20Manager/importKeystores

func KeymanagerReqBody added in v0.13.0

func KeymanagerReqBody(secrets []*bls_sig.SecretKey) (KeymanagerReq, error)

KeymanagerReqBody constructs a KeymanagerReq using the provided secrets and returns it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳