Reputation: 157
How to get key usage of a digital certificate in java. I want to know the use of purpose of a certificate like digital signature or key-encipherment.
Upvotes: 0
Views: 3821
Reputation: 100
If you want to see basic information about a certificate, keytool would do the trick:
keytool -printcert -file <mycert.cer>
Upvotes: 1
Reputation: 97120
You can get that information by calling the X509Certificate.getKeyUsage()
method.
Extended key usage information can be obtained from X509Certificate.getExtendedKeyUsage()
.
Upvotes: 4