Class HierarchicalDeterministicKey
- java.lang.Object
-
- com.syntifi.crypto.key.deterministic.HierarchicalDeterministicKey
-
public class HierarchicalDeterministicKey extends java.lang.ObjectThe procedure to implement BIP32 or SLIP 10 to generate deterministic keys hierarchically https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki https://github.com/satoshilabs/slips/blob/master/slip-0010.md- Since:
- 0.3.0
-
-
Constructor Summary
Constructors Constructor Description HierarchicalDeterministicKey()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]childKeyDerivation(byte[] key, byte[] chainCode, byte[] init)CKD function in Bipt32 and Slip10static byte[]getFromSeed(byte[] seed, byte[] init, int[] derivationPath)static byte[]getMasterKeyFromSeed(byte[] seed, byte[] key)Derives the masterkey given a seed byte array
-
-
-
Method Detail
-
getFromSeed
public static byte[] getFromSeed(byte[] seed, byte[] init, int[] derivationPath) throws java.io.IOException- Parameters:
seed- byte array containing the seedinit- chaincode, that is the rightmost 32 bytes of the keyderivationPath- path to follow when deriving the key- Returns:
- derived key in byte array
- Throws:
java.io.IOException- if an error occurs when processing the bytestream
-
getMasterKeyFromSeed
public static byte[] getMasterKeyFromSeed(byte[] seed, byte[] key)Derives the masterkey given a seed byte array- Parameters:
seed- byte array containing the seedkey- initial Hmac value- Returns:
- master key as a byte array
-
childKeyDerivation
public static byte[] childKeyDerivation(byte[] key, byte[] chainCode, byte[] init) throws java.io.IOExceptionCKD function in Bipt32 and Slip10- Parameters:
key- master key, that is the leftmost 32 bytes of the keychainCode- hierarchical chain code 'a/b/c' but in array format: { a, b, c}init- chaincode, that is the rightmost 32 bytes of the key- Returns:
- master key as a byte array
- Throws:
java.io.IOException- if an error occurs when processing the bytestream
-
-