0

我有一个简单的 HelloWorld 小程序,我将它嵌入到 HTML 中。它工作得很好。但是我将小程序放入 jar 并签署了 jar,但它没有加载说“无法支持自签名 jar”我正在使用 ICA 颁发的证书进行签名。此外,在 1.7.51 版本之前,我们从未遇到过这个问题。顺便说一句:我浏览了有关添加参数的 Oracle 文档

根据它,我尝试在签名的 MANIFEST.MF 中添加以下属性,即:权限:沙箱,受信任的库:true 但这也没有帮助。我不确定我错过了什么。

清单看起来像这样:

Manifest-Version: 1.0
Trusted-Library: true
Permissions: all-permissions
Application-Library-Allowable-Codebase: *
Caller-Allowable-Codebase: *
Codebase: *

Created-By: 1.7.0_45 (Oracle Corporation)

Name: HelloWorld$1.class
SHA1-Digest: xcxzcbxzcbxzcbxzcb=

Name: HelloWorld.class
SHA1-Digest: xaadfasfdasdfsafd=

添加控制台日志:

com.sun.deploy.security.BlockedException: Your security settings have blocked a self-signed application from running
    at com.sun.deploy.security.SandboxSecurity.showBlockedDialog(Unknown Source)
    at com.sun.deploy.security.TrustDecider.askUser(Unknown Source)
    at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source)
    at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.getTrustedCodeSources(Unknown Source)
    at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source)
    at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)

在此处输入图像描述 谢谢。乙脑

4

2 回答 2

0

Trusted-Library 条目仅在 Java 1.7.45 之前相关。既然您需要添加该问题中提到的参数。

于 2014-05-07T13:38:25.633 回答
0

好吧,我找到了解决方案:

检查以下三件事。

1) Certificate has valid chain upto root and CA/ICA are public root.
2) Manifest.MF must have 2 attributes.
  • 代码库:<您要在其上部署 jar 的位置/主机名>
  • 权限:两个值之一(沙盒或所有权限)

在这里查看更多信息。

于 2014-05-13T11:51:04.833 回答