Friday, June 18, 2010

SelfSigned certificate creation in java

Keytool file will be shipped with JDK

1. Goto %JAVA_HOME/bin
2. Run the following command

keytool -genkey -keypass mykeypass-keystore d:\apps\myproj\cacerts -storepass mystorepassword -keyalg rsa-alias sreddy
keypass : Your public/private key pair will be protected with this password
KeyStoreFilename : path to the keyStore file (default: JAVAHOME%\lib\security\cacerts)
storepass : password for the key store (default: changeit)
alias : this unique name will be used to identify the certificate. U can delete or modify with this name later
keyalg : Algorithm to be used. Use rsa