Documentation ¶
Index ¶
Constants ¶
const ( FastN = 2 FastP = 1 )
const EthereumMessageHashPrefix = "\x19Ethereum Signed Message:\n32"
EthereumMessageHashPrefix is a Geth-originating message prefix that seeks to prevent arbitrary message data to be representable as a valid Ethereum transaction For more information, see: https://github.com/ethereum/go-ethereum/issues/3731
Variables ¶
var DefaultScryptParams = ScryptParams{N: keystore.StandardScryptN, P: keystore.StandardScryptP}
DefaultScryptParams is for use in production. It used geth's standard level of encryption and is relatively expensive to decode. Avoid using this in tests.
var ErrKeyStoreLocked = errors.New("keystore is locked (HINT: did you forget to call keystore.Unlock?)")
var FastScryptParams = ScryptParams{N: FastN, P: FastP}
FastScryptParams is for use in tests, where you don't want to wear out your CPU with expensive key derivations, do not use it in production, or your encrypted keys will be easy to brute-force!
Functions ¶
This section is empty.
Types ¶
type KeyStore ¶
type KeyStore interface { Unlock(password string) error Accounts() []accounts.Account Wallets() []accounts.Wallet HasAccounts() bool HasAccountWithAddress(common.Address) bool NewAccount() (accounts.Account, error) Import(keyJSON []byte, oldPassword string) (accounts.Account, error) Export(address common.Address, newPassword string) ([]byte, error) Delete(address common.Address) error GetAccounts() []accounts.Account GetAccountByAddress(common.Address) (accounts.Account, error) SignTx(account accounts.Account, tx *ethTypes.Transaction, chainID *big.Int) (*ethTypes.Transaction, error) }
func NewInsecureKeyStore ¶
NewInsecureKeyStore creates an *INSECURE* keystore for the given directory. NOTE: Should only be used for testing!
func NewKeyStore ¶
func NewKeyStore(keyDir string, scryptParams ScryptParams) KeyStore
NewKeyStore creates a keystore for the given directory.
type ScryptConfigReader ¶
type ScryptConfigReader interface {
InsecureFastScrypt() bool
}
type ScryptParams ¶
type ScryptParams struct{ N, P int }
func GetScryptParams ¶
func GetScryptParams(config ScryptConfigReader) ScryptParams