Re: JCE cannot authenticate the provider BC

Lothar Kimmeringer <[email protected]> Wed, 26 Jun 2019 14:24:41 +0200
Newsgroups gmane.comp.encryption.bouncy-castle.devel
Message-ID <[email protected]>
Hi,

Am 26.06.2019 um 08:33 schrieb Nidhi Aggarwal:

> I have downloaded the bouncycastle provider (bcprov-jdk15on-162.jar <https://www.bouncycastle.org/download/bcprov-jdk15on-162.jar>) latest builds from maven, bouncycastle website and added them to classpath and on execution I get the following stack trace. Can someone please help in resolving this. In earlier versions, we never faced any authentication issues.
[...]
>      [junit] Caused by: java.util.jar.JarException: file:bundles/bcprov_1.62.jar has unsigned entries - org/bouncycastle/LICENSE.class

Works Here[TM]

Make sure that you don't have any org.bouncycastle.LICENSE class in any other Jar that is
in your classpath as well. That's what I have each and every time I got this kind of
error-message. Sometimes it was the old jars still in the classpath or somebody created
a jar containing all bc-classses to have everything in one jar.

If you can't find the duplicate class immediately, use ClassLoader.getResource(...)
to find the occurrence of the LICENSE-class. When called Here[TM]:

         System.out.println(new BouncyCastleProvider().getVersion());
         System.out.println(getClass().getClassLoader().getResource("org/bouncycastle/LICENSE.class"));

1.62
jar:file:/D:/eclipse/eclipse-jee-2018/workspace/MyProject/lib/jars/base/bcprov.jar!/org/bouncycastle/LICENSE.class


Cheers, Lothar