What's the best way to integrate the Bouncy Castle provider in a Java program?

女生的网名这么多〃 提交于 2019-12-23 07:28:29

问题


What's the best way to integrate the Bouncy Castle provider in a Java program? I know I can add it programmatically, by using:

import org.bouncycastle.jce.provider.BouncyCastleProvider;
...
Security.addProvider(new BouncyCastleProvider());

Or either I can add it to a path in the JRE on my machine.

What's the best choice?


回答1:


In my opinion the adding it as security provider with own code is the best option. This is because it is only project dependent - not system dependent. Add the BouncyCastle jar file(s) to your project and add them to the class-path and that's it. It will work on all systems without need for further manual installation steps.

If you install BouncyCastle into the JRE you always have problems in case you have to update the JRE.



来源:https://stackoverflow.com/questions/6442012/whats-the-best-way-to-integrate-the-bouncy-castle-provider-in-a-java-program

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