How to sign Java applet 

Joined:
04/09/2007
Posts:
753

January 29, 2009 00:01:02    Last update: February 04, 2011 14:57:40
  1. Generate key valid for 10 years (3650 days). Since no -keystore option is given, the key is stored in the default keystore $HOME/.keystore.
    C:\tmp>keytool -genkey -keyalg rsa -alias mykey -validity 3650
    Enter keystore password: anything_is_fine_but_not_empty
    What is your first and last name?
      [Unknown]:  First Last
    What is the name of your organizational unit?
      [Unknown]:  Sales Dept.
    What is the name of your organization?
      [Unknown]:  Big Store
    What is the name of your City or Locality?
      [Unknown]:  New York
    What is the name of your State or Province?
      [Unknown]:  NY
    What is the two-letter country code for this unit?
      [Unknown]:  US
    Is CN=First Last, OU=Sales Dept., O=Big Store, L=New York, ST=NY, C=US correct?
      [no]:  yes
    
    Enter key password for <mykey>
            (RETURN if same as keystore password):
    


  2. Create the applet jar:
    jar -cf myapplet.jar com/my/applet
    


  3. Sign jar:
    C:\tmp>jarsigner myapplet.jar mykey
    Enter Passphrase for keystore: whatever_was_entered_above
    


  4. Verify signature:
    C:\tmp>jarsigner -verify -verbose -certs myapplet.jar
    



Share |
| Comment  | Tags