/**

Author: Ian Kaplan
April, 2013

To generate the key the SSL Keys for SSL communication in Java

   keytool -genkeypair -alias certificatekey -keyalg RSA -validity 7 -keystore keystore.jks

Give a suitable password and answers to the prompts. After that it will create the key store keystore.jks containing generated private/ public key pair.

  keytool -export -alias certificatekey -keystore keystore.jks -rfc -file cert.cer

Export the certificate (cret.cer) containing the public key from the key store using following command.

  keytool -export -alias certificatekey -keystore keystore.jks -rfc -file cert.cer

Create trust store

Now let's create the trust store (truststore.jks) and import the certificate to it. This can be done using single command line as given below.

keytool -import -alias certificatekey -file cert.cer -keystore truststore.jks
Again give a password and say yes to the prompt asking whether to trust this certificate. Now the certificate setup is complete. Let's create the secure Thrift server and client to consume it.

From: Buddhika Chamith's blog
http://chamibuddhika.wordpress.com/2011/10/03/securing-a-thrift-service/

*/ package ssl_test; public interface ISSLInterface { static final String certPath = "/home/iank/ssl_cert_java"; static final String keystorePath = certPath + "/" + "keystore.jks"; static final String truststorePath = certPath + "/" + "truststore.jks"; static final String certPswd = "myPassWord"; static final int port = 7911; static final int clientTimeout = 1000; static final String host = "localhost"; }