Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sam Gehouse
Ranch Hand
Posts: 281
  • 0
  • Mark post as helpful
  • send pies
  • 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.

 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic