Digitally Signing a JAR File
There are two easy steps to create a self-signed JAR.
1. Generate an Authentication Key with the Keytool that comes with your JDK. The following command will create a an Authentication Key.
keytool -genkey -keystore myKeystore -alias myself
(The program will ask you for information about the key.)
2. After you create a new jar, sign it. The following line will do that for an application called test.jar. You will see this line in the batch files at the end of this presentation.
jarsigner -keystore myKeystore test.jar myself
This program will ask you for a passphrase and will update your jar.