List of usage examples for java.security.cert X509CRLEntry getExtensionValue
public byte[] getExtensionValue(String oid);
From source file:eu.europa.esig.dss.DSSRevocationUtils.java
/** * This method returns the reason of the revocation of the certificate * extracted from the given CRL./*from w w w. java 2 s.c o m*/ * * @param crlEntry * An object for a revoked certificate in a CRL (Certificate * Revocation List). * @return * @throws DSSException */ public static String getRevocationReason(final X509CRLEntry crlEntry) throws DSSException { final String reasonId = Extension.reasonCode.getId(); final byte[] extensionBytes = crlEntry.getExtensionValue(reasonId); try { final ASN1Enumerated reasonCodeExtension = ASN1Enumerated .getInstance(X509ExtensionUtil.fromExtensionValue(extensionBytes)); final CRLReason reason = CRLReason.getInstance(reasonCodeExtension); int intValue = reason.getValue().intValue(); return CRLReasonEnum.fromInt(intValue).name(); } catch (IOException e) { throw new DSSException(e); } }