开发者

Programmatically getting Certificate Details

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! :)


Use CodeSource#getCertificates().

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜