/** * Decrypt the wallet with the wallets keyCrypter and AES key. * * @param aesKey AES key to use (normally created using KeyCrypter#deriveKey and cached as it is time consuming to create from a password) * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ public void decrypt(KeyParameter aesKey) { keyChainGroupLock.lock(); try { keyChainGroup.decrypt(aesKey); } finally { keyChainGroupLock.unlock(); } saveNow(); }
/** * Decrypt the wallet with the wallets keyCrypter and AES key. * * @param aesKey AES key to use (normally created using KeyCrypter#deriveKey and cached as it is time consuming to create from a password) * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ public void decrypt(KeyParameter aesKey) { keyChainGroupLock.lock(); try { keyChainGroup.decrypt(aesKey); } finally { keyChainGroupLock.unlock(); } saveNow(); }
/** * Decrypt the wallet with the wallets keyCrypter and AES key. * * @param aesKey AES key to use (normally created using KeyCrypter#deriveKey and cached as it is time consuming to create from a password) * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ public void decrypt(KeyParameter aesKey) { keyChainGroupLock.lock(); try { keyChainGroup.decrypt(aesKey); } finally { keyChainGroupLock.unlock(); } saveNow(); }
/** * Decrypt the wallet with the wallets keyCrypter and AES key. * * @param aesKey AES key to use (normally created using KeyCrypter#deriveKey and cached as it is time consuming to create from a password) * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ public void decrypt(KeyParameter aesKey) { keyChainGroupLock.lock(); try { keyChainGroup.decrypt(aesKey); } finally { keyChainGroupLock.unlock(); } saveNow(); }
/** * Decrypt the wallet with the wallets keyCrypter and password. * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ public void decrypt(CharSequence password) { keyChainGroupLock.lock(); try { final KeyCrypter crypter = keyChainGroup.getKeyCrypter(); checkState(crypter != null, "Not encrypted"); keyChainGroup.decrypt(crypter.deriveKey(password)); } finally { keyChainGroupLock.unlock(); } saveNow(); }
/** * Decrypt the wallet with the wallets keyCrypter and password. * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ public void decrypt(CharSequence password) { keyChainGroupLock.lock(); try { final KeyCrypter crypter = keyChainGroup.getKeyCrypter(); checkState(crypter != null, "Not encrypted"); keyChainGroup.decrypt(crypter.deriveKey(password)); } finally { keyChainGroupLock.unlock(); } saveNow(); }
/** * Decrypt the wallet with the wallets keyCrypter and password. * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ public void decrypt(CharSequence password) { keyChainGroupLock.lock(); try { final KeyCrypter crypter = keyChainGroup.getKeyCrypter(); checkState(crypter != null, "Not encrypted"); keyChainGroup.decrypt(crypter.deriveKey(password)); } finally { keyChainGroupLock.unlock(); } saveNow(); }
/** * Decrypt the wallet with the wallets keyCrypter and password. * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ public void decrypt(CharSequence password) { keyChainGroupLock.lock(); try { final KeyCrypter crypter = keyChainGroup.getKeyCrypter(); checkState(crypter != null, "Not encrypted"); keyChainGroup.decrypt(crypter.deriveKey(password)); } finally { keyChainGroupLock.unlock(); } saveNow(); }
@Test public void encryptionWhilstEmpty() throws Exception { group = new KeyChainGroup(PARAMS); group.setLookaheadSize(5); KeyCrypterScrypt scrypt = new KeyCrypterScrypt(2); final KeyParameter aesKey = scrypt.deriveKey("password"); group.encrypt(scrypt, aesKey); assertTrue(group.freshKey(KeyChain.KeyPurpose.RECEIVE_FUNDS).isEncrypted()); final ECKey key = group.currentKey(KeyChain.KeyPurpose.RECEIVE_FUNDS); group.decrypt(aesKey); assertFalse(checkNotNull(group.findKeyFromPubKey(key.getPubKey())).isEncrypted()); }
assertTrue(group.isEncrypted()); assertTrue(group.checkPassword("password")); group.decrypt(aesKey);