static boolean isIndirectCRL(X509CRL crl) throws CRLException { try { byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId()); return idp != null && IssuingDistributionPoint.getInstance(X509ExtensionUtil.fromExtensionValue(idp)) .isIndirectCRL(); } catch (Exception e) { throw new ExtCRLException("Exception reading IssuingDistributionPoint", e); } }
/** @return the revocation reason code as defined in RevokedCertInfo.REVOCATION_REASON_... */ public static int extractReasonCode(final X509CRLEntry crlEntry) { int reasonCode = RevokedCertInfo.REVOCATION_REASON_UNSPECIFIED; if (crlEntry.hasExtensions()) { final byte[] extensionValue = crlEntry.getExtensionValue(Extension.reasonCode.getId()); try { final ASN1Enumerated reasonCodeExtension = ASN1Enumerated.getInstance(X509ExtensionUtil.fromExtensionValue(extensionValue)); if (reasonCodeExtension != null) { reasonCode = reasonCodeExtension.getValue().intValue(); } } catch (IOException e) { log.debug("Failed to parse reason code of CRLEntry: " + e.getMessage()); } } return reasonCode; }