How to code sign a Javafx app

576 Views Asked by At

I have a javafx 8 desktop app with the exec in a .jar.

I just bought a Code Signing Certificate from Comodo. The Certificate came out as a .p12 file via the browser.

I have never used code signer Certificates before.

How do I basically: Code sign my javafx app with it especially via Netbeans 8?

Can anyone point me to some instructions?

1

There are 1 best solutions below

0
On

TO SIGN A JAR WITH LOCAL CERTIFICATION: Make sure your system path is set to your jdk directory. Use the jarsigner tool provided via cmd to sign your jar. Note: you will need to create a keystore first with an alias.

TO SIGN A JAR WITH PROPER CERTIFICATION:

To verify the PKCS#12 file (*.p12 or *.pfx), run the following command:

keytool -list -v -storetype pkcs12 -keystore mycertificate.p12

In the output, you will see an Alias name. The Alias name is usually the string up to the first comma before the date. Copy this Alias name.

When your PKCS#12 file is verified, run the following command to sign the JAR file:

jarsigner -storetype pkcs12 -keystore mycertificate.pfx file.jar "alias"

Note: Replace the alias with the name of the alias from the keytool -list -v command above.

Your JAR file has been signed. To verify the signature of the JAR file, use the following command:

jarsigner -verify JARFile.jar