开发者

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

开发者 https://www.devze.com 2023-03-14 13:14 出处:网络
What\'s the best way to integrate the Bouncy Castle provider in a Java program? I know I can add it programmatically, by using:

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号