Class KeystoreServiceImpl
java.lang.Object
com.kryptokrauts.aeternity.sdk.service.keystore.impl.KeystoreServiceImpl
- All Implemented Interfaces:
KeystoreService
public class KeystoreServiceImpl extends java.lang.Object implements KeystoreService
-
Constructor Summary
Constructors Constructor Description KeystoreServiceImpl()
-
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 jsonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
KeystoreServiceImpl
public KeystoreServiceImpl()
-
-
Method Details
-
createKeystore
public java.lang.String createKeystore(HdWallet hdWallet, java.lang.String keystorePassword) throws AExceptionDescription copied from interface:KeystoreService
stores public key and mnemonic seed words (but not the password!) as JSON- Specified by:
createKeystore
in interfaceKeystoreService
- 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
public java.util.List<java.lang.String> recoverMnemonicSeedWords(java.lang.String keystoreJSON, java.lang.String keystorePassword) throws AExceptionDescription copied from interface:KeystoreService
allows to recover the mnemnonic seed words from a given keystore json- Specified by:
recoverMnemonicSeedWords
in interfaceKeystoreService
- 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
-
createKeystore
public java.lang.String createKeystore(KeyPair keyPair, java.lang.String keystorePassword, java.lang.String keystoreName) throws AExceptionDescription copied from interface:KeystoreService
create a JSON keystore which can be stored in a file for later recovery of the private key- Specified by:
createKeystore
in interfaceKeystoreService
- 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
public java.lang.String recoverEncodedPrivateKey(java.lang.String keystoreJSON, java.lang.String keystorePassword) throws AExceptionDescription copied from interface:KeystoreService
allows to recover a private key from a given keystore json- Specified by:
recoverEncodedPrivateKey
in interfaceKeystoreService
- 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
-