在Webstart/JNLP中部署JavaFX
我刚从Comodo购买了代码签名证书。我现在正试图签署一个Webstart/JNLP文件,以便分发它,但我收到了“应用程序被Java安全性阻止”消息。 我正在使用Maven构建:在Webstart/JNLP中部署JavaFX,java,maven,java-web-start,jnlp,jar-signing,Java,Maven,Java Web Start,Jnlp,Jar Signing,我刚从Comodo购买了代码签名证书。我现在正试图签署一个Webstart/JNLP文件,以便分发它,但我收到了“应用程序被Java安全性阻止”消息。 我正在使用Maven构建: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<taskdef name="jfxdeploy" classname="com.sun.javafx.tools.ant.DeployFXTask" classpathref="maven.plugin.classpath" />
<taskdef name="jfxsignjar" classname="com.sun.javafx.tools.ant.FXSignJarTask" classpathref="maven.plugin.classpath" />
<jfxdeploy outdir="${project.build.directory}/jnlp"
outfile="jnlp-test"
embedJNLP="true">
<info title="JNLP Test"
vendor="Foo Bar"
description=""/>
<application name="${project.name}"
mainClass="com.foo.CheckboxTableExample" />
<resources>
<fileset dir="${project.build.directory}" includes="*.jar" />
</resources>
<permissions elevated="true"/>
</jfxdeploy>
<!-- Sign all the jars in the deploy directory -->
<jfxsignjar destdir="${project.build.directory}/jnlp"
keyStore="cert.pfx"
storetype="pkcs12"
storePass="****"
alias="myalias">
<fileset dir="${project.build.directory}/jnlp" includes="*.jar" />
</jfxsignjar>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ant-javafx</artifactId>
<version>8.0</version>
<systemPath>${java.home}/../lib/ant-javafx.jar</systemPath>
<scope>system</scope>
</dependency>
</dependencies>
</plugin>
最后,很明显,我的jar不是根据jarsign-verify命令进行签名的
jar is unsigned. (signatures missing or not parsable)
我不确定jfxsigner命令有什么问题
编辑2:
现在我知道jar签名不起作用了,我尝试在命令行上使用jarsigner手动执行它,但我收到的证书出现了一个错误
Warning:
The signer's certificate chain is not validated.
No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2016-08-03) or after any future revocation date.
所以这是我需要解决的问题。我已经解决了我的问题
第一个问题是我在Windows中有一个针对Comodo的恶意根证书。需要拆下并安装正确的
第二个问题是,我需要将pfx文件和证书导入密钥库。我不确定这是否有必要,但我是在一连串的事件中做到的
第三个问题是“无tsa”错误。我以为这是科莫多给我的证书的问题,他们没有说别的。但通过搜索,我发现在jarsigner中添加-tsa可以消除该警告
第四个问题是jxsignjar不起作用。首先,当jar签名失败时,它没有报告错误。接下来,我需要将signjar放在部署之前(我的错误)。最后,它不允许-tsa选项。最后,我使用了一个ant任务来为jar签名
我使用JaNeLA工具检查jnlp文件。这是一个很酷的工具,但我认为它没有更新以支持JavaFX。例如,它会在上标记错误
<jfx:javafx-desc width="0" height="0" main-class="com.foo.CheckboxTableExample" name="Test JNLP" />
它需要旧格式的东西,比如
<application-desc main-class="com.foo.CheckboxTableExample" />
谢谢你的帮助,安德鲁。现在我需要弄清楚Webstart是否比安装程序更好。1)“我正在使用Maven构建:”由此产生的JNLP文件是什么?确保使用JaNeLA检查JNLP,可在我的网站上获得。2) 当您使用JRE工具检查Jar上的数字签名时,它会报告什么?复制/粘贴该信息。作为一个。我一定是瞎了。我不明白为什么罐子上说它没有签名。maven中的输出表示它签署了正确的jar。这是最后一步,所以没有其他事情会干扰它。还要确保修复JaNeLA报告的错误(不要担心警告或优化)。
<jfx:javafx-desc width="0" height="0" main-class="com.foo.CheckboxTableExample" name="Test JNLP" />
<application-desc main-class="com.foo.CheckboxTableExample" />