Class JcaContextHelper


  • public class JcaContextHelper
    extends java.lang.Object
    Helper class for Java Cryptography Architecture (JCA) context consisting of provider Note: The following class is not thread safe, the security provider should not be changed during PGP operations
    • Field Detail

      • log

        private static final org.slf4j.Logger log
      • securityProvider

        private static java.security.Provider securityProvider
    • Constructor Detail

      • JcaContextHelper

        private JcaContextHelper()
    • Method Detail

      • getSecurityProvider

        public static java.security.Provider getSecurityProvider()
        Get the security provider which is used for all operations
      • setSecurityProvider

        public static void setSecurityProvider​(java.security.Provider securityProvider)
        Set the security provider to be used for all operations.
      • isSecurityProviderNotNull

        static boolean isSecurityProviderNotNull()
      • getJcaKeyFingerprintCalculator

        static org.bouncycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator getJcaKeyFingerprintCalculator()
      • getPGPContentVerifierBuilderProvider

        static org.bouncycastle.openpgp.operator.PGPContentVerifierBuilderProvider getPGPContentVerifierBuilderProvider()
      • getPGPDigestCalculatorProvider

        static org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider getPGPDigestCalculatorProvider()
                                                                                                     throws org.bouncycastle.openpgp.PGPException
        Throws:
        org.bouncycastle.openpgp.PGPException
      • getJcePBEDataDecryptorFactoryBuilder

        static org.bouncycastle.openpgp.operator.jcajce.JcePBEDataDecryptorFactoryBuilder getJcePBEDataDecryptorFactoryBuilder()
                                                                                                                        throws org.bouncycastle.openpgp.PGPException
        Throws:
        org.bouncycastle.openpgp.PGPException
      • getJcePublicKeyDataDecryptorFactoryBuilder

        static org.bouncycastle.openpgp.operator.jcajce.JcePublicKeyDataDecryptorFactoryBuilder getJcePublicKeyDataDecryptorFactoryBuilder()
      • getPGPDataEncryptorBuilder

        static org.bouncycastle.openpgp.operator.PGPDataEncryptorBuilder getPGPDataEncryptorBuilder​(int encAlgorithm)
      • getJcaKeyBoxBuilder

        static org.bouncycastle.gpg.keybox.jcajce.JcaKeyBoxBuilder getJcaKeyBoxBuilder()
      • getJcePBESecretKeyDecryptorBuilder

        static org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder getJcePBESecretKeyDecryptorBuilder()
                                                                                                                    throws org.bouncycastle.openpgp.PGPException
        Throws:
        org.bouncycastle.openpgp.PGPException
      • getPublicKeyKeyEncryptionMethodGenerator

        static org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator getPublicKeyKeyEncryptionMethodGenerator​(org.bouncycastle.openpgp.PGPPublicKey publicKey)
      • getPBEKeyEncryptionMethodGenerator

        static org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator getPBEKeyEncryptionMethodGenerator​(char[] symmetricPassphraseChars,
                                                                                                                    int hashAlgorithmOrdinal,
                                                                                                                    int workFactor)
                                                                                                             throws org.bouncycastle.openpgp.PGPException
        Throws:
        org.bouncycastle.openpgp.PGPException
      • getPGPContentSignerBuilder

        static org.bouncycastle.openpgp.operator.PGPContentSignerBuilder getPGPContentSignerBuilder​(int keyAlgorithmCode,
                                                                                                    int hashAlgorithmOrdinal)
      • getBcProviderInstance

        private static java.security.Provider getBcProviderInstance()