Friday, March 21, 2014

How To Sign In a Jar File

Steps to sign in a jar

1. Generate a private a key

        [path] >keytool -genkey -keystore -alias 
        E.g. C:\Users\chathuryad\Desktop\jarSign>keytool -genkey -keystore testkeystore -alias chathurya


Once you enter the command, it will prompt multiple questions and you have to answer them all. And please remember the password you provided, you need to provide it when you sign a jar


.
2. Then you can sign a jar 

 path>jarsigner -keystore -signedjar   
 E.g. C:\Users\chathuryad\Desktop\jarSign>jarsigner -keystore testkeystore -signedjar S2CBuilder.signed.jar S2CBuilder.jar chathurya





3. Delete files in signed jar. Open signed jar(E.g.: S2CBuilder.signed.jar) by using 7-zip compression tool.











goto META-INF folder and delete BCKEY.SF and BCKEY.DSA files.


Now you are done with jar signing and by double click on the signed jar file, you can execute it.

No comments:

Post a Comment