File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Jar signer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jar signer" Watch "Jar signer" New topic

Jar signer

Eoin Mac Aoidh
Ranch Hand

Joined: May 19, 2005
Posts: 48
hi - Jarsigner newbie here;

Im trying to sign a Jar file, on.jar, using the Jarsigner provided by j2sdk1.4.2_04. at the prompt, I type> JarSigner on.jar Eoin
Then it prompts me for the passphrase for the keystore.
I have no idea what the keystore is, or what its passphrase is for that matter! Is there a default passphrase or something?
-Actually on a broader scale - am I going about signing it correctly?

Any help greatly appreciated,
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
You need to use the keytool to create a keystore. Example:

Answer the questions ask.

Then, to sign your jar it's:

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Eoin Mac Aoidh
Ranch Hand

Joined: May 19, 2005
Posts: 48
Hi Carl, thanks for your help, Im nearly there - there seems to be one problem though.
First I create the keystore:

I just copied your example "jaxb.keys" as Im not sure what this is supposed to be, but it worked fine. Then it prompted me for some indormation, which I filled in.
For the second part then, signing the Jar, the args I gave were:

It gives the following error:
jarsigner: Certificate chain not found for: omframe.html. omframe.html must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.

Is the problem with my url "omframe.htm"? -Thats where I want to have the jar displayed.

Sorry to bother you again.

Eoin Mac Aoidh
Ranch Hand

Joined: May 19, 2005
Posts: 48
Ok - Well I dont really know what the problem was - but going by this article;
I manage to solve the problem.
Thanks again.

I agree. Here's the link:
subject: Jar signer