I've developed an open source program, WPCleaner, which is distributed through Java Web Start. Current version is available at http://site4145.mutu.sivit.org/WikiCleaner/WikiCleaner.jnlp
With the recent updates in Java, it becomes more and more difficult to deploy Java applications through Java Web Start when you need the application to have a few permissions (writing in the preferences, accessing other web sites, ...)
My application was self-signed, which was ok before but new updates require users to accept the application every time they run it, not just once and for all if they wish. So, I decided to use a trusted certificate for signing my application.
I got one from Certum (apparently, they're free for open source developers), following this discussion: Code signing certificate for open-source projects?
I've generated a new jar file, signed with this certificate (jar file available at http://site4145.mutu.sivit.org/WikiCleaner/WikipediaCleanerTest.jar), but I still have problems: when I start the application through JWS, Java still displays a warning windows not letting me trust the application once and for all. Editor is still displayed as UNKNOWN, but when I look in the details of the message, it's my new certificate from Centrum that's being used.
Does anyone have an idea on what I'm doing wrong ? I thought that having a certificate from a trusted CA (Centrum seems to be in Java cacerts) would allow users to accept the certificate once and for all.
Thanks
PS: When I run jarsigner -verify
, I get the following warning
"This jar contains entries whose certificate chain is not validated."
I solved the same problem on mine today with this :
[Update 2017] Open Source code signing from Certum now uses a cryptographic flash card as a Private Key and must be plugged-in for certificate activation & installation, as well as for code signature. The key costs 125$ (+ shipping fee) and the 1-year certificate alone costs 40$. You can ask for a discount.
Here are the following steps to sign your jar file from scratch.
Instructions
Instructions in English are hard to find and not up to date. The following procedure is based on these 2 documents:
Create, activate and install your certificate:
Obtain the file "bundle.pem"
This file is mandatory for obtaining a valid certificate chain when signing your application (see the part 7.1.2 in the instructions in Polish).
Basically, it consists of concatenating in a plain text format file 1) your certificate and 2) the Certum Code Signing CA SHA2 public key.
Sign your jar file with Jarsigner
Personally, I use an Ant script to sign my application jar files. See signjar task from ANT project.
I think I finally managed to do it following this procedure:
Seems to work for me, I'm waiting for other users feedback to be sure that it works for them also.
Edit: I tried again to export the certificate from Chrome, and I saw that there's an option to include the certificate chain in the export. When doing this, I don't even need to use the KeyTool GUI afterwards. I've redeployed the test version signed with this new p12 :
On Linux, the following procedure worked for me. It is based on the answer by Eric David.
Get your Certificate
Go on the "Certum Certification" website in the "OpenSource Code Signing" section. Buy a certificate and follow the creation procedure.
Get the Public Key for Code Signing
Get the Public Key of Certum Code Signing CA, probably the CA SHA2 key cscasha2.cer.
Convert the certificate to pkcs12 format
menu item settings - advanced - certificates - show certificates.
tab cert. authorities - import.
tab own certificates - show.
tab own certificates - save - as pkcs12 (e.g. to mycert.p12)
Convert from pkcs12 format to jks format
Find the alias used in your pkcs12 file. It will be similar to "unizeto technologies s.a. id von open source developer, YOUR NAME".
Then convert the pkcs12 file into java's jks format. This step could be omitted, but once done it is convenient.
Sign your jar file
To avoid warnings to the webstart user, the jar manifest file should contain the following attributes:
Sign your jar file using the following command:
Based on JaNeLA for the file - valid JNLP. Most importantly known publisher for WikiCleanerTest..
So there is one result of 'seems to work here for identifying the publisher'. Great work and thanks for description of the process.
Works so much better than the one I looked at before. :P
Jarsigner -verify
I understand the warning:
..can be ignored.
JaNeLA Report
JaNeLA shows one error.
See the JNLP validated, and a corrected version with tweak, below.
Launch
But here is the real bad news:
Here are some details of the certificate:
Nicolas Vervelle (Nicolas Vervelle)
Out Of Date Java
Here is a strange warning I do not understand..
The app. is requesting 1.5.0+ so any version 1.7+ should be accepted without question.
It claims to be requesting 1.6 (probably because I have no 1.5 run-time installed). The only thing I can think is triggering the warning is the inclusion of a micro-version, which is unnecessary.
JNLP
Here is the JNLP validated above:
Here is a suggested replacement. It is valid according to JaNeLA (bar warnings that we can ignore). It also includes another tweak to the minimum version attribute.
As mentioned here, to remove the UNKNOWN PUBLISHER warning you can add the certificate you used to sign the jar into the Signer Jar of the Java Control Panel: Configure Java -> Security -> Manage Certificates -> Signer Jar option -> Import.