BouncyCastle on the server side with Android phones as clients

不打扰是莪最后的温柔 提交于 2019-12-06 16:16:14

I don't know how Apache Felix's class loading works, but you are not supposed to add the provider multiple times. Move the Security.addProvider(new BouncyCastleProvider()); part to a static initializer or register bouncy castle in the java.security file of the JDK.

What class is the exception occurring for? Why are you calling JCE code in the default constructor? That is probably a bad idea, especially when using automatic marshaling as offered by Gson. Construct your objects first and the call whatever verification code you have.

Apache Felix is an OSGi environment. Therefore the correct way would be to add the necessary BouncyCastle packages as dependencies to your bundle and install the BouncyCastle JAR as Bundle.

Since about a year or so the BouncyCastle JAR files are already correct bundles - they already include all the necessary data in the MANIFEST.MF.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!