Question

I have signed a JAR file using a certificate i received from a trusted CA. I followed the complete code-signing process by creating a keystore, create CSR, submitting the CSR to CA and receive the certificate , importing the certificates into keystore (root, chain and code-signing certificates) and then sign the JAR file.

I have the above in below steps

keytool -genkey -keyalg rsa -keysize 2048 -alias myalias -dname "CN=##,O=##,L=##,ST=##,C=##" -keystore mykeystore -storepass mypass 
keytool -certreq -alias myalias -file certreq1.pem -keystore mykeystore
keytool -import -trustcacerts -alias myalias1 -file root.crt -keystore mykeystore
keytool -import -trustcacerts -alias myalias2 -file chain.crt -keystore mykeystore
keytool -import -alias myalias3 -file certificate.crt -keystore mykeystore

jarsigner -keystore mykeystore Applet.jar myalias

But still when i open it in the browser, i am getting the publisher as 'UNKNOWN'. What am i doing wrong here?

Was it helpful?

Solution

I found what i did incorreclty. While importing the code-signing certificate, i should use the same alias as the original one.

keytool -import -alias **myalias** -file certificate.crt -keystore mykeystore

Once this is done, it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top