Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
–
–
The 15 and 16 point to JRE 1.5 and 1.6 for compatibility. Your version is 1.46
at most
because that's the latest version where the JDK 1.5 and 1.6 were targeted separately. The 1.46 version
was created on February 2011
. The current version is 1.60, July 2018.
So you do not need nor should want
either
of those jars. You probably want the latest, otherwise you may be behind with regard to security fixes. Note that you should do some testing to see if the latest version runs with your code
and change your code
if it doesn't. Generally Bouncy Castle libs are backwards compatible, but some components such as its own ASN.1 API have gone through some serious changes.
So you'd better use
this one from the Maven repository
or download the latest
from the Bouncy Castle site itself
. You should use the one with 15on, which is for all versions of Java equal or greater than 1.5 (on = onwards).
Storing these jars without their version number is of course ludicrous. If you need to rename .jar files just to make your code run then there are some issues that you need to address.
–
–
–
The java version is relevant to Bouncy Castle. What you have are jars for Java 1.5 and Java 1.6
You should have only 1 in your classpath and use the Bouncy Castle jar closest to your Java runtime environment version. When you have more than one, you dont know which version of the code is being run. Class loading orders are not guaranteed and typically differs across environments, java versions, etc.
You are more likely to have bugs that are difficult to reproduce when you have two versions of the same jar.
What is important is the last 3 digits in the version e.g.
149
in
bcprov-jdk15on-149.jar
. This is the actual version of Bouncy Castle. Pick whichever is the newer one.
You should analyze your classpath dependencies (e.g.
mvn dependency:tree
) to understand which versions are you actually using. In principle the newer version should be backward compatible but this is not guranteed
and there could be bugs
.
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.