/** Returns the deterministic key for the given absolute path in the hierarchy. */ protected DeterministicKey getKeyByPath(List<ChildNumber> path) { return getKeyByPath(path, false); }
/** Returns the deterministic key for the given absolute path in the hierarchy. */ protected DeterministicKey getKeyByPath(List<ChildNumber> path) { return getKeyByPath(path, false); }
/** Returns the deterministic key for the given absolute path in the hierarchy. */ protected DeterministicKey getKeyByPath(List<ChildNumber> path) { return getKeyByPath(path, false); }
/** Returns the deterministic key for the given absolute path in the hierarchy. */ protected DeterministicKey getKeyByPath(List<ChildNumber> path) { return getKeyByPath(path, false); }
/** Returns the deterministic key for the given absolute path in the hierarchy. */ protected DeterministicKey getKeyByPath(ChildNumber... path) { return getKeyByPath(ImmutableList.copyOf(path)); }
/** Returns the deterministic key for the given absolute path in the hierarchy. */ protected DeterministicKey getKeyByPath(ChildNumber... path) { return getKeyByPath(ImmutableList.copyOf(path)); }
/** Returns the deterministic key for the given absolute path in the hierarchy. */ protected DeterministicKey getKeyByPath(ChildNumber... path) { return getKeyByPath(ImmutableList.copyOf(path)); }
/** * <p>An alias for <code>getKeyByPath(getAccountPath())</code>.</p> * * <p>Use this when you would like to create a watching key chain that follows this one, but can't spend money from it. * The returned key can be serialized and then passed into {@link #watch(org.bitcoinj.crypto.DeterministicKey)} * on another system to watch the hierarchy.</p> * * <p>Note that the returned key is not pubkey only unless this key chain already is: the returned key can still * be used for signing etc if the private key bytes are available.</p> */ public DeterministicKey getWatchingKey() { return getKeyByPath(getAccountPath()); }
/** * <p>An alias for <code>getKeyByPath(getAccountPath())</code>.</p> * * <p>Use this when you would like to create a watching key chain that follows this one, but can't spend money from it. * The returned key can be serialized and then passed into {@link #watch(org.bitcoinj.crypto.DeterministicKey)} * on another system to watch the hierarchy.</p> * * <p>Note that the returned key is not pubkey only unless this key chain already is: the returned key can still * be used for signing etc if the private key bytes are available.</p> */ public DeterministicKey getWatchingKey() { return getKeyByPath(getAccountPath()); }
/** * <p>An alias for <code>getKeyByPath(getAccountPath())</code>.</p> * * <p>Use this when you would like to create a watching key chain that follows this one, but can't spend money from it. * The returned key can be serialized and then passed into {@link #watch(org.bitcoinj.crypto.DeterministicKey)} * on another system to watch the hierarchy.</p> * * <p>Note that the returned key is not pubkey only unless this key chain already is: the returned key can still * be used for signing etc if the private key bytes are available.</p> */ public DeterministicKey getWatchingKey() { return getKeyByPath(getAccountPath()); }
private List<ECKey> getMarriedKeysWithFollowed(DeterministicKey followedKey) { ImmutableList.Builder<ECKey> keys = ImmutableList.builder(); for (DeterministicKeyChain keyChain : followingKeyChains) { keyChain.maybeLookAhead(); keys.add(keyChain.getKeyByPath(followedKey.getPath())); } keys.add(followedKey); return keys.build(); }
private List<ECKey> getMarriedKeysWithFollowed(DeterministicKey followedKey) { ImmutableList.Builder<ECKey> keys = ImmutableList.builder(); for (DeterministicKeyChain keyChain : followingKeyChains) { keyChain.maybeLookAhead(); keys.add(keyChain.getKeyByPath(followedKey.getPath())); } keys.add(followedKey); return keys.build(); }
private List<ECKey> getMarriedKeysWithFollowed(DeterministicKey followedKey) { ImmutableList.Builder<ECKey> keys = ImmutableList.builder(); for (DeterministicKeyChain keyChain : followingKeyChains) { keyChain.maybeLookAhead(); keys.add(keyChain.getKeyByPath(followedKey.getPath())); } keys.add(followedKey); return keys.build(); }
private List<ECKey> getMarriedKeysWithFollowed(DeterministicKey followedKey) { ImmutableList.Builder<ECKey> keys = ImmutableList.builder(); for (DeterministicKeyChain keyChain : followingKeyChains) { keyChain.maybeLookAhead(); keys.add(keyChain.getKeyByPath(followedKey.getPath())); } keys.add(followedKey); return keys.build(); }
/** * Returns a key for the given HD path, assuming it's already been derived. You normally shouldn't use this: * use currentReceiveKey/freshReceiveKey instead. */ public DeterministicKey getKeyByPath(List<ChildNumber> path) { keyChainGroupLock.lock(); try { maybeUpgradeToHD(); return keyChainGroup.getActiveKeyChain().getKeyByPath(path, false); } finally { keyChainGroupLock.unlock(); } }
/** * Returns a key for the given HD path, assuming it's already been derived. You normally shouldn't use this: * use currentReceiveKey/freshReceiveKey instead. */ public DeterministicKey getKeyByPath(List<ChildNumber> path) { keyChainGroupLock.lock(); try { maybeUpgradeToHD(); return keyChainGroup.getActiveKeyChain().getKeyByPath(path, false); } finally { keyChainGroupLock.unlock(); } }
/** * Returns a key for the given HD path, assuming it's already been derived. You normally shouldn't use this: * use currentReceiveKey/freshReceiveKey instead. */ public DeterministicKey getKeyByPath(List<ChildNumber> path) { keyChainGroupLock.lock(); try { maybeUpgradeToHD(); return keyChainGroup.getActiveKeyChain().getKeyByPath(path, false); } finally { keyChainGroupLock.unlock(); } }
/** * Returns a key for the given HD path, assuming it's already been derived. You normally shouldn't use this: * use currentReceiveKey/freshReceiveKey instead. */ public DeterministicKey getKeyByPath(List<ChildNumber> path) { keyChainGroupLock.lock(); try { maybeUpgradeToHD(); return keyChainGroup.getActiveKeyChain().getKeyByPath(path, false); } finally { keyChainGroupLock.unlock(); } }
@Override protected SignatureAndKey getSignature(Sha256Hash sighash, List<ChildNumber> derivationPath) { ImmutableList<ChildNumber> keyPath = ImmutableList.copyOf(derivationPath); DeterministicKey key = keyChain.getKeyByPath(keyPath, true); return new SignatureAndKey(key.sign(sighash), key.dropPrivateBytes().dropParent()); } }
@Test(expected = IllegalStateException.class) public void watchingCannotEncrypt() throws Exception { final DeterministicKey accountKey = chain.getKeyByPath(DeterministicKeyChain.ACCOUNT_ZERO_PATH); chain = DeterministicKeyChain.watch(accountKey.dropPrivateBytes().dropParent()); chain = chain.toEncrypted("this doesn't make any sense"); }