public class DecryptingKeyBag extends java.lang.Object implements KeyBag
ECKey.KeyIsEncryptedException
will be thrown.Modifier and Type | Field and Description |
---|---|
protected org.bouncycastle.crypto.params.KeyParameter |
aesKey |
protected KeyBag |
target |
Constructor and Description |
---|
DecryptingKeyBag(KeyBag target,
org.bouncycastle.crypto.params.KeyParameter aesKey) |
Modifier and Type | Method and Description |
---|---|
ECKey |
findKeyFromPubKey(byte[] pubKey)
Locates a keypair from the keychain given the raw public key bytes.
|
ECKey |
findKeyFromPubKeyHash(byte[] pubKeyHash,
Script.ScriptType scriptType)
Locates a keypair from the keychain given the hash of the public key, and (optionally) by usage for a specific
script type.
|
RedeemData |
findRedeemDataFromScriptHash(byte[] scriptHash)
Locates a redeem data (redeem script and keys) from the keychain given the hash of the script.
|
protected final KeyBag target
protected final org.bouncycastle.crypto.params.KeyParameter aesKey
public DecryptingKeyBag(KeyBag target, @Nullable org.bouncycastle.crypto.params.KeyParameter aesKey)
@Nullable public ECKey findKeyFromPubKeyHash(byte[] pubKeyHash, @Nullable Script.ScriptType scriptType)
KeyBag
findKeyFromPubKeyHash
in interface KeyBag
pubKeyHash
- hash of the keypair to look forscriptType
- only look for given usage (currently Script.ScriptType#P2PKH
or
Script.ScriptType#P2WPKH
) or null
if we don't care@Nullable public ECKey findKeyFromPubKey(byte[] pubKey)
KeyBag
findKeyFromPubKey
in interface KeyBag
@Nullable public RedeemData findRedeemDataFromScriptHash(byte[] scriptHash)
KeyBag
findRedeemDataFromScriptHash
in interface KeyBag