Class JcaOpenPGPImplementation
java.lang.Object
org.bouncycastle.openpgp.api.OpenPGPImplementation
org.bouncycastle.openpgp.api.jcajce.JcaOpenPGPImplementation
Implementation of
OpenPGPImplementation
using the JCA/JCE implementation of OpenPGP classes.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionpbeDataDecryptorFactory
(char[] messagePassphrase) Return an instance of thePBEDataDecryptorFactory
, which is responsible for providing concrete implementations needed to decrypt OpenPGP messages that were encrypted symmetrically with a passphrase.pbeKeyEncryptionMethodGenerator
(char[] messagePassphrase) Return an instance ofPBEKeyEncryptionMethodGenerator
which is responsible for creating symmetric-key-based encryptors for OpenPGP messages, usingS2K.SALTED_AND_ITERATED
mode.pbeKeyEncryptionMethodGenerator
(char[] messagePassphrase, S2K.Argon2Params argon2Params) Return an instance ofPBEKeyEncryptionMethodGenerator
which is responsible for creating symmetric-key-based encryptors for OpenPGP messages, usingS2K.ARGON_2
mode.Return an instance ofPBESecretKeyDecryptorBuilderProvider
which is responsible for providing implementations needed for secret key unlocking.pbeSecretKeyEncryptorFactory
(boolean aead) pbeSecretKeyEncryptorFactory
(boolean aead, int symmetricKeyAlgorithm, int iterationCount) pgpContentSignerBuilder
(int publicKeyAlgorithm, int hashAlgorithm) Return an instance ofPGPContentSignerBuilder
, which is responsible for providing concrete implementations needed for signature creation.pgpContentSignerBuilderProvider
(int hashAlgorithmId) Return an instance ofPGPContentVerifierBuilderProvider
which is responsible for providing implementations needed for signature verification.pgpDataEncryptorBuilder
(int symmetricKeyAlgorithm) Return an instance ofPGPDataEncryptorBuilder
which is responsible for providing implementations needed for creating encrypted data packets.Return an instance of thePGPDigestCalculatorProvider
, which is responsible for providing concretePGPDigestCalculator
implementations.pgpObjectFactory
(InputStream packetInputStream) Return an instance ofPGPObjectFactory
based on the givenInputStream
.publicKeyDataDecryptorFactory
(PGPPrivateKey decryptionKey) Return an instance of thePublicKeyDataDecryptorFactory
, which is responsible for providing concrete implementations needed to decrypt OpenPGP messages using aPGPPrivateKey
.publicKeyKeyEncryptionMethodGenerator
(PGPPublicKey encryptionSubkey) Return an instance ofPublicKeyKeyEncryptionMethodGenerator
which is responsible for creating public-key-based encryptors for OpenPGP messages.sessionKeyDataDecryptorFactory
(PGPSessionKey sessionKey) Return an instance of theSessionKeyDataDecryptorFactory
, which is responsible for providing concrete implementations needed to decrypt OpenPGP messages using aPGPSessionKey
.Methods inherited from class org.bouncycastle.openpgp.api.OpenPGPImplementation
getInstance, policy, setInstance, setPolicy
-
Constructor Details
-
JcaOpenPGPImplementation
public JcaOpenPGPImplementation() -
JcaOpenPGPImplementation
-
-
Method Details
-
pgpObjectFactory
Description copied from class:OpenPGPImplementation
Return an instance ofPGPObjectFactory
based on the givenInputStream
.- Specified by:
pgpObjectFactory
in classOpenPGPImplementation
- Parameters:
packetInputStream
- packet input stream- Returns:
- object factory
-
pgpContentVerifierBuilderProvider
Description copied from class:OpenPGPImplementation
Return an instance ofPGPContentVerifierBuilderProvider
which is responsible for providing implementations needed for signature verification.- Specified by:
pgpContentVerifierBuilderProvider
in classOpenPGPImplementation
- Returns:
- content verifier builder provider
-
pbeSecretKeyDecryptorBuilderProvider
Description copied from class:OpenPGPImplementation
Return an instance ofPBESecretKeyDecryptorBuilderProvider
which is responsible for providing implementations needed for secret key unlocking.- Specified by:
pbeSecretKeyDecryptorBuilderProvider
in classOpenPGPImplementation
- Returns:
- secret key decryptor builder provider
-
pgpDataEncryptorBuilder
Description copied from class:OpenPGPImplementation
Return an instance ofPGPDataEncryptorBuilder
which is responsible for providing implementations needed for creating encrypted data packets.- Specified by:
pgpDataEncryptorBuilder
in classOpenPGPImplementation
- Parameters:
symmetricKeyAlgorithm
- symmetric encryption algorithm- Returns:
- data encryptor builder
-
publicKeyKeyEncryptionMethodGenerator
public PublicKeyKeyEncryptionMethodGenerator publicKeyKeyEncryptionMethodGenerator(PGPPublicKey encryptionSubkey) Description copied from class:OpenPGPImplementation
Return an instance ofPublicKeyKeyEncryptionMethodGenerator
which is responsible for creating public-key-based encryptors for OpenPGP messages. Public-key-based encryptors are used when a message is encrypted for a recipients public key.- Specified by:
publicKeyKeyEncryptionMethodGenerator
in classOpenPGPImplementation
- Parameters:
encryptionSubkey
- subkey for which a message shall be encrypted- Returns:
- public-key key-encryption method generator
-
pbeKeyEncryptionMethodGenerator
Description copied from class:OpenPGPImplementation
Return an instance ofPBEKeyEncryptionMethodGenerator
which is responsible for creating symmetric-key-based encryptors for OpenPGP messages, usingS2K.SALTED_AND_ITERATED
mode. Symmetric-key-based encryptors are used when a message is encrypted using a passphrase.- Specified by:
pbeKeyEncryptionMethodGenerator
in classOpenPGPImplementation
- Parameters:
messagePassphrase
- passphrase to encrypt the message with- Returns:
- pbe key encryption method generator
-
pbeKeyEncryptionMethodGenerator
public PBEKeyEncryptionMethodGenerator pbeKeyEncryptionMethodGenerator(char[] messagePassphrase, S2K.Argon2Params argon2Params) Description copied from class:OpenPGPImplementation
Return an instance ofPBEKeyEncryptionMethodGenerator
which is responsible for creating symmetric-key-based encryptors for OpenPGP messages, usingS2K.ARGON_2
mode. Symmetric-key-based encryptors are used when a message is encrypted using a passphrase.- Specified by:
pbeKeyEncryptionMethodGenerator
in classOpenPGPImplementation
- Parameters:
messagePassphrase
- passphrase to encrypt the message withargon2Params
- parameters for the Argon2 hash function- Returns:
- pbe key encryption method generator
-
pgpContentSignerBuilder
Description copied from class:OpenPGPImplementation
Return an instance ofPGPContentSignerBuilder
, which is responsible for providing concrete implementations needed for signature creation.- Specified by:
pgpContentSignerBuilder
in classOpenPGPImplementation
- Parameters:
publicKeyAlgorithm
- the signing-keys public-key algorithmhashAlgorithm
- signature hash algorithm- Returns:
- content signer builder
-
pbeDataDecryptorFactory
public PBEDataDecryptorFactory pbeDataDecryptorFactory(char[] messagePassphrase) throws PGPException Description copied from class:OpenPGPImplementation
Return an instance of thePBEDataDecryptorFactory
, which is responsible for providing concrete implementations needed to decrypt OpenPGP messages that were encrypted symmetrically with a passphrase.- Specified by:
pbeDataDecryptorFactory
in classOpenPGPImplementation
- Parameters:
messagePassphrase
- message passphrase- Returns:
- pbe data decryptor factory
- Throws:
PGPException
- if the factory cannot be instantiated
-
sessionKeyDataDecryptorFactory
Description copied from class:OpenPGPImplementation
Return an instance of theSessionKeyDataDecryptorFactory
, which is responsible for providing concrete implementations needed to decrypt OpenPGP messages using aPGPSessionKey
.- Specified by:
sessionKeyDataDecryptorFactory
in classOpenPGPImplementation
- Parameters:
sessionKey
- session key- Returns:
- session-key data decryptor factory
-
publicKeyDataDecryptorFactory
Description copied from class:OpenPGPImplementation
Return an instance of thePublicKeyDataDecryptorFactory
, which is responsible for providing concrete implementations needed to decrypt OpenPGP messages using aPGPPrivateKey
.- Specified by:
publicKeyDataDecryptorFactory
in classOpenPGPImplementation
- Parameters:
decryptionKey
- private decryption key- Returns:
- public-key data decryptor factory
-
pgpDigestCalculatorProvider
Description copied from class:OpenPGPImplementation
Return an instance of thePGPDigestCalculatorProvider
, which is responsible for providing concretePGPDigestCalculator
implementations.- Specified by:
pgpDigestCalculatorProvider
in classOpenPGPImplementation
- Returns:
- pgp digest calculator provider
- Throws:
PGPException
- if the provider cannot be instantiated
-
pgpKeyPairGeneratorProvider
- Specified by:
pgpKeyPairGeneratorProvider
in classOpenPGPImplementation
-
pgpContentSignerBuilderProvider
- Specified by:
pgpContentSignerBuilderProvider
in classOpenPGPImplementation
-
keyFingerPrintCalculator
- Specified by:
keyFingerPrintCalculator
in classOpenPGPImplementation
-
pbeSecretKeyEncryptorFactory
- Specified by:
pbeSecretKeyEncryptorFactory
in classOpenPGPImplementation
- Throws:
PGPException
-
pbeSecretKeyEncryptorFactory
public PBESecretKeyEncryptorFactory pbeSecretKeyEncryptorFactory(boolean aead, int symmetricKeyAlgorithm, int iterationCount) throws PGPException - Specified by:
pbeSecretKeyEncryptorFactory
in classOpenPGPImplementation
- Throws:
PGPException
-