Friday, July 5, 2013

Create a keystore (Certificate) and then sign jar (applet)

To sign a jar
  1. Need to create a keystore (like Certificate)
    1. Go to your java jdk directory (e.g. C:\Program Files\Java\jdk1.6.0_25\bin)
    2. Type keytool -genkey -keystore icepdfapplet.keystore -alias icepdfapplet -keyalg RSA where icepdfapplet.keystore will be created
    3. You will be asked for Name, Unit... and password (Please remember the password)
    4. The keystore will be successfully created
  2. Now assign the certificate to the jar
    1. Type jarsigner -keystore icepdfapplet.keystore -storepass 123456789 icepdf-applet.jar icepdfapplet where 123456789 is the password I entered in the previous and icepdf-applet.jar is the jar file being assigned with the certificate
>keytool -genkey -keystore icepdfapplet.keystore -alias icepdfapplet -keyalg RSA
>jarsigner -keystore icepdfapplet.keystore -storepass 123456789 icepdf-applet.jar
icepdfapple

No comments:

Post a Comment