Modifier and Type | Class and Description |
---|---|
static class |
HDKeyDerivation.PublicDeriveMode |
static class |
HDKeyDerivation.RawKeyBytes |
Modifier and Type | Field and Description |
---|---|
static org.spongycastle.crypto.macs.HMac |
MASTER_HMAC_SHA512 |
static int |
MAX_CHILD_DERIVATION_ATTEMPTS
Child derivation may fail (although with extremely low probability); in such case it is re-attempted.
|
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)
Derives a key given the "extended" child number, ie.
|
static HDKeyDerivation.RawKeyBytes |
deriveChildKeyBytesFromPrivate(DeterministicKey parent,
ChildNumber childNumber) |
static HDKeyDerivation.RawKeyBytes |
deriveChildKeyBytesFromPublic(DeterministicKey parent,
ChildNumber childNumber,
HDKeyDerivation.PublicDeriveMode mode) |
static DeterministicKey |
deriveThisOrNextChildKey(DeterministicKey parent,
int childNumber)
Derives a key of the "extended" child number, ie.
|
public static final int MAX_CHILD_DERIVATION_ATTEMPTS
public static final org.spongycastle.crypto.macs.HMac MASTER_HMAC_SHA512
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)
public static DeterministicKey deriveThisOrNextChildKey(DeterministicKey parent, int childNumber)
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).public static HDKeyDerivation.RawKeyBytes deriveChildKeyBytesFromPrivate(DeterministicKey parent, ChildNumber childNumber) throws HDDerivationException
HDDerivationException
public static HDKeyDerivation.RawKeyBytes deriveChildKeyBytesFromPublic(DeterministicKey parent, ChildNumber childNumber, HDKeyDerivation.PublicDeriveMode mode) throws HDDerivationException
HDDerivationException
Copyright © 2014. All rights reserved.