Package org.bouncycastle.openpgp.api.bc
Class BcOpenPGPImplementation
java.lang.Object
org.bouncycastle.openpgp.api.OpenPGPImplementation
org.bouncycastle.openpgp.api.bc.BcOpenPGPImplementation
Implementation of
OpenPGPImplementation using Bouncy Castles 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 ofPBEKeyEncryptionMethodGeneratorwhich is responsible for creating symmetric-key-based encryptors for OpenPGP messages, usingS2K.SALTED_AND_ITERATEDmode.pbeKeyEncryptionMethodGenerator(char[] messagePassphrase, S2K.Argon2Params argon2Params) Return an instance ofPBEKeyEncryptionMethodGeneratorwhich is responsible for creating symmetric-key-based encryptors for OpenPGP messages, usingS2K.ARGON_2mode.Return an instance ofPBESecretKeyDecryptorBuilderProviderwhich 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 ofPGPContentVerifierBuilderProviderwhich is responsible for providing implementations needed for signature verification.pgpDataEncryptorBuilder(int symmetricKeyAlgorithm) Return an instance ofPGPDataEncryptorBuilderwhich is responsible for providing implementations needed for creating encrypted data packets.Return an instance of thePGPDigestCalculatorProvider, which is responsible for providing concretePGPDigestCalculatorimplementations.pgpObjectFactory(InputStream packetInputStream) Return an instance ofPGPObjectFactorybased 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 ofPublicKeyKeyEncryptionMethodGeneratorwhich 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
-
BcOpenPGPImplementation
public BcOpenPGPImplementation()
-
-
Method Details
-
pgpObjectFactory
Description copied from class:OpenPGPImplementationReturn an instance ofPGPObjectFactorybased on the givenInputStream.- Specified by:
pgpObjectFactoryin classOpenPGPImplementation- Parameters:
packetInputStream- packet input stream- Returns:
- object factory
-
pgpContentVerifierBuilderProvider
Description copied from class:OpenPGPImplementationReturn an instance ofPGPContentVerifierBuilderProviderwhich is responsible for providing implementations needed for signature verification.- Specified by:
pgpContentVerifierBuilderProviderin classOpenPGPImplementation- Returns:
- content verifier builder provider
-
pbeSecretKeyDecryptorBuilderProvider
Description copied from class:OpenPGPImplementationReturn an instance ofPBESecretKeyDecryptorBuilderProviderwhich is responsible for providing implementations needed for secret key unlocking.- Specified by:
pbeSecretKeyDecryptorBuilderProviderin classOpenPGPImplementation- Returns:
- secret key decryptor builder provider
-
pgpDataEncryptorBuilder
Description copied from class:OpenPGPImplementationReturn an instance ofPGPDataEncryptorBuilderwhich is responsible for providing implementations needed for creating encrypted data packets.- Specified by:
pgpDataEncryptorBuilderin classOpenPGPImplementation- Parameters:
symmetricKeyAlgorithm- symmetric encryption algorithm- Returns:
- data encryptor builder
-
publicKeyKeyEncryptionMethodGenerator
public PublicKeyKeyEncryptionMethodGenerator publicKeyKeyEncryptionMethodGenerator(PGPPublicKey encryptionSubkey) Description copied from class:OpenPGPImplementationReturn an instance ofPublicKeyKeyEncryptionMethodGeneratorwhich 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:
publicKeyKeyEncryptionMethodGeneratorin classOpenPGPImplementation- Parameters:
encryptionSubkey- subkey for which a message shall be encrypted- Returns:
- public-key key-encryption method generator
-
pbeKeyEncryptionMethodGenerator
Description copied from class:OpenPGPImplementationReturn an instance ofPBEKeyEncryptionMethodGeneratorwhich is responsible for creating symmetric-key-based encryptors for OpenPGP messages, usingS2K.SALTED_AND_ITERATEDmode. Symmetric-key-based encryptors are used when a message is encrypted using a passphrase.- Specified by:
pbeKeyEncryptionMethodGeneratorin 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:OpenPGPImplementationReturn an instance ofPBEKeyEncryptionMethodGeneratorwhich is responsible for creating symmetric-key-based encryptors for OpenPGP messages, usingS2K.ARGON_2mode. Symmetric-key-based encryptors are used when a message is encrypted using a passphrase.- Specified by:
pbeKeyEncryptionMethodGeneratorin 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:OpenPGPImplementationReturn an instance ofPGPContentSignerBuilder, which is responsible for providing concrete implementations needed for signature creation.- Specified by:
pgpContentSignerBuilderin 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:OpenPGPImplementationReturn 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:
pbeDataDecryptorFactoryin classOpenPGPImplementation- Parameters:
messagePassphrase- message passphrase- Returns:
- pbe data decryptor factory
- Throws:
PGPException- if the factory cannot be instantiated
-
sessionKeyDataDecryptorFactory
Description copied from class:OpenPGPImplementationReturn an instance of theSessionKeyDataDecryptorFactory, which is responsible for providing concrete implementations needed to decrypt OpenPGP messages using aPGPSessionKey.- Specified by:
sessionKeyDataDecryptorFactoryin classOpenPGPImplementation- Parameters:
sessionKey- session key- Returns:
- session-key data decryptor factory
-
publicKeyDataDecryptorFactory
Description copied from class:OpenPGPImplementationReturn an instance of thePublicKeyDataDecryptorFactory, which is responsible for providing concrete implementations needed to decrypt OpenPGP messages using aPGPPrivateKey.- Specified by:
publicKeyDataDecryptorFactoryin classOpenPGPImplementation- Parameters:
decryptionKey- private decryption key- Returns:
- public-key data decryptor factory
-
pgpDigestCalculatorProvider
Description copied from class:OpenPGPImplementationReturn an instance of thePGPDigestCalculatorProvider, which is responsible for providing concretePGPDigestCalculatorimplementations.- Specified by:
pgpDigestCalculatorProviderin classOpenPGPImplementation- Returns:
- pgp digest calculator provider
- Throws:
PGPException- if the provider cannot be instantiated
-
pgpKeyPairGeneratorProvider
- Specified by:
pgpKeyPairGeneratorProviderin classOpenPGPImplementation
-
pgpContentSignerBuilderProvider
- Specified by:
pgpContentSignerBuilderProviderin classOpenPGPImplementation
-
keyFingerPrintCalculator
- Specified by:
keyFingerPrintCalculatorin classOpenPGPImplementation
-
pbeSecretKeyEncryptorFactory
- Specified by:
pbeSecretKeyEncryptorFactoryin classOpenPGPImplementation
-
pbeSecretKeyEncryptorFactory
public PBESecretKeyEncryptorFactory pbeSecretKeyEncryptorFactory(boolean aead, int symmetricKeyAlgorithm, int iterationCount) - Specified by:
pbeSecretKeyEncryptorFactoryin classOpenPGPImplementation
-