We decided to sign our JNLP files following this oracle guide. Since we have different JNLPs, we took the second approach (signing a JAR file with a JNLP template).
Here is the code we extracted to the template:
<?xml version="1.0" encoding="UTF-8"?> <jnlp spec="1.0+" codebase="*" href="*"> <information> <title>*</title> <vendor>My vendor</vendor> <description>My description</description> <icon href="splash.jpg" kind="splash" width="700" height="400" size="115258"/> <offline-allowed /> <shortcut> <menu submenu="My submenu"/> </shortcut> </information> <security> <all-permissions/> </security> <resources locale="en es ja"> <j2se version="1.6+" initial-heap-size="128m" max-heap-size="384m" href="http://java.sun.com/products/autodl/j2se"/> <jar href="myjar.jar" main="true" download="lazy" part="core" size="*"/> <jar href="lib/commons-lang-2.6.jar" download="lazy" part="commons" size="297085"/> ... <jar href="lib/trident-6.0.jar" download="lazy" part="core" size="114496"/> <property name="jnlp.myProperty" value="*"/> <property name="log4j.configuration" value="*"/> </resources> <application-desc main-class="com.mycom.myapp.MyClass"> </application-desc> </jnlp>
... and here is one of the JNLP that we actually use:
<?xml version="1.0" encoding="UTF-8"?> <jnlp spec="1.0+" codebase="http://mylocation.mycom.com/jnlp/myapp/" href="myapp.jnlp"> <information> <title>My App - Production version</title> <vendor>My vendor</vendor> <description>My description</description> <icon href="splash.jpg" kind="splash" width="700" height="400" size="115258"/> <offline-allowed /> <shortcut> <menu submenu="My submenu"/> </shortcut> </information> <security> <all-permissions/> </security> <resources locale="en es ja"> <j2se version="1.6+" initial-heap-size="128m" max-heap-size="384m" href="http://java.sun.com/products/autodl/j2se"/> <jar href="myjar.jar" main="true" download="lazy" part="core" size="4189501"/> <jar href="lib/commons-lang-2.6.jar" download="lazy" part="commons" size="297085"/> ... <jar href="lib/trident-6.0.jar" download="lazy" part="core" size="114496"/> <property name="jnlp.myProperty" value="http://mylocation.mycom.com/jnlp/myapp/MyApp.properties"/> <property name="log4j.configuration" value="http://mylocation.mycom.com/jnlp/myapp/log4j.xml"/> </resources> <application-desc main-class="com.mycom.myapp.MyClass"> </application-desc> </jnlp>
note that I used a wildcard ( * ) for:
- Codebase attribute in jnlp tag
- Href attribute in jnlp tag
- Content inside title tags
- attribute size in jar tag
- value of two properties
I put the template in the appropriate JNLP-INF folder (with the corresponding name), after which we signed the JAR. However, we continue to receive a JNLPSigningException with the following message:
Failed to verify startup file signing. The signed version does not match the downloaded version.
Does anyone have an idea of ββwhat I am missing?
source share