Search code examples
javacertificatedigital-signaturedigital-certificate

How to get key usage of a digital certificate in java


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.


Solution

  • You can get that information by calling the X509Certificate.getKeyUsage() method.

    Extended key usage information can be obtained from X509Certificate.getExtendedKeyUsage().