以编程方式获取证书详细信息

发布于 2024-09-12 22:20:44 字数 144 浏览 0 评论 0原文

我有一个自签名的 JAR 文件。我希望它能够:

  1. 检查它是否已签名;
  2. 获取并输出其签名所用证书的详细信息。

jar 不需要通过服务器检查或验证证书。

任何帮助将不胜感激。谢谢! :)

I have a self-signed JAR file. I would like for it to be able to:

  1. Check if it is signed;
  2. Get and output the details of the certificate it was signed with.

The jar does not need to check or verify the certificate with a server.

Any help would be appreciated. Thanks! :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

关于从前 2024-09-19 22:20:44

使用 CodeSource# getCertificates()

Certificate[] certificates = YourClass.class.getProtectionDomain().getCodeSource().getCertificates();

Use CodeSource#getCertificates().

Certificate[] certificates = YourClass.class.getProtectionDomain().getCodeSource().getCertificates();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文