Ross Coulbeck
Ross Coulbeck

Reputation: 612

Java keypairs - private & public - I only have private

I'm having some problems packaging an app because the jarsigner keeps telling me this:

jarsigner: Certificate chain not found for: MyApp.  MyApp must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.

I generated the keystore using the command:

 keytool -genkey -keystore myAppKeystore.keystore -alias myApp

then filled in the rest of the information as it prompted.

When I checked the app using this command I found:

keytool -keystore myAppKeystore.keystore -list -v

It said something like this, and it seems to only say private key:

Alias name: myApp
Creation date: 06-Sep-2012
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: ......etc

I'm sure it will be something really obvious, but what am I missing? I was under the impression the previous command created a keypair? Not just the private key.

Thanks!

Upvotes: 0

Views: 809

Answers (2)

user207421
user207421

Reputation: 310980

You need to generate a certificate for the key pair, with 'keytool -selfcert ...'. Better still, generate a CSR and get your CA to issue a code signing certificate.

Upvotes: 1

GriffeyDog
GriffeyDog

Reputation: 8386

You need to get a public key certificate. You can use keytool to generate certificate requests to a certificate authority and import certificate replies. Perhaps all you need is a self-signed certificate.

Upvotes: 1

Related Questions