support/cas-server-support-x509/src/main/java/org/apereo/cas/adaptors/x509/authentication/ldap/LdaptiveResourceCRLFetcher.java
/**
     * Gets x509 cRL from attribute. Retrieves the binary attribute value,
     * decodes it to base64, and fetches it as a byte-array resource.
     *
     * @param aval the attribute, which may be null if it's not found
     * @return the x 509 cRL from attribute
     * @throws IOException          the exception thrown if resources cant be fetched
     * @throws CRLException         the exception thrown if resources cant be fetched
     * @throws CertificateException if connection to ldap fails, or attribute to get the revocation list is unavailable
     */
Gets x509 cRL from attribute. Retrieves the binary attribute value,
decodes it to base64, and fetches it as a byte-array resource.


Gets x509 cRL from attribute . Retrieves the binary attribute value decodes it to base64 and fetches it as a byte - array resource .
protected X509CRL fetchX509CRLFromAttribute(final LdapAttribute aval) throws CertificateException, IOException, CRLException {
        if (aval != null) {
            final byte[] val = aval.getBinaryValue();
            if (val == null || val.length == 0) {
                throw new CertificateException("Empty attribute. Can not download CRL from ldap");
            }
            final byte[] decoded64 = EncodingUtils.decodeBase64(val);
            if (decoded64 == null) {
                throw new CertificateException("Could not decode the attribute value to base64");
            }
            logger.debug("Retrieved CRL from ldap as byte array decoded in base64. Fetching...");
            return super.fetch(new ByteArrayResource(decoded64));
        }
        throw new CertificateException("Attribute not found. Can not retrieve CRL");
    }
protected X509CRL fetchX509CRLFromAttribute ( final LdapAttribute aval ) throws CertificateException , IOException , CRLException { if ( aval != null ) { final byte [ ] val = aval . getBinaryValue ( ) ; if ( val == null || val . length == 0 ) { throw new CertificateException ( "Empty attribute. Can not download CRL from ldap" ) ; } final byte [ ] decoded64 = EncodingUtils . decodeBase64 ( val ) ; if ( decoded64 == null ) { throw new CertificateException ( "Could not decode the attribute value to base64" ) ; } logger . debug ( "Retrieved CRL from ldap as byte array decoded in base64. Fetching..." ) ; return super . fetch ( new ByteArrayResource ( decoded64 ) ) ; } throw new CertificateException ( "Attribute not found. Can not retrieve CRL" ) ; }
Gets x509 cRL from attribute.
Gets x509 cRL from attribute .