如何使用NetBeans自行签名applet? [英] How to self-sign an applet with NetBeans?
问题描述
在过去的几个月里,我为一个学术项目开发了一个沙箱小程序。由于Java 1.7.51对applet的安全限制,我一直试图自我签署我的applet,希望它能够遵守或克服JRE对applet的必要条件。
In the previous months I developed a sandbox applet for an academic project. Due to the Java 1.7.51 security restrictions to applets, I have been trying to self-sign my applet with the hope that it can comply or overcome JRE's requisites for applets.
我正在使用NetBeans,我将一些显示如何自行签名jar文件的链接作为出发点。不幸的是,我无法让它发挥作用。
I'm using NetBeans and I have taken as a point of departure some links that show how to self-sign a jar file. Unfortunately, I haven't been able to get it working.
我试图在build.xml文件中添加以下说明:
I have tried to add the following instructions on the build.xml file:
<target name="-post-jar" depends="signing_procedure">
</target>
<target name="signing_procedure" depends="">
<echo message="Signing ${dist.dir}/MyFile.jar"/>
<exec dir="C:/Program Files/Java/jdk1.7.0_25/bin/" executable="jarsigner.exe">
<arg value="-verbose" />
<arg value="-keystore" />
<arg value="C:/Program Files/Java/jdk1.7.0_25/bin/MyKeyStore.jks" />
<arg value="-storepass" />
<arg value="mystorepass" />
<arg value="-keypass" />
<arg value="mykeypass" />
<arg value="C:/Users/Charles/Documents/ProjectsFolder/MyProject/dist/MyFile.jar" />
<arg value="MyAlias" />
</exec>
</target>
我收到以下错误消息:
Execute failed: java.io.IOException: Cannot run program "jarsigner.exe": error=2, The specified file is not found
我非常感谢你的帮助,以及更多关于NetBeans的帮助!
I would deeply thank you for your help, and much more if it is adressed to NetBeans!
推荐答案
我想出了怎么做。需要将以下行添加到build.xml,在NetBeans上相应项目的文件选项卡下:
I figured out how to do it. The following lines need to be added to the build.xml, under the tab Files of the corresponding project on NetBeans:
<target name="-post-jar" depends="Signing Procedure">
</target>
<target name="Signing procedure" depends="">
<echo message="Signing ${dist.dir}/MyAppet.jar..."/>
<exec dir="${dist.dir}" executable="C:/Program Files/Java/jdk1.7.0_25/bin/jarsigner.exe">
<arg value="-verbose" />
<arg value="-keystore" />
<arg value="C:/Program Files/Java/jdk1.7.0_25/bin/MyKeyStore.jks" />
<arg value="-storepass" />
<arg value="mystorepassword" />
<arg value="-keypass" />
<arg value="mykeypassword" />
<arg value="C:/Users/Charles/Documents/MyNetBeansProjects/MyProject/dist/MyApplet.jar" />
<arg value="MySelfSignatureAlias" />
</exec>
</target>
我希望这对其他用户有用!
I hope this is useful to other users!
这篇关于如何使用NetBeans自行签名applet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!