简体   繁体   English

使用签名的小程序

[英]working with signed applets

I would like to create and work a signed applet from an applet that I wrote. 我想从我编写的小程序创建并使用一个签名的小程序。 The applet itself uses a library ( owlapi ) that has to have the correct write rights in order to save the changes made to the owl repository. 小程序本身使用一个必须具有正确写权限的库( owlapi ),才能保存对owl存储库所做的更改。

In order to do this I should use a .policy file or signed applets. 为此,我应该使用.policy文件或签名的小程序。 To make signed applets I followed this manual. 要制作签名的小程序,请遵循手册。 I follow that manual on the letter, and yet it doesn't work. 我按照信中的说明操作,但它不起作用。 I get to the point where I have a signed applet and include it in the html like this: 我到达了一个有签名的applet的地步,并将其包含在html中,如下所示:

<applet  code="owlapi.LoadOntology.class" archive="owlapi/SignedLoadOntology.jar" height=100 width=1000 MAYSCRIPT>
<param NAME="archive" VALUE='owlapi/Signedowlapi-src.jar, owlapi/Signedowlapi-bin.jar'>
</applet>

When I am testing that applet with the appletviewer (which is recommended in that manual), I get the error 当我使用appletviewer测试该applet(在该手册中建议)时,出现错误

I thought I could solve that by manually compile the code with that library and then create a jar with all those .class files, but that didn't help: 我以为可以解决该问题,方法是使用该库手动编译代码,然后使用所有这些.class文件创建一个jar,但这无济于事:

javac -cp owlapi-src.jar:owlapic-bin.jar LoadOntology.java
jar cvf LoadOntology *.class

Does anybody know how to create such a signed applet that uses a some other jar-files? 有人知道如何创建使用其他jar文件的签名小程序吗?

*update: * after reading this thread, I found out that the owlapi-src and owlapi-bin jars had to be included to the applet in the html an should be signed too. *更新:*阅读线程后,我发现owlapi-src和owlapi-bin jar必须包含在html中的applet中,也应该进行签名。 I changed the code to my current testing code, but that still didn't work, since I now have again the 我将代码更改为当前的测试代码,但是仍然无法正常工作,因为现在我又有了

 java.lang.SecurityException: Unable to create temporary file

which means that the code from the used owlapi library isn't found. 这意味着找不到使用过的owlapi库中的代码。

You probably need not include the -src jar, as I'd expect it to contain the java sources. 您可能不需要包含-src jar,因为我希望它包含Java源代码。 I do think you need to provide both your own signed jar and the signed library jar in one and the same applet parameter, as follows: 我确实认为您需要在一个相同的applet参数中同时提供自己的签名jar和签名库jar,如下所示:

<applet  code="owlapi.LoadOntology.class" height=100 width=1000 MAYSCRIPT>
    <param NAME="archive" 
        VALUE='owlapi/SignedLoadOntology.jar, owlapi/Signedowlapi-bin.jar'>
</applet>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM