public abstract class BcExternalPublicKeyDataDecryptorFactory extends BcPublicKeyDataDecryptorFactory
BcPublicKeyDataDecryptorFactory whose private key material is held outside
the OpenPGP key - typically on a hardware token - as described by
OpenPGP External Secret
Keys and signalled by SecretKeyPacket.USAGE_EXTERNAL.
All session-key recovery logic (packet parsing, length checks, the RFC 6637 / RFC 9580 KDF and key
unwrap) is inherited from BcPublicKeyDataDecryptorFactory; a subclass supplies only the raw
private-key operation by implementing getExternalKeyCryptoCallback().
Note that a secret key handled through this class need not actually be external: if the supplied key
does carry usable software key material, getCryptoCallback(AsymmetricKeyParameter) returns the inherited software
callback so the (much cheaper) in-process path is used instead.
| Constructor and Description |
|---|
BcExternalPublicKeyDataDecryptorFactory(OpenPGPKey.OpenPGPSecretKey secretKey)
Create a decryptor factory for the given secret key.
|
| Modifier and Type | Method and Description |
|---|---|
protected BcPublicKeyCryptoCallback |
getCryptoCallback(org.bouncycastle.crypto.params.AsymmetricKeyParameter privKey)
Return the callback used for the raw private-key operations.
|
abstract BcPublicKeyCryptoCallback |
getExternalKeyCryptoCallback()
Return the callback routing the raw private-key operation to the external device.
|
protected OpenPGPKey.OpenPGPSecretKey |
getSecretKey()
Return the secret key this factory decrypts for.
|
createDataDecryptor, createDataDecryptor, createDataDecryptor, getCryptoCallback, recoverSessionData, unwrapSessionDatacheckRange, containsSKAlg, parseECDHEncSessionKey, parseXDHEncSessionKey, prependSKAlgorithmToSessionData, recoverSessionData, recoverSessionDatapublic BcExternalPublicKeyDataDecryptorFactory(OpenPGPKey.OpenPGPSecretKey secretKey) throws PGPException
secretKey - the (typically external) OpenPGP secret keyPGPException - if the key cannot be unlockedprotected OpenPGPKey.OpenPGPSecretKey getSecretKey()
protected BcPublicKeyCryptoCallback getCryptoCallback(org.bouncycastle.crypto.params.AsymmetricKeyParameter privKey)
BcPublicKeyDataDecryptorFactorygetCryptoCallback in class BcPublicKeyDataDecryptorFactorypublic abstract BcPublicKeyCryptoCallback getExternalKeyCryptoCallback()