public class Wallet extends Object
Ethereum wallet file management. For reference, refer to Web3 Secret Storage Definition or the Go Ethereum client implementation.
Note: the Bouncy Castle Scrypt implementation SCrypt
, fails to comply
with the following Ethereum reference
Scrypt test vector:
// Only value of r that cost (as an int) could be exceeded for is 1
if (r == 1 && N_STANDARD > 65536)
{
throw new IllegalArgumentException("Cost parameter N_STANDARD must be > 1 and < 65536.");
}
Constructor and Description |
---|
Wallet() |
Modifier and Type | Method and Description |
---|---|
static WalletFile |
create(byte[] password,
ECKey ecKeyPair,
int n,
int p) |
static WalletFile |
createLight(byte[] password,
ECKey ecKeyPair) |
static WalletFile |
createStandard(byte[] password,
ECKey ecKeyPair) |
static ECKey |
decrypt(byte[] password,
WalletFile walletFile) |
static byte[] |
decrypt2PrivateBytes(byte[] password,
WalletFile walletFile) |
static String |
encode58Check(byte[] input) |
static boolean |
validPassword(byte[] password,
WalletFile walletFile) |
public static WalletFile create(byte[] password, ECKey ecKeyPair, int n, int p) throws CipherException
CipherException
public static WalletFile createStandard(byte[] password, ECKey ecKeyPair) throws CipherException
CipherException
public static WalletFile createLight(byte[] password, ECKey ecKeyPair) throws CipherException
CipherException
public static String encode58Check(byte[] input)
public static byte[] decrypt2PrivateBytes(byte[] password, WalletFile walletFile) throws CipherException
CipherException
public static boolean validPassword(byte[] password, WalletFile walletFile) throws CipherException
CipherException
public static ECKey decrypt(byte[] password, WalletFile walletFile) throws CipherException
CipherException
Copyright © 2020. All rights reserved.