【发布时间】:2011-12-24 09:06:37
【问题描述】:
我在自签名 jar 上收到以下错误:
jar verified.
Warning:
This jar contains entries whose certificate chain is not validated.
Re-run with the -verbose and -certs options for more details.
我是这样在罐子上签名的:
"C:\Program Files\Java\jdk1.7.0\bin\jarsigner" -keystore myKeyStore myJar.jar myAlias
我的 jar 有 2 个入口点:一个用于 java web start,一个用于小程序。
- 如果我以 java web start 方式运行 jar,则不会发生。
- 但如果我将 jar 作为小程序运行。当我尝试访问 jar 中嵌入的位图资源时,有时会收到强烈的安全警告。
使用 -verbose 和 -certs 选项会显示很多行。我对此一无所知。这是输出:output.txt(下面转载的 6307 行的一部分)。
s 157850 Tue Nov 08 12:57:44 CET 2011 META-INF/MANIFEST.MF
X.509, O=keyja.com
[certificate is valid from 17/08/11 17:32 to 24/07/11 17:32]
[CertPath not validated: null]
112909 Tue Nov 08 12:57:44 CET 2011 META-INF/KEYJA_CO.SF
1108 Tue Nov 08 12:57:44 CET 2011 META-INF/KEYJA_CO.RSA
sm 180 Tue Nov 08 12:16:40 CET 2011 com/keyja/client/a/a/a/k.class
X.509, O=keyja.com
[certificate is valid from 17/08/11 17:32 to 24/07/11 17:32]
[CertPath not validated: null]
sm 252 Tue Nov 08 12:16:40 CET 2011 com/keyja/client/a/a/a/r.class
...
(around 6000 lines of other output along the same lines)
s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope
jar verified.
Warning:
This jar contains entries whose certificate chain is not validated.
如何签署 jar 文件?
【问题讨论】:
-
有道理。我包含了一个指向输出的链接。
-
“如果我以 java web start 方式运行 jar,它不会发生任何事件。” JWS 启动请求的安全权限级别是多少?
-
如果小程序也以沙盒方式运行,为什么还要对代码进行签名?
-
因为如果我不签名,小程序将无法运行。它应该但它没有,出于我忽略的原因。