@Override public BasicKeyChain toDecrypted(CharSequence password) { checkNotNull(keyCrypter, "Wallet is already decrypted"); KeyParameter aesKey = keyCrypter.deriveKey(password); return toDecrypted(aesKey); }
@Override public BasicKeyChain toDecrypted(CharSequence password) { checkNotNull(keyCrypter, "Wallet is already decrypted"); KeyParameter aesKey = keyCrypter.deriveKey(password); return toDecrypted(aesKey); }
@Override public BasicKeyChain toDecrypted(CharSequence password) { checkNotNull(keyCrypter, "Wallet is already decrypted"); KeyParameter aesKey = keyCrypter.deriveKey(password); return toDecrypted(aesKey); }
@Override public BasicKeyChain toDecrypted(CharSequence password) { checkNotNull(keyCrypter, "Wallet is already decrypted"); KeyParameter aesKey = keyCrypter.deriveKey(password); return toDecrypted(aesKey); }
/** * Decrypt the keys in the group using the previously given key crypter and the AES key. A good default * KeyCrypter to use is {@link org.bitcoinj.crypto.KeyCrypterScrypt}. * * @throws org.bitcoinj.crypto.KeyCrypterException Thrown if the wallet decryption fails for some reason, leaving the group unchanged. */ public void decrypt(KeyParameter aesKey) { // This code must be exception safe. checkNotNull(aesKey); BasicKeyChain newBasic = basic.toDecrypted(aesKey); List<DeterministicKeyChain> newChains = new ArrayList<DeterministicKeyChain>(chains.size()); for (DeterministicKeyChain chain : chains) newChains.add(chain.toDecrypted(aesKey)); this.keyCrypter = null; basic = newBasic; chains.clear(); chains.addAll(newChains); }
/** * Decrypt the keys in the group using the previously given key crypter and the AES key. A good default * KeyCrypter to use is {@link org.bitcoinj.crypto.KeyCrypterScrypt}. * * @throws org.bitcoinj.crypto.KeyCrypterException Thrown if the wallet decryption fails for some reason, leaving the group unchanged. */ public void decrypt(KeyParameter aesKey) { // This code must be exception safe. checkNotNull(aesKey); BasicKeyChain newBasic = basic.toDecrypted(aesKey); List<DeterministicKeyChain> newChains = new ArrayList<>(chains.size()); for (DeterministicKeyChain chain : chains) newChains.add(chain.toDecrypted(aesKey)); this.keyCrypter = null; basic = newBasic; chains.clear(); chains.addAll(newChains); }
/** * Decrypt the keys in the group using the previously given key crypter and the AES key. A good default * KeyCrypter to use is {@link org.bitcoinj.crypto.KeyCrypterScrypt}. * * @throws org.bitcoinj.crypto.KeyCrypterException Thrown if the wallet decryption fails for some reason, leaving the group unchanged. */ public void decrypt(KeyParameter aesKey) { // This code must be exception safe. checkNotNull(aesKey); BasicKeyChain newBasic = basic.toDecrypted(aesKey); List<DeterministicKeyChain> newChains = new ArrayList<>(chains.size()); for (DeterministicKeyChain chain : chains) newChains.add(chain.toDecrypted(aesKey)); this.keyCrypter = null; basic = newBasic; chains.clear(); chains.addAll(newChains); }
/** * Decrypt the keys in the group using the previously given key crypter and the AES key. A good default * KeyCrypter to use is {@link org.bitcoinj.crypto.KeyCrypterScrypt}. * * @throws org.bitcoinj.crypto.KeyCrypterException Thrown if the wallet decryption fails for some reason, leaving the group unchanged. */ public void decrypt(KeyParameter aesKey) { // This code must be exception safe. checkNotNull(aesKey); BasicKeyChain newBasic = basic.toDecrypted(aesKey); List<DeterministicKeyChain> newChains = new ArrayList<DeterministicKeyChain>(chains.size()); for (DeterministicKeyChain chain : chains) newChains.add(chain.toDecrypted(aesKey)); this.keyCrypter = null; basic = newBasic; chains.clear(); chains.addAll(newChains); }
chain.toDecrypted(keyCrypter.deriveKey("wrong")); fail(); } catch (KeyCrypterException e) {} chain = chain.toDecrypted(PASSWORD); key = chain.findKeyFromPubKey(key1.getPubKey()); assertFalse(key.isEncrypted());