问题
I am confuse where add jar file (bcprov-jdk15-145.jar) for adding security file for BouncyCastleProvider. In application library or In JRE jre6\lib\ext\ folder.
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
回答1:
Unless you have a specific reason for adding a JAR file to the JRE's lib/ext directory don't put anything in there. This directory is for Installed Extensions, not just dependencies of your application.
Just add the bcprov-jdk15-145.jar file to the Classpath of your application.
回答2:
The generic answer would be: "On the classpath". Most often that would be with your application, eg. within an EAR or WAR file.
Cheers,
来源:https://stackoverflow.com/questions/13049720/how-to-add-library-for-bouncycastleprovider-security