Skip to main content

Posts

Showing posts with the label Sign JAR

Ant Script To Sign A JAR File

To sign a JAR file you need a ‘keystore” first. You can create a sample keystore using the following simple command. keytool -genkey -keystore <filename.store> -alias <aliasname> After creating the keystore, you can add the following Ant tag to sign the JAR file using it. <signjar jar="<JAR file to be signed>" alias="<Keystore Alias Name>"                 keystore="<Keystorefile.store>" storepass="<Keystore password>"/> Attributes used are jar – The JAR file path which needs to be signed. alias – Keystore alias name, given in the ‘keytool’ command to create the keystore. keystore – Path to the keystore file, which was created using the ‘keytool’ command. storepass – Keystore password used while creating the keystore using ‘keytool’ command.