10 Replies Latest reply on Jul 11, 2016 2:16 PM by daslan govender

    Pgp Encryption works on Java 8 but not WildFly 10.0.0.Final

    daslan govender Newbie

      Hi

       

      When I run a class using Standalone Java and I have signed the following jars it works:

      bcpg-jdk15on-1.49.jar

      bcprov-jdk15on-1.49.jar

      bcprov-ext-jdk15on-1.49.jar

       

      BUT when I try to execute the same piece of code on WildFly i get the following error:

      2016-07-07 13:04:21,638 DEBUG CardOrderEncryptServlet (CardOrderEncryptServlet.java:143)- encKey:org.bouncycastle.openpgp.PGPPublicKey@24336846

      2016-07-07 13:04:21,871 DEBUG systemErrorLogger (Log4jConfigurator.java:131)- *$#org.bouncycastle.openpgp.PGPException: exception constructing public key

      13:04:21,875 ERROR [stderr] (default task-9) org.bouncycastle.openpgp.PGPException: exception constructing public key

      2016-07-07 13:04:21,875 ERROR stderr (AbstractLoggingWriter.java:71)- org.bouncycastle.openpgp.PGPException: exception constructing public key

      2016-07-07 13:04:21,876 DEBUG systemErrorLogger (Log4jConfigurator.java:131)- *$#java.security.spec.InvalidKeySpecException: key spec not recognised

      13:04:21,876 ERROR [stderr] (default task-9) java.security.spec.InvalidKeySpecException: key spec not recognised

      2016-07-07 13:04:21,876 ERROR stderr (AbstractLoggingWriter.java:71)- java.security.spec.InvalidKeySpecException: key spec not recognised

      2016-07-07 13:04:21,876 DEBUG systemErrorLogger (Log4jConfigurator.java:131)- *$# at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source)

      13:04:21,877 ERROR [stderr] (default task-9) at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source)

      2016-07-07 13:04:21,877 ERROR stderr (AbstractLoggingWriter.java:71)- at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source)

      2016-07-07 13:04:21,877 DEBUG systemErrorLogger (Log4jConfigurator.java:131)- *$# at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source)

      13:04:21,877 ERROR [stderr] (default task-9) at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source)

       

      Why does this happen?

       

      thanks,

      Daslan