protected X509CRL fetchCRLFromLdap ( final Object r ) throws CertificateException , IOException , CRLException { try { val ldapURL = r . toString ( ) ; LOGGER . debug ( "Fetching CRL from ldap [{}]" , ldapURL ) ; val result = performLdapSearch ( ldapURL ) ; if ( result . getResultCode ( ) == ResultCode . SUCCESS ) { val entry = result . getResult ( ) . getEntry ( ) ; val attribute = entry . getAttribute ( this . certificateAttribute ) ; if ( attribute . isBinary ( ) ) { LOGGER . debug ( "Located entry [{}]. Retrieving first attribute [{}]" , entry , attribute ) ; return fetchX509CRLFromAttribute ( attribute ) ; } LOGGER . warn ( "Found certificate attribute [{}] but it is not marked as a binary attribute" , this . certificateAttribute ) ; } 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 .