Signing a Jar file
Signing a jar file is essential to launch programs thorugh JNLP/ Java Webstart. Let us discuss in brief how to sign a jar file. JDK is to be installed and ensure the bin folder under Java installation home folder has keytool.exe and jarsigner.exe [To ensure you have JDK and not just JRE] and are available in the PATH [in windows].
Assuming the algorithm used to generate key is RSA, execute the following command navigating to the directory in which jar file resides[let us assume the name of the jar file to be signed is myapp.jar].
keytool -genkey -alias keystorename -keyalg RSA -keypass urpassword -keystore appkeystore.jks -storepass urpassword
You will be prompted to enter values for your state, oraganisation etc. Enter appropriate values and then execute the following commandto complete the signing of the jar file.
jarsigner -keystore appkeystore.jks myapp.jar keystorename
Posted at 06:47AM Aug 09, 2008 by Karthik in Java | Comments[0]


