public abstract class JceExternalPublicKeyDataDecryptorFactoryBuilder
extends java.lang.Object
PublicKeyDataDecryptorFactory 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. This is the
JCA/JCE analogue of BcExternalPublicKeyDataDecryptorFactory.
All session-key recovery logic (packet parsing, length checks, the RFC 6637 / RFC 9580 KDF and key
unwrap sequencing) is inherited from AbstractExternalPublicKeyDataDecryptorFactory, with the
cryptographic primitives bound to the configured JCA provider; a subclass supplies only the raw
private-key operation by implementing build(OpenPGPKey.OpenPGPSecretKey) with a
JceExternalPublicKeyDataDecryptorFactoryBuilder.PublicKeyCryptoCallback, which receives the sender's ephemeral key as a JCA
PublicKey built through the configured provider.
Note that a secret key handled through this builder need not actually be external: if the supplied key
carries usable software key material, the factory built delegates to
JcePublicKeyDataDecryptorFactoryBuilder so the (much cheaper) in-process path is used instead.
| Modifier and Type | Class and Description |
|---|---|
static class |
JceExternalPublicKeyDataDecryptorFactoryBuilder.PublicKeyCryptoCallback
Callback isolating the raw public-key operations performed while recovering an OpenPGP session
key.
|
| Constructor and Description |
|---|
JceExternalPublicKeyDataDecryptorFactoryBuilder() |
| Modifier and Type | Method and Description |
|---|---|
abstract PublicKeyDataDecryptorFactory |
build(OpenPGPKey.OpenPGPSecretKey secretKey)
Build a decryptor factory for the given secret key, routing the raw private-key operation to
wherever the key material is actually held.
|
protected PublicKeyDataDecryptorFactory |
build(PGPKeyPair keyPair,
JceExternalPublicKeyDataDecryptorFactoryBuilder.PublicKeyCryptoCallback cryptoCallback) |
JceExternalPublicKeyDataDecryptorFactoryBuilder |
setContentProvider(java.security.Provider provider) |
JceExternalPublicKeyDataDecryptorFactoryBuilder |
setContentProvider(java.lang.String providerName) |
JceExternalPublicKeyDataDecryptorFactoryBuilder |
setProvider(java.security.Provider provider)
Set the provider object to use for creating cryptographic primitives in the resulting factory the builder produces.
|
JceExternalPublicKeyDataDecryptorFactoryBuilder |
setProvider(java.lang.String providerName)
Set the provider name to use for creating cryptographic primitives in the resulting factory the builder produces.
|
public JceExternalPublicKeyDataDecryptorFactoryBuilder()
public JceExternalPublicKeyDataDecryptorFactoryBuilder setProvider(java.security.Provider provider)
provider - provider object for cryptographic primitives.public JceExternalPublicKeyDataDecryptorFactoryBuilder setProvider(java.lang.String providerName)
providerName - the name of the provider to reference for cryptographic primitives.public JceExternalPublicKeyDataDecryptorFactoryBuilder setContentProvider(java.security.Provider provider)
public JceExternalPublicKeyDataDecryptorFactoryBuilder setContentProvider(java.lang.String providerName)
public abstract PublicKeyDataDecryptorFactory build(OpenPGPKey.OpenPGPSecretKey secretKey) throws PGPException
secretKey - the (typically external) OpenPGP secret keyPGPException - if the key cannot be unlockedprotected PublicKeyDataDecryptorFactory build(PGPKeyPair keyPair, JceExternalPublicKeyDataDecryptorFactoryBuilder.PublicKeyCryptoCallback cryptoCallback) throws PGPException
PGPException