如何让Java“信任”用户证书过期了?
我有一个 CA 签名但过期已久的代码签名证书,用于 JWS 部署的 Web 应用程序。
当我启动此应用程序时,我收到一条警告提示,询问我是否信任此发布者。当我同意后,在 Java 控制面板中,我可以在“安全”选项卡中看到证书。
如何以编程方式(从命令行)达到相同的效果? keytool -import
似乎并不能解决问题。
I have a CA-signed, but long expired code signing certificate in use for a JWS-deployed web application.
When I launch this app, I get a warning prompt asking whether I trust this publisher. When I agree, in Java control panel I can see the certificate in Security tab.
How can I achieve the same effect programmatically (from command line)? keytool -import
does not seem to do the trick.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
portecle 程序是一个很棒的小工具,可以完成一些只能使用 API 才能完成的事情。您可以在这里获取它: http://portecle.sourceforge.net/
在 Windows Vista/7 上,您必须运行如果要将证书导入到 cacerts,请以管理员身份运行该程序。我通过以管理员身份运行命令提示符,然后运行 portecle.bat 文件来执行此操作。
cacerts 文件位于此处:
$JAVA_HOME/lib/security/cacerts
按 CTRL-O 打开密钥库文件。 cacerts 的密码是changeit
导入证书后不要忘记保存。
The portecle program is a great little tool for doing things which you can otherwise only do using the API. You can get it here: http://portecle.sourceforge.net/
On Windows Vista/7 you must run the program as administrator if you want to import a certificate into cacerts. I do this by running command prompt as administrator, then running the portecle.bat file.
The cacerts file is located here:
$JAVA_HOME/lib/security/cacerts
Press CTRL-O to open a keystore file. The password for cacerts is changeit
Don't forget to save after you import your certificate.