I have to use OpenSSL in a Java web project and I don't know anything about 'OpenSSL'.
How can I integrate OpenSSL with my project? is there any good fundamental tutorials to learn this?
First of all: what do you need the library for?
Like these properties:
-Djavax.net.ssl.keyStore=keystore_path -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStore=truststore_path -Djavax.net.ssl.trustStorePassword=trustword
Everyone talks about BouncyCastle, but in our use case Gnu Crypto library won the day. Native java.
Our database ( aerospike ) spends at least 10% of its time computing hashes in java, for some customers, simply because these implementations are slow. I welcome when there's a native implementation of the crypto libraries available on every Linux machine. I thought some of the Java7 VMs were going to include more algorithms, but I haven't seen them yet.
Apache Tomcat Native Library is the solution. https://github.com/apache/tomcat-native
It uses OpenSSL for TLS/SSL capabilities. You can use it as standalone library (as I did) or connect your Tomcat. It is open source project with well documented Java code.
Why tomcat native?
JSSE is slow and hard to use. In my project to get best performance we've decided to find/write JNI wrapper for OpenSSL as possibility for upgrading certificates on-the-fly is a question mark and Key Stores are too complex.
As Bouncy Castle Crypto APIs is written in Java you cannot expect best efficiency.
Tomcat Native is a wrapper so you are limited only to capabilities of your OpenSSL version.
Best solution: Use Java's built-in security for simple tasks or use BouncyCastle for more advanced ones.
If you HAVE TO use OpenSSL from Java you have 2 choices:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With