views:

24

answers:

1

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!

A: 

Use CodeSource#getCertificates().

Certificate[] certificates = YourClass.class.getProtectionDomain().getCodeSource().getCertificates();
BalusC
Thanks alot! Worked great.
Sticky
You're welcome.
BalusC