Monday, May 14, 2007

How do I sign my jar files?

I found myself having a .spc and a .pvk file, but how do I use those for signing a JAR file?

This is how I did:
  1. Open the console
  2. Type pvkimport (download from http://office.microsoft.com/downloads/2000/pvkimprt.aspx)
  3. Follow the onscreen wizard
  4. A pck file was created
  5. Now we need to know the alias that corresponds to this file
  6. Type keytool -list -storetype pkcs12 -keystore mycredentials.pfx
  7. You will see an output like this

    Keystore type: pkcs12
    Keystore provider: SunJSSE

    Your keystore contains 1 entry

    xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, May 14, 2007, keyEntry,
    Certificate fingerprint (MD5): hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh:hh


  8. The alias is the "xxxxxxxx-xxxx-..." part
  9. Sign your JARs using
    jarsigner -storetype pkcs12 -keystore mycredentials.pfx file.jar "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Happy signing

0 Comments:

Post a Comment

<< Home