I've used bouncycastle in confluence with scope=provided. I believe that something like this is what I want since bouncycastle is provided by each app (and seemingly by refapp) but I'm not sure of how to declare the dep. Any advice?
<dependency> <groupId>bouncycastle</groupId> <artifactId>bcprov-jdk15</artifactId> <version>140</version> <scope>provided</scope> </dependency>
I'm trying to reuse some of this code across apps using a refapp add-on but cannot get the magic all lined up. If I use scope=provided then I get the following error (suggesting that BC is not found)
[INFO] [talledLocalContainer] - Cannot init MyAddon: java.lang.NullPointerException [INFO] [talledLocalContainer] java.lang.NullPointerException [INFO] [talledLocalContainer] at org.bouncycastle.jce.provider.JCEBlockCipher.engineGetKeySize(Unknown Source)
if I don't use the scope parameter then I get this trust issue
[INFO] [talledLocalContainer] 15 [Spring executor 12] ERROR com.example.plugins.crypt.MyAddon - Cannot init MyAddon: java.lang.SecurityException: JCE cannot authenticate the provider BC
Community moderators have prevented the ability to post new answers.
It could be that you have a dependency on something else that is ending up being bundled that should be provided. This can end up causing problems when classes are linked but not visible to the caller.
Check the maven dependency tree (mvn dependency:tree) and see if there are any other possibly provided dependencies.
On another note: why do you need to use the bouncy castle API directly?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.