此 jar 包含签名者证书将在六个月内到期的条目 [英] This jar contains entries whose signer certificate will expire within six months
问题描述
我已经通过各种方式对我的 jar 进行了签名,但是当我使用命令时,我不断收到上述错误消息:
I've signed my jar in various ways, but I keep getting the above error message when I use the command:
jarsigner -verify -verbose [my jar]
有没有办法摆脱这个错误?如果没有重新认证,我的代码会在六个月后停止工作吗?
Is there a way to get rid of this error? Will my code just stop working after six months if it's not re-certified?
这是用于生成密钥的整套命令 &在罐子上签名:
Here is the entire set of commands used to generate the key & sign the Jar:
keytool -genkey -keystore [keystore] -alias [alias] -validity 2000
keytool -selfcert -keystore [keystore] -alias [alias] -validity 2000
jarsigner -keystore [keystore] [jar] [alias]
推荐答案
有没有办法摆脱这个错误?
Is there a way to get rid of this error?
这不是错误,而是警告.至于如何避免,请确保证书的有效期大于 6 个月.对于自签名证书,这是在生成密钥时提供正确参数的问题.这是keytool
示例.
It is not an error, but a warning. As to how to avoid it, make sure the certificate has a validity date that is longer than 6 months. For a self-signed certificate, that is a matter of providing the correct parameters when generating the key. Here is the keytool
Example.
keytool -genkeypair -dname "cn=Mark Jones, ou=Java, o=Oracle, c=US"
-alias business -keypass <new password for private key> -keystore /working/mykeystore
-storepass <new password for keystore> -validity 180
重要的部分是-validity 180
.例如,180 天,或大约 6 个月.使用 1800 大约 5 年.
The important part is -validity 180
. 180 days, or around 6 months, for that example. Use 1800 for around 5 years.
如果没有重新认证,我的代码会在六个月后停止工作吗?
Will my code just stop working after six months if it's not re-certified?
不完全是.
- 某些系统上的用户会收到证书已过期的警告,并且可以选择接受它.如果他们这样做,它将正常工作.例如签名已过期":
- 其他系统可能配置为自动拒绝过时的证书.在这些机器上,代码很可能永远不会启动,或者在极少数情况下,会加载但应用了沙盒.
我以为我已经关闭了所有 Java 缓存,因为在尝试开发时很烦人.
I thought I had turned all java caching off though, as it's annoying when trying to develop.
测试期间的小程序缓存是一个大问题.在绝对必要之前,我尽量避免在浏览器中测试小程序.我知道有两种方法可以测试不会缓存类的小程序.
Applet caching during testing is a big problem. I try to avoid testing applets in the browser until absolutely necessary. There are 2 ways I know of to test applets that will not cache the classes.
- 使用 AppletViewer
- 混合小程序/应用程序
这篇关于此 jar 包含签名者证书将在六个月内到期的条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!