Package org.bitcoinj.wallet
Interface EncryptableKeyChain
- 
- All Superinterfaces:
- KeyChain
 - All Known Implementing Classes:
- BasicKeyChain,- DeterministicKeyChain,- MarriedKeyChain
 
 public interface EncryptableKeyChain extends KeyChain An encryptable key chain is a key-chain that can be encrypted with a user-provided password or AES key.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.bitcoinj.wallet.KeyChainKeyChain.KeyPurpose
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancheckAESKey(AesKey aesKey)booleancheckPassword(java.lang.CharSequence password)KeyCryptergetKeyCrypter()Returns the key crypter used by this key chain, or null if it's not encrypted.EncryptableKeyChaintoDecrypted(java.lang.CharSequence password)Decrypts the key chain with the given password.EncryptableKeyChaintoDecrypted(AesKey aesKey)Decrypt the key chain with the given AES key and whateverKeyCrypteris already set.EncryptableKeyChaintoEncrypted(java.lang.CharSequence password)Takes the given password, which should be strong, derives a key from it and then invokestoEncrypted(KeyCrypter, AesKey)withKeyCrypterScryptas the crypter.EncryptableKeyChaintoEncrypted(KeyCrypter keyCrypter, AesKey aesKey)Returns a new keychain holding identical/cloned keys to this chain, but encrypted under the given key.- 
Methods inherited from interface org.bitcoinj.wallet.KeyChainaddEventListener, addEventListener, earliestKeyCreationTime, getEarliestKeyCreationTime, getFilter, getKey, getKeys, hasKey, numBloomFilterEntries, numKeys, removeEventListener, serializeToProtobuf
 
- 
 
- 
- 
- 
Method Detail- 
toEncryptedEncryptableKeyChain toEncrypted(java.lang.CharSequence password) Takes the given password, which should be strong, derives a key from it and then invokestoEncrypted(KeyCrypter, AesKey)withKeyCrypterScryptas the crypter.- Returns:
- The derived key, in case you wish to cache it for future use.
 
 - 
toEncryptedEncryptableKeyChain toEncrypted(KeyCrypter keyCrypter, AesKey aesKey) Returns a new keychain holding identical/cloned keys to this chain, but encrypted under the given key. Old keys and keychains remain valid and so you should ensure you don't accidentally hold references to them.
 - 
toDecryptedEncryptableKeyChain toDecrypted(java.lang.CharSequence password) Decrypts the key chain with the given password. SeetoDecrypted(AesKey)for details.
 - 
toDecryptedEncryptableKeyChain toDecrypted(AesKey aesKey) Decrypt the key chain with the given AES key and whateverKeyCrypteris already set. Note that if you just want to spend money from an encrypted wallet, don't decrypt the whole thing first. Instead, set theSendRequest.aesKeyfield before asking the wallet to build the send.- Parameters:
- 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.
 
 - 
checkPasswordboolean checkPassword(java.lang.CharSequence password) 
 - 
checkAESKeyboolean checkAESKey(AesKey aesKey) 
 - 
getKeyCrypter@Nullable KeyCrypter getKeyCrypter() Returns the key crypter used by this key chain, or null if it's not encrypted.
 
- 
 
-