Interface PublicKeyDataDecryptorFactoryProvider
public interface PublicKeyDataDecryptorFactoryProvider
Provider of
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.
-
Method Summary
Modifier and TypeMethodDescriptionprovidePublicKeyDataDecryptorFactory(OpenPGPKey.OpenPGPSecretKey secretKey, KeyPassphraseProvider passphraseProvider) Return aPublicKeyDataDecryptorFactoryfor the given secret key, ornullif this provider cannot serve that key - for example because no matching device is present.
-
Method Details
-
providePublicKeyDataDecryptorFactory
PublicKeyDataDecryptorFactory providePublicKeyDataDecryptorFactory(OpenPGPKey.OpenPGPSecretKey secretKey, KeyPassphraseProvider passphraseProvider) throws PGPException Return aPublicKeyDataDecryptorFactoryfor the given secret key, ornullif this provider cannot serve that key - for example because no matching device is present. Returningnulllets the caller try the next registered provider, so it is the right answer for "not mine"; throw aPGPExceptiononly when the key is ours and something went wrong.- Parameters:
secretKey- secret key the message was encrypted topassphraseProvider- callback supplying the key passphrase, or a device PIN- Returns:
- a decryptor factory, or
nullif this provider cannot serve the key - Throws:
PGPException- if the key is one this provider handles but a factory cannot be built
-