support/cas-server-support-x509/src/main/java/org/apereo/cas/adaptors/x509/authentication/ldap/LdaptiveResourceCRLFetcher.java
/**
     * Downloads a CRL from given LDAP url.
     *
     * @param r the resource that is the ldap url.
     * @return the x 509 cRL
     * @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
     */
Downloads a CRL from given LDAP url.
@param r the resource that is the ldap url.
@return the x 509 cRL
@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
Downloads a CRL from given LDAP url . @param r the resource that is the ldap url . @return the x 509 cRL @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
protected X509CRL fetchCRLFromLdap(final Object r) throws CertificateException, IOException, CRLException {
        try {
            final String ldapURL = r.toString();
            logger.debug("Fetching CRL from ldap {}", ldapURL);
            final Response<SearchResult> result = performLdapSearch(ldapURL);
            if (result.getResultCode() == ResultCode.SUCCESS) {
                final LdapEntry entry = result.getResult().getEntry();
                final LdapAttribute attribute = entry.getAttribute();
                logger.debug("Located entry [{}]. Retrieving first attribute [{}]",
                        entry, attribute);
                return fetchX509CRLFromAttribute(attribute);
            }
            logger.debug("Failed to execute the search [{}]", result);
            throw new CertificateException("Failed to establish a connection ldap and search.");
        } catch (final LdapException e) {
            logger.error(e.getMessage(), e);
            throw new CertificateException(e.getMessage());
        }
    }
protected X509CRL fetchCRLFromLdap ( final Object r ) throws CertificateException , IOException , CRLException { try { final String ldapURL = r . toString ( ) ; logger . debug ( "Fetching CRL from ldap {}" , ldapURL ) ; final Response < SearchResult > result = performLdapSearch ( ldapURL ) ; if ( result . getResultCode ( ) == ResultCode . SUCCESS ) { final LdapEntry entry = result . getResult ( ) . getEntry ( ) ; final LdapAttribute attribute = entry . getAttribute ( ) ; logger . debug ( "Located entry [{}]. Retrieving first attribute [{}]" , entry , attribute ) ; return fetchX509CRLFromAttribute ( attribute ) ; } logger . debug ( "Failed to execute the search [{}]" , result ) ; throw new CertificateException ( "Failed to establish a connection ldap and search." ) ; } catch ( final LdapException e ) { logger . error ( e . getMessage ( ) , e ) ; throw new CertificateException ( e . getMessage ( ) ) ; } }
Downloads a CRL from given LDAP url.
Downloads a CRL from given LDAP url .