public final class HDKeyDerivation extends Object
Modifier and Type | Method and Description |
---|---|
static DeterministicKey |
createMasterPrivateKey(byte[] seed)
Generates a new deterministic key from the given seed, which can be any arbitrary byte array.
|
static DeterministicKey |
createMasterPrivKeyFromBytes(byte[] privKeyBytes,
byte[] chainCode) |
static DeterministicKey |
createMasterPubKeyFromBytes(byte[] pubKeyBytes,
byte[] chainCode) |
static DeterministicKey |
deriveChildKey(DeterministicKey parent,
ChildNumber childNumber) |
static DeterministicKey |
deriveChildKey(DeterministicKey parent,
int childNumber) |
public static DeterministicKey createMasterPrivateKey(byte[] seed) throws HDDerivationException
HDDerivationException
- if generated master key is invalid (private key 0 or >= n).IllegalArgumentException
- if the seed is less than 8 bytes and could be brute forced.public static DeterministicKey createMasterPrivKeyFromBytes(byte[] privKeyBytes, byte[] chainCode) throws HDDerivationException
HDDerivationException
- if privKeyBytes is invalid (0 or >= n).public static DeterministicKey createMasterPubKeyFromBytes(byte[] pubKeyBytes, byte[] chainCode)
public static DeterministicKey deriveChildKey(DeterministicKey parent, int childNumber)
childNumber
- the "extended" child number, ie. with the 0x80000000 bit specifying private/public derivation.public static DeterministicKey deriveChildKey(DeterministicKey parent, ChildNumber childNumber) throws HDDerivationException
HDDerivationException
- if private derivation is attempted for a public-only parent key, or
if the resulting derived key is invalid (eg. private key == 0).Copyright © 2014. All rights reserved.