Set publisher name in JWS application using given certificate
-
14-06-2021 - |
Pregunta
I have obtained a certificate by a trusted authority (have been given a .pfx file).
I signed all my .jar files with jarsigner like this:
jarsigner -storetype pkcs12 -keystore my_pfx_file.pfx -storepass my_store_pwd -signedjar Smy_jar.jar my_jar.jar
Then I exported the certificate from the keystore to create a .cer file.
What else do I have to do so that I don't get the message from "Unknown Publisher" and instead has the Company name?
Solución
I figured it out. It was a problem with the .pfx file. I could see the certificate chain in the mmc console, but when I used:
keytool -list -storetype pkcs12 -keystore my_pfx_file.pfx
,
I saw the certificate chain length was 1.
So I exported the certificate from the mmc console. Only this time, I check the box that says "Include all certificates in the certification path if possible". I got a new .pfx file with which I signed my jars and it works perfectly.
This post helped me a lot to figure out what was going on:
How to sign java applet with .pfx file?