public interface PublicKeyDataDecryptorFactoryProvider
PublicKeyDataDecryptorFactory instances for secret keys whose private key material
BC cannot use directly - most importantly keys marked
SecretKeyPacket.USAGE_EXTERNAL because they live on a hardware token.
Register an implementation with
OpenPGPMessageProcessor.addPublicKeyDataDecryptorFactoryProvider(PublicKeyDataDecryptorFactoryProvider)
to let the high-level API decrypt messages addressed to such a key.
This interface lives in the api package rather than in operator because it is
expressed in terms of the high-level OpenPGPKey and KeyPassphraseProvider types, which
are themselves layered on top of operator.
| Modifier and Type | Method and Description |
|---|---|
PublicKeyDataDecryptorFactory |
providePublicKeyDataDecryptorFactory(OpenPGPKey.OpenPGPSecretKey secretKey,
KeyPassphraseProvider passphraseProvider)
Return a
PublicKeyDataDecryptorFactory for the given secret key, or null if
this provider cannot serve that key - for example because no matching device is present. |
PublicKeyDataDecryptorFactory providePublicKeyDataDecryptorFactory(OpenPGPKey.OpenPGPSecretKey secretKey, KeyPassphraseProvider passphraseProvider) throws PGPException
PublicKeyDataDecryptorFactory for the given secret key, or null if
this provider cannot serve that key - for example because no matching device is present. Returning
null lets the caller try the next registered provider, so it is the right answer for
"not mine"; throw a PGPException only when the key is ours and something went
wrong.secretKey - secret key the message was encrypted topassphraseProvider - callback supplying the key passphrase, or a device PINnull if this provider cannot serve the keyPGPException - if the key is one this provider handles but a factory cannot be built