public static class DeterministicKeyChain.Builder<T extends DeterministicKeyChain.Builder<T>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected HDPath |
accountPath |
protected int |
bits |
protected long |
creationTimeSecs |
protected byte[] |
entropy |
protected boolean |
isFollowing |
protected Script.ScriptType |
outputScriptType |
protected java.lang.String |
passphrase |
protected java.security.SecureRandom |
random |
protected DeterministicSeed |
seed |
protected DeterministicKey |
spendingKey |
protected DeterministicKey |
watchingKey |
Modifier | Constructor and Description |
---|---|
protected |
Builder() |
Modifier and Type | Method and Description |
---|---|
T |
accountPath(java.util.List<ChildNumber> accountPath)
Use an account path other than the default
DeterministicKeyChain.ACCOUNT_ZERO_PATH . |
DeterministicKeyChain |
build() |
T |
entropy(byte[] entropy,
long creationTimeSecs)
Creates a deterministic key chain starting from the given entropy.
|
protected java.lang.String |
getPassphrase() |
T |
outputScriptType(Script.ScriptType outputScriptType) |
T |
passphrase(java.lang.String passphrase)
The passphrase to use with the generated mnemonic, or null if you would like to use the default empty string.
|
T |
random(java.security.SecureRandom random)
Generates a new key chain with 128 bits of entropy selected randomly from the given
SecureRandom
object. |
T |
random(java.security.SecureRandom random,
int bits)
Generates a new key chain with entropy selected randomly from the given
SecureRandom
object and of the requested size in bits. |
T |
seed(DeterministicSeed seed)
Creates a deterministic key chain starting from the given seed.
|
protected T |
self() |
T |
spend(DeterministicKey accountKey)
Creates a key chain that can spend from the given account key.
|
T |
watch(DeterministicKey accountKey)
Creates a key chain that watches the given account key.
|
T |
watchAndFollow(DeterministicKey accountKey)
Creates a deterministic key chain with the given watch key and that follows some other keychain.
|
protected java.security.SecureRandom random
protected int bits
protected java.lang.String passphrase
protected long creationTimeSecs
protected byte[] entropy
protected DeterministicSeed seed
protected Script.ScriptType outputScriptType
protected DeterministicKey watchingKey
protected boolean isFollowing
protected DeterministicKey spendingKey
protected HDPath accountPath
protected T self()
public T entropy(byte[] entropy, long creationTimeSecs)
public T seed(DeterministicSeed seed)
public T random(java.security.SecureRandom random, int bits)
SecureRandom
object and of the requested size in bits. The derived seed is further protected with a user selected passphrase
(see BIP 39).random
- the random number generator - use new SecureRandom().bits
- The number of bits of entropy to use when generating entropy. Either 128 (default), 192 or 256.public T random(java.security.SecureRandom random)
SecureRandom
object. The derived seed is further protected with a user selected passphrase
(see BIP 39).random
- the random number generator - use new SecureRandom().public T watch(DeterministicKey accountKey)
public T watchAndFollow(DeterministicKey accountKey)
public T spend(DeterministicKey accountKey)
public T outputScriptType(Script.ScriptType outputScriptType)
public T passphrase(java.lang.String passphrase)
public T accountPath(java.util.List<ChildNumber> accountPath)
DeterministicKeyChain.ACCOUNT_ZERO_PATH
.public DeterministicKeyChain build()
protected java.lang.String getPassphrase()