Posts

Showing posts from June, 2014

JKS to PEM conversion

Situation: I've generated a private key using keytool. I've created a CSR file with this private key and signed it with a CA. I'm using this successfully in my java projects and with Tomcat. Now, I need to use this SSL certificate with Nginx server. To do so, I need to provide the private key and certificate file to Nginx. I've got the CRT files from CA. But the question is, how to use the keytool generated private key with Nginx or other servers?   Solution: We need to extract the private key from the keystore file and save it in a format so that other servers can recognize it. Extract the private key from keystore using this tool  https://code.google.com/p/java-exportpriv/wiki/Usage Use the following command to extract the private key in PKCS#8 format java ExportPriv .keystore mykey test123 You can use this private key with Nginx or Apache who does not support keytool generated private key.

Hello World in Struts 1

Follow this tutorial:  http://www.dzone.com/tutorials/java/struts/struts-tutorial/struts-tutorial-using-eclipse-1.html After following this, you will be able to create a project but with import error for javax.serveletapi To resolve this, you need to install tomcat and add it to project's build path. Install Tomcat 7 from here  http://tomcat.apache.org/download-70.cgi Add tomcat in the targetted runtime as described here  http://stackoverflow.com/a/9287149/997566 Set tomcat in the java build path: Right click on project ---> Properties ---> Java Build Path ---> Add Library... ---> Server Runtime ---> Apache Tomcat ----> Finish Now, run the application and you should see the hello world!