1

I already have a VeriSign certificate to sign EXEs. I need to reuse it to sign jars.

Is it possible to reuse that certificate to sign jars?

Can someone explain me, how to use this VeriSign certificate with Oracle's jarsigner to sign jar files?

Any help is appreciated.

Steps I followed:

Step 1. Create key store keytool -genkey -keyalg rsa -keystore MYStore.ks -alias mySelf -keysize 2048

keystore pw : 4804994 mySelf pw: abcdef

Step 2. Import Verisign certificate to key store

keytool -importcert -file MSCV-VSClass3.cer -keystore MYStore.ks

This displays certificate info and ask; Trust this certificate ? [no] : yes

Certificate was added to keystore.

Step 3. jarsigner -keystore MYStore.ks TestRun.jar mySelf

Warning: signer certificate will expire within six months.

Now I wanted to verify the signed jar.

jarsigner -verify -verbose -certs TestRun.jar

Warning: This jar contain entries whose signer certificate will expire within six months. This jar contain entries whose certificate chain is not validated.

As I understand, key store does not have the private key of the public key in the certificate.

How to solve this issue?

Cheers.

user1606275
  • 51
  • 2
  • 5
  • You are missing quite a bit of information. There seems to be no association with your Verisign certificate and the private key, they would both combine to make a functional certificate. What format do you currently have your certificate in? Is it a PFX (PKCS#12)? – RickK Nov 07 '13 at 17:28
  • It is PFX. There is a file in my VeriSign folder called cert2013.pfx. How to integrate my certificate MSCV-VSClass3.cer and cert2013.pfx into a keystore? – user1606275 Nov 08 '13 at 08:48

1 Answers1

1

You can just start signing with the PFX file as this can be seen as a keystore file. The command you can try and use would be something like

jarsigner -storetype pkcs12 -keystore cert2013.pfx something.jar "1" -tsa http://verisignstimestampurl.something.com

Or you can import the PKCS12 file into to a JKS file but that seems a bit pointless;

keytool -importkeystore -srckeystore cert2013.pfx -srcstoretype PKCS12 -deststoretype JKS -destkeystore keystore.jks

Hope any of the two commands above help. The first command you will have to find out what VeriSigns timestamp URL is, and the "1" was also a guess, you can view the alias assigned to it by typing;

keytool -list -keystore cert2013.pfx -storetype PKCS12

Regards,

RickK
  • 929
  • 7
  • 4