/** Returns a freshly derived key that has not been returned by this method before. */ @Override public DeterministicKey getKey(KeyPurpose purpose) { return getKeys(purpose, 1).get(0); }
/** * Returns leaf keys issued by this chain (including lookahead zone but no lookahead threshold) */ public List<DeterministicKey> getActiveKeys() { ImmutableList.Builder<DeterministicKey> keys = ImmutableList.builder(); for (ECKey key : getKeys(true)) { DeterministicKey dKey = (DeterministicKey) key; if (isLeaf(dKey)) { if (dKey.getParent().equals(internalKey) && dKey.getChildNumber().num() >= issuedInternalKeys + lookaheadSize) continue; if (dKey.getParent().equals(externalKey) && dKey.getChildNumber().num() >= issuedExternalKeys + lookaheadSize) continue; keys.add(dKey); } } return keys.build(); }
private void assertAllKeysEncrypted(WalletPocketHD pocket) { List<ECKey> keys = pocket.keys.getKeys(false); for (ECKey k : keys) { DeterministicKey key = (DeterministicKey) k; assertTrue(key.isEncrypted()); } }
private void assertAllKeysDecrypted(WalletPocketHD pocket) { List<ECKey> keys = pocket.keys.getKeys(false); for (ECKey k : keys) { DeterministicKey key = (DeterministicKey) k; assertFalse(key.isEncrypted()); } }