JCE cannot authenticate the provider BC

0
Hello all,   After upgrading my app for a customer from Mx4.4.3.1 to Mx6.9.1, I now get an error message "JCE cannot authenticate the provider BC". The message occurs when trying to encrypt a file to be put on an SFTP-server.   To add to the mix: I am familiar with Java, but I'm certainly no expert. Any help on what might be causing this would be greatly appreciated.   The following files are in my 'userlib': -          bcpg-jdk15on-150.jar -          bcpg-jdk16-145.jar -          bcpkix-jdk15on-150.jar -          bcprov-jdk15on-150.jar -          bcprov-jdk16-145.jar I tried removing them all, hoping Mendix packages this by default: the project won't compile. I tried using only the '-150' files: the project compiles but still generates the same error (these were added in the conversion to Mx6 somewhere, presumably by the Encryption module) I tried using only the '-145' files: the project won't compile (these were the ones that were in my Mx4 version of the project) I even tried using the '-155' files, the latest version of BouncyCastle: the project won't compile (this breaks the Encryption module)   For completeness, I have included the full stack trace below. Thanks in advance for any help provided.   Kind regards,   Ronald     The full stack trace: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.SecurityException: JCE cannot authenticate the provider BC at com.mendix.core.component.InternalCore.execute(InternalCore.java:398) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.SecurityException: JCE cannot authenticate the provider BC at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:176) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.SecurityException: JCE cannot authenticate the provider BC at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:40) Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.Cipher.getInstance(Cipher.java:657) at org.bouncycastle.jcajce.ProviderJcaJceHelper.createCipher(Unknown Source) at org.bouncycastle.openpgp.operator.jcajce.OperatorHelper.createCipher(Unknown Source) at org.bouncycastle.openpgp.operator.jcajce.OperatorHelper.createPublicKeyCipher(Unknown Source) at org.bouncycastle.openpgp.operator.jcajce.JcePublicKeyKeyEncryptionMethodGenerator.encryptSessionInfo(Unknown Source) at org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator.generate(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at generalsettings.actions.ExportEncryptedFile.encryptAndSign(ExportEncryptedFile.java:200) at generalsettings.actions.ExportEncryptedFile.doExport(ExportEncryptedFile.java:121) at generalsettings.actions.ExportEncryptedFile.executeAction(ExportEncryptedFile.java:88) at generalsettings.actions.ExportEncryptedFile.executeAction(ExportEncryptedFile.java:56) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.execute(InternalCore.java:390) at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:52) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.executeSync(InternalCore.java:472) at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SubMicroflowAction.scala:43) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.executeSync(InternalCore.java:472) at com.mendix.modules.microflowengine.actions.other.NestedLoopedMicroflowAction$$anonfun$executeLoop$2.apply(NestedLoopMicroflowAction.scala:67) at com.mendix.modules.microflowengine.actions.other.NestedLoopedMicroflowAction$$anonfun$executeLoop$2.apply(NestedLoopMicroflowAction.scala:58) at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:778) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:777) at com.mendix.modules.microflowengine.actions.other.NestedLoopedMicroflowAction.executeLoop(NestedLoopMicroflowAction.scala:58) at com.mendix.modules.microflowengine.actions.other.NestedLoopedMicroflowAction.execute(NestedLoopMicroflowAction.scala:41) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.executeSync(InternalCore.java:472) at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SubMicroflowAction.scala:43) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.execute(InternalCore.java:390) at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:144) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:311) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:301) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:301) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:143) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:145) at scala.util.Try$.apply(Try.scala:192) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:139) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:135) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.util.jar.JarException: file:/srv/mxinstances/<projectname>/model/bundles/project.jar has unsigned entries - OSGI-INF/system.UserActionsRegistrar.xml at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:467) at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:325) at javax.crypto.JarVerifier.verify(JarVerifier.java:253) at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:159) at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:185) at javax.crypto.Cipher.getInstance(Cipher.java:653) ... 89 more
asked
2 answers
1

The jar files your ar refering to are part of Bouncy Castle.  would try to download the latest versions of their jar files.

http://www.bouncycastle.org/latest_releases.html

-          bcpg-jdk15on-150.jar => bcpg-jdk15on-155.jar
-          bcpg-jdk16-145.jar => remove, seems like the same library as above
-          bcpkix-jdk15on-150.jar => bcpkix-jdk15on-155.jar
-          bcprov-jdk15on-150.jar => bcprov-jdk15on-155.jar
-          bcprov-jdk16-145.jar => remove, seems like the same library as above

As Eric suggested you are probably using the Encryption module. Remove all the jar files listed and import the latest version of the encryption module from the App Store. This should also get you the right jar files.

answered
0

Are you using an app store module to handle the encryption? If so, have you tried deleting the jars in your userlib, and then re-downloading the app store module? That might give you a clean userlib folder.

answered