Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Sign a jar with a third party certificate, using keytool and jarsigner

Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to sign a jar file (e.g., my.jar) using a third party certificate (third.cer). I have placed "my.jar" and "third.cer" in the bin directory. I am getting an error while trying to sign the jar. It tells me that the keystore password is incorrect, which is not true. Any advice will be appreciated.

First, I successfully create a keystore and import the alias.

jarsigner fails

I did a list to make sure that my keystore was created correctly, as shown below:

Any suggestion will be appreciated.

Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't sign anything with a third party certificate. One signs using the private key associated with the public key held in the certificate. One checks a signature using the public key/certificate. If the private key were to be held in the public certificate the private key would not be private and therefore the signature would not prove anything and the signature would not be worth the paper it was written on!

The private key must be kept very very very private and only the owner should ever get access to it. If anyone else gets access to the private key then they can forge a signature.
This one time, at bandcamp, I had relations with a tiny ad.
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic