public interface EncryptableKeyChain extends KeyChain
KeyChain.KeyPurpose
Modifier and Type | Method and Description |
---|---|
boolean |
checkAESKey(org.spongycastle.crypto.params.KeyParameter aesKey) |
boolean |
checkPassword(CharSequence password) |
KeyCrypter |
getKeyCrypter()
Returns the key crypter used by this key chain, or null if it's not encrypted.
|
EncryptableKeyChain |
toDecrypted(CharSequence password)
Decrypts the key chain with the given password.
|
EncryptableKeyChain |
toDecrypted(org.spongycastle.crypto.params.KeyParameter aesKey)
Decrypt the key chain with the given AES key and whatever
KeyCrypter is already set. |
EncryptableKeyChain |
toEncrypted(CharSequence password)
Takes the given password, which should be strong, derives a key from it and then invokes
toEncrypted(org.bitcoinj.crypto.KeyCrypter, org.spongycastle.crypto.params.KeyParameter) with
KeyCrypterScrypt as the crypter. |
EncryptableKeyChain |
toEncrypted(KeyCrypter keyCrypter,
org.spongycastle.crypto.params.KeyParameter aesKey)
Returns a new keychain holding identical/cloned keys to this chain, but encrypted under the given key.
|
addEventListener, addEventListener, getEarliestKeyCreationTime, getFilter, getKey, getKeys, hasKey, numBloomFilterEntries, numKeys, removeEventListener, serializeToProtobuf
EncryptableKeyChain toEncrypted(CharSequence password)
toEncrypted(org.bitcoinj.crypto.KeyCrypter, org.spongycastle.crypto.params.KeyParameter)
with
KeyCrypterScrypt
as the crypter.EncryptableKeyChain toEncrypted(KeyCrypter keyCrypter, org.spongycastle.crypto.params.KeyParameter aesKey)
EncryptableKeyChain toDecrypted(CharSequence password)
toDecrypted(org.spongycastle.crypto.params.KeyParameter)
for details.EncryptableKeyChain toDecrypted(org.spongycastle.crypto.params.KeyParameter aesKey)
KeyCrypter
is already set. Note that if you
just want to spend money from an encrypted wallet, don't decrypt the whole thing first. Instead, set the
SendRequest.aesKey
field before asking the wallet to build the send.aesKey
- AES key to use (normally created using KeyCrypter#deriveKey and cached as it is time consuming to
create from a password)KeyCrypterException
- Thrown if the wallet decryption fails. If so, the wallet state is unchanged.boolean checkPassword(CharSequence password)
boolean checkAESKey(org.spongycastle.crypto.params.KeyParameter aesKey)
@Nullable KeyCrypter getKeyCrypter()
Copyright © 2016. All rights reserved.