use of org.ethereum.core.Account in project rskj by rsksmart.
the class Wallet method addAccount.
public RskAddress addAccount(String passphrase) {
Account account = new Account(new ECKey());
saveAccount(account, passphrase);
return account.getAddress();
}
use of org.ethereum.core.Account in project rskj by rsksmart.
the class Wallet method addAccountWithPrivateKey.
public byte[] addAccountWithPrivateKey(byte[] privateKeyBytes, String passphrase) {
Account account = new Account(ECKey.fromPrivate(privateKeyBytes));
saveAccount(account, passphrase);
return account.getAddress().getBytes();
}
use of org.ethereum.core.Account in project rskj by rsksmart.
the class Wallet method unlockAccount.
public boolean unlockAccount(RskAddress addr, String passphrase) {
Account account;
synchronized (accessLock) {
byte[] encrypted = keyDS.get(addr.getBytes());
if (encrypted == null) {
return false;
}
account = new Account(ECKey.fromPrivate(decryptAES(encrypted, passphrase.getBytes(StandardCharsets.UTF_8))));
}
saveAccount(account);
return true;
}
use of org.ethereum.core.Account in project rskj by rsksmart.
the class Wallet method addAccountWithPrivateKey.
public byte[] addAccountWithPrivateKey(byte[] privateKeyBytes) {
Account account = new Account(ECKey.fromPrivate(privateKeyBytes));
synchronized (accessLock) {
RskAddress addr = addAccount(account);
this.initialAccounts.add(addr);
return addr.getBytes();
}
}
Aggregations