【发布时间】:2014-02-17 21:42:33
【问题描述】:
我有一个需要在我的网站上部署的 Java 小程序。
我的网站有很多页面,小程序出现在其中的许多页面上。我网站的基域是www.mycompany.com。但是小程序会出现在上面,例如:www.mycompany.com/dog、www.mycompany.com/cat、www.mycompany.com/pen等
入口点的包是com.mycompany.MyApplet。
按照Java Security Manifest Changes in the Browser 的说明,我为我的应用创建了以下清单。有人可以帮我检查一下,以便我正确理解吗?基本上,当人们尝试从我的网站运行我的小程序时,我不希望出现任何警告。
清单
Manifest-Version: 1.0
Created-By: 1.7.0_51
Permissions: sandbox
Application-Name: My Farming Business
Application-Library-Allowable-Codebase: www.mycompany.com/where_the_applet_jar_actually_lives
Caller-Allowable-Codebase:www.mycompany.com
Codebase: www.mycompany.com
使用上述清单重新部署后,现在我得到以下对话框:
应用程序被安全设置阻止:您的安全设置有 阻止不受信任的应用程序运行
参考:How do I inject new manifest into an existing jar for applet
另外,我使用以下步骤对我的 jar 签名:
keytool -genkey -keystore myKeyStore -alias mekeytool -selfcert -keystore myKeyStore -alias mejarsigner -keystore myKeyStore jarfile.jar me
【问题讨论】:
-
在我的清单中,我什至有
Implementation-Vendor: Company Name,但我没有“仅受信任”条目。 Java 控制台中显示哪些警告? -
在您的设置中,您的 Java 安全级别是多少?
-
这是一个很好问的问题。非常罕见。非常好。
标签: java security applet manifest