Class KeyPairServiceImpl
java.lang.Object
com.kryptokrauts.aeternity.sdk.service.keypair.impl.KeyPairServiceImpl
- All Implemented Interfaces:
KeyPairService
public final class KeyPairServiceImpl extends java.lang.Object implements KeyPairService
-
Constructor Summary
Constructors Constructor Description KeyPairServiceImpl()
-
Method Summary
Modifier and Type Method Description java.lang.String
byteToHex(byte[] key)
HdWallet
generateHdWallet(java.lang.String mnemonicSeedPassword)
creates a keyPair as well as a list of mnemonic seed words wrapped into HdWallet object, which can be used to restore the key (derived from BIP32/39 HD-Wallet generation) the number of seed words depends on the parameter defined inKeyPairServiceConfiguration
KeyPair
generateKeyPair()
HdKeyPair
getNextKeyPair(HdWallet mnemonicKeyPair)
derives the next hardened key.void
printChildKeyPair(byte[] il, byte[] ir)
HdWallet
recoverHdWallet(java.util.List<java.lang.String> mnemonicSeedWords, java.lang.String mnemonicSeedPassword)
recover keypair from given mnemonic seed word list with given seed passwordKeyPair
recoverKeyPair(java.lang.String privateKey)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
KeyPairServiceImpl
public KeyPairServiceImpl()
-
-
Method Details
-
generateHdWallet
Description copied from interface:KeyPairService
creates a keyPair as well as a list of mnemonic seed words wrapped into HdWallet object, which can be used to restore the key (derived from BIP32/39 HD-Wallet generation) the number of seed words depends on the parameter defined inKeyPairServiceConfiguration
- Specified by:
generateHdWallet
in interfaceKeyPairService
- Parameters:
mnemonicSeedPassword
- password or null which is used to seed the list of mnemonics- Returns:
- keypair with private and public key as well as the generated list of mnemonic seed
words wrapped into
HdWallet
- Throws:
AException
- in case of an error
-
recoverHdWallet
public HdWallet recoverHdWallet(java.util.List<java.lang.String> mnemonicSeedWords, java.lang.String mnemonicSeedPassword) throws AExceptionDescription copied from interface:KeyPairService
recover keypair from given mnemonic seed word list with given seed password- Specified by:
recoverHdWallet
in interfaceKeyPairService
- Parameters:
mnemonicSeedWords
- the words to recover the HdwalletmnemonicSeedPassword
- the password that protects the keypair(s) generated with the seed phrase (can be null)- Returns:
- instance of
HdWallet
- Throws:
AException
- in case of an error
-
byteToHex
public java.lang.String byteToHex(byte[] key) -
printChildKeyPair
public void printChildKeyPair(byte[] il, byte[] ir) -
getNextKeyPair
Description copied from interface:KeyPairService
derives the next hardened key. The derived keys are generated according to the deterministic tree saved within the given menomincKeyPair stated in BIP32- Specified by:
getNextKeyPair
in interfaceKeyPairService
- Parameters:
mnemonicKeyPair
- mnemonicKeyPair containing the deterministic tree of keys necessary for derivation- Returns:
- a new derived child raw keypair
- Throws:
AException
- in case of an error
-
generateKeyPair
- Specified by:
generateKeyPair
in interfaceKeyPairService
- Returns:
- a byte arrayed keypair
-
recoverKeyPair
- Specified by:
recoverKeyPair
in interfaceKeyPairService
- Parameters:
privateKey
- private key (hex)- Returns:
- the recovered keypair
-