Sean Tong
posted this on Oct 23, 2009 10:09
1. Generate a self signed KeyPair
keytool -genkey -alias tomcat -keyalg RSA -keystore <your_keystore_filename>
2. Export your certificate
keytool -export -alias tomcat -keystore <your_keystore_filename> -file <your_certificate_filename>
3. Import your certificate
keytool -import -alias tomcat -keystore <your_ca_keystore_filename> -trustcacerts -file <your_certificate_filename>
The CA certs file is located in {JAVA_HOME}/jre/lib/security/cacerts
To see the list of certs:
keytool -list -keystore cacerts
password: changeit