private static Reason getReasonFromX509Entry(final X509CRLEntry entry) {
        if (entry.hasExtensions()) {
            try {
                val code = Integer.parseInt(
                    new String(entry.getExtensionValue(CRL_REASON_OID), StandardCharsets.US_ASCII));
                if (code < Reason.values().length) {
                    return Reason.fromCode(code);
                }
            } catch (final Exception e) {
                LOGGER.trace("An exception occurred when resolving extension value: [{}]", e.getMessage());
            }
        }
        return null;
    }
Get reason from the x509 entry.

@param entry the entry
@return reason or null
support/cas-server-support-x509-core/src/main/java/org/apereo/cas/adaptors/x509/authentication/revocation/RevokedCertificateException.java