public class PrivateKeyStorage extends Object
| Constructor and Description |
|---|
PrivateKeyStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAccount(AccountName accountName)
Add a new account to the key storage without providing private keys.
|
void |
addAccount(AccountName accountName,
List<org.apache.commons.lang3.tuple.ImmutablePair<PrivateKeyType,String>> privateKeys)
Add a new account and a list of its private keys to the key storage.
|
void |
addPrivateKeyToAccount(AccountName accountName,
org.apache.commons.lang3.tuple.ImmutablePair<PrivateKeyType,String> privateKey)
Add a private key to an already existing account.
|
List<AccountName> |
getAccounts()
Get a list of account names for which private keys have been stored.
|
eu.bittrade.crypto.core.ECKey |
getKeyForAccount(PrivateKeyType privateKeyType,
AccountName accountName)
Get a private key of the given private key type for the given account
name.
|
Map<AccountName,List<org.apache.commons.lang3.tuple.ImmutablePair<PrivateKeyType,eu.bittrade.crypto.core.ECKey>>> |
getPrivateKeysPerAccounts()
Get the private key store.
|
List<org.apache.commons.lang3.tuple.ImmutablePair<PrivateKeyType,eu.bittrade.crypto.core.ECKey>> |
removeAccount(AccountName accountName)
Removes the given Account and all its stored private keys from the key
storage.
|
public eu.bittrade.crypto.core.ECKey getKeyForAccount(PrivateKeyType privateKeyType, AccountName accountName)
privateKeyType - The type of the key to request.accountName - The account to request the key for.InvalidParameterException - If no key could be find for the given account name.public void addAccount(AccountName accountName)
accountName - The account to be added to the key storage.public void addAccount(AccountName accountName, List<org.apache.commons.lang3.tuple.ImmutablePair<PrivateKeyType,String>> privateKeys)
accountName - The account to be added to the key storage.privateKeys - The private keys to be added to the key storage.public void addPrivateKeyToAccount(AccountName accountName, org.apache.commons.lang3.tuple.ImmutablePair<PrivateKeyType,String> privateKey)
Example:
addPrivateKeyToAccount(new AccountName("dez1337"), new ImmutablePair<PrivateKeyType, String>(PrivateKeyType.OWNER, "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3");
accountName - The account to add the keys for.privateKey - The private key in its WIF representation and its type.public List<org.apache.commons.lang3.tuple.ImmutablePair<PrivateKeyType,eu.bittrade.crypto.core.ECKey>> removeAccount(AccountName accountName)
accountName - The account name to remove from the key store.public Map<AccountName,List<org.apache.commons.lang3.tuple.ImmutablePair<PrivateKeyType,eu.bittrade.crypto.core.ECKey>>> getPrivateKeysPerAccounts()
public List<AccountName> getAccounts()
Copyright © 2019. All rights reserved.