protected X509CRL fetchX509CRLFromAttribute ( final LdapAttribute aval ) throws CertificateException , IOException , CRLException { if ( aval != null && aval . isBinary ( ) ) { val val = aval . getBinaryValue ( ) ; if ( val == null || val . length == 0 ) { throw new CertificateException ( "Empty attribute. Can not download CRL from ldap" ) ; } val 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 . Retrieves the binary attribute value decodes it to base64 and fetches it as a byte - array resource .