This week's giveaway is in the Spring forum.
We're giving away four copies of liveProject: Protecting User Data with Spring Security and OAuth2 and have Laurentiu Spilca on-line!
See this thread for details.
Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic