Interface KeystoreService
- All Known Implementing Classes:
KeystoreServiceImpl
public interface KeystoreService
-
Method Summary
Modifier and Type Method Description java.lang.String
createKeystore(HdWallet hdWallet, java.lang.String keystorePassword)
stores public key and mnemonic seed words (but not the password!) as JSONjava.lang.String
createKeystore(KeyPair keyPair, java.lang.String keystorePassword, java.lang.String keystoreName)
create a JSON keystore which can be stored in a file for later recovery of the private keyjava.lang.String
recoverEncodedPrivateKey(java.lang.String keystoreJSON, java.lang.String keystorePassword)
allows to recover a private key from a given keystore jsonjava.util.List<java.lang.String>
recoverMnemonicSeedWords(java.lang.String keystoreJSON, java.lang.String keystorePassword)
allows to recover the mnemnonic seed words from a given keystore json
-
Method Details
-
createKeystore
java.lang.String createKeystore(KeyPair keyPair, java.lang.String keystorePassword, java.lang.String keystoreName) throws AExceptioncreate a JSON keystore which can be stored in a file for later recovery of the private key- Parameters:
keyPair
- the public / private keypairkeystorePassword
- the password for symmetric encryptionkeystoreName
- the name of the keystore wallet- Returns:
- encrypts the keypair using the given walletPassword and returns a JSON derived from
Keystore
- Throws:
AException
- if an error occurs
-
recoverEncodedPrivateKey
java.lang.String recoverEncodedPrivateKey(java.lang.String keystoreJSON, java.lang.String keystorePassword) throws AExceptionallows to recover a private key from a given keystore json- Parameters:
keystoreJSON
- the keystore JSON derived fromKeystore
keystorePassword
- the symmetric password used to create the keystore- Returns:
- encoded private key
- Throws:
AException
- if an error occurs
-
createKeystore
java.lang.String createKeystore(HdWallet hdWallet, java.lang.String keystorePassword) throws AExceptionstores public key and mnemonic seed words (but not the password!) as JSON- Parameters:
hdWallet
- instance ofHdWallet
keystorePassword
- keystorePassword the symmetric password used to create the keystore- Returns:
- encrypts the HDWallets seed word list using the given walletPassword and returns a JSON
derived from
Keystore
- Throws:
AException
- if an error occurs
-
recoverMnemonicSeedWords
java.util.List<java.lang.String> recoverMnemonicSeedWords(java.lang.String keystoreJSON, java.lang.String keystorePassword) throws AExceptionallows to recover the mnemnonic seed words from a given keystore json- Parameters:
keystoreJSON
- the keystore JSON derived fromKeystore
keystorePassword
- the symmetric password used to create the keystore- Returns:
- list of mnemonic seed words
- Throws:
AException
- if an error occurs
-