/** * Encrypt the keys in the group using the KeyCrypter 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 encryption fails for some reason, * leaving the group unchanged. */ public void encrypt(KeyCrypter keyCrypter, KeyParameter aesKey) { checkNotNull(keyCrypter, "Attempting to encrypt with a null KeyCrypter"); checkNotNull(aesKey, "Attempting to encrypt with a null KeyParameter"); lock.lock(); try { if (seed != null) seed = seed.encrypt(keyCrypter, aesKey); masterKey = masterKey.encrypt(keyCrypter, aesKey, null); for (WalletAccount account : accounts.values()) { if (account.isEncryptable()) { account.encrypt(keyCrypter, aesKey); } } } finally { lock.unlock(); } }
/** * Encrypt the keys in the group using the KeyCrypter 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 encryption fails for some reason, * leaving the group unchanged. */ public void encrypt(KeyCrypter keyCrypter, KeyParameter aesKey) { checkNotNull(keyCrypter, "Attempting to encrypt with a null KeyCrypter"); checkNotNull(aesKey, "Attempting to encrypt with a null KeyParameter"); lock.lock(); try { if (seed != null) seed = seed.encrypt(keyCrypter, aesKey); masterKey = masterKey.encrypt(keyCrypter, aesKey, null); for (WalletAccount account : accounts.values()) { if (account.isEncryptable()) { account.encrypt(keyCrypter, aesKey); } } } finally { lock.unlock(); } }
this.lookaheadThreshold = chain.lookaheadThreshold; this.seed = chain.seed.encrypt(crypter, aesKey); basicKeyChain = new BasicKeyChain(crypter);
this.lookaheadThreshold = chain.lookaheadThreshold; this.seed = chain.seed.encrypt(crypter, aesKey); this.useSegwit = chain.useSegwit;
this.lookaheadThreshold = chain.lookaheadThreshold; this.seed = chain.seed.encrypt(crypter, aesKey); basicKeyChain = new BasicKeyChain(crypter);
this.lookaheadThreshold = chain.lookaheadThreshold; this.seed = chain.seed.encrypt(crypter, aesKey); basicKeyChain = new BasicKeyChain(crypter);