Hello Stackoverflow Community,
When trying to compile my maven project that uses the bouncycastle security provider, I get this error: java.lang.SecurityException: JCE cannot authenticate the provider BC
I am aware that the jar must be signed, so I have added this to the pom.xml to prevent an error with compilation:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>
package
</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
Based on this (bouncycastle provider can't find classes needed for algorithm) I have added this: Security.setProperty("java.policy", "unlimited");
and I have added the provider with this: Security.addProvider(new BouncyCastleProvider());
in my public static void main.
Unfortunately, this didn't work. Do you have any suggestions of how to implement the thing shown in the post linked above without having to implement it for every JRE separately? Thanks in advance for any help.