Signing JAR files.
Tuesday, 28. March 2006, 08:15:55
First step is generating a keypair with the keytool.
/usr/lib/j2sdk1.5-sun/bin/keytool -genkey -alias green -keypass greenpass
green is the alias for the keypair, and greenpass is the password to access that alias(or keypair). The keypair will be stored in the file .keystore in your homedirectory unless you specify otherwise.
You'll be asked a lot of questions, you may lie or just hit enter!
Create a self-signed certificate:
/usr/lib/j2sdk1.5-sun/bin/keytool -selfcert -alias green
After the keypair has been genereated the jar file can be signed with jarsigner:
In it's easiest form, jarsigner's syntax:
jarsigner jarfile alias
/usr/lib/j2sdk1.5-sun/bin/jarsigner JWSTest.jar green
It will ask for both passwords specified while generating the keys.
The jar file has now been signed ;)



How to use Quote function: