Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.x509;
  
  
This class is a Selector implementation for X.509 certificate revocation lists.

 
 public class X509CRLStoreSelector
     extends X509CRLSelector
     implements Selector
 {
     private boolean deltaCRLIndicator = false;
 
     private boolean completeCRLEnabled = false;
 
     private BigInteger maxBaseCRLNumber = null;
 
     private byte[] issuingDistributionPoint = null;
 
     private boolean issuingDistributionPointEnabled = false;
 
     private X509AttributeCertificate attrCertChecking;

    
Returns if the issuing distribution point criteria should be applied. Defaults to false.

You may also set the issuing distribution point criteria if not a missing issuing distribution point should be assumed.

Returns:
Returns if the issuing distribution point check is enabled.
 
     public boolean isIssuingDistributionPointEnabled()
     {
         return ;
     }

    
Enables or disables the issuing distribution point check.

Parameters:
issuingDistributionPointEnabled true to enable the issuing distribution point check.
 
     public void setIssuingDistributionPointEnabled(
         boolean issuingDistributionPointEnabled)
     {
         this. = issuingDistributionPointEnabled;
     }

    
Sets the attribute certificate being checked. This is not a criterion. Rather, it is optional information that may help a X509Store find CRLs that would be relevant when checking revocation for the specified attribute certificate. If null is specified, then no such optional information is provided.

Parameters:
attrCert the X509AttributeCertificate being checked (or null)
See also:
getAttrCertificateChecking()
 
     public void setAttrCertificateChecking(X509AttributeCertificate attrCert)
     {
          = attrCert;
     }

    
Returns the attribute certificate being checked.

Returns:
Returns the attribute certificate being checked.
See also:
setAttrCertificateChecking(org.bouncycastle.x509.X509AttributeCertificate)
 
     {
         return ;
     }
 
     public boolean match(Object obj)
     {
         if (!(obj instanceof X509CRL))
         {
             return false;
         }
         X509CRL crl = (X509CRL)obj;
         ASN1Integer dci = null;
        try
        {
            byte[] bytes = crl
                .getExtensionValue(..getId());
            if (bytes != null)
            {
                dci = ASN1Integer.getInstance(X509ExtensionUtil
                    .fromExtensionValue(bytes));
            }
        }
        catch (Exception e)
        {
            return false;
        }
        if (isDeltaCRLIndicatorEnabled())
        {
            if (dci == null)
            {
                return false;
            }
        }
        if (isCompleteCRLEnabled())
        {
            if (dci != null)
            {
                return false;
            }
        }
        if (dci != null)
        {
            if ( != null)
            {
                if (dci.getPositiveValue().compareTo() == 1)
                {
                    return false;
                }
            }
        }
        {
            byte[] idp = crl
                    .getId());
            if ( == null)
            {
                if (idp != null)
                {
                    return false;
                }
            }
            else
            {
                if (!Arrays.areEqual(idp))
                {
                    return false;
                }
            }
        }
        return super.match((X509CRL)obj);
    }
    public boolean match(CRL crl)
    {
        return match((Object)crl);
    }

    
Returns if this selector must match CRLs with the delta CRL indicator extension set. Defaults to false.

Returns:
Returns true if only CRLs with the delta CRL indicator extension are selected.
    public boolean isDeltaCRLIndicatorEnabled()
    {
        return ;
    }

    
If this is set to true the CRL reported contains the delta CRL indicator CRL extension.

setCompleteCRLEnabled(boolean) and setDeltaCRLIndicatorEnabled(boolean) excluded each other.

Parameters:
deltaCRLIndicator true if the delta CRL indicator extension must be in the CRL.
    public void setDeltaCRLIndicatorEnabled(boolean deltaCRLIndicator)
    {
        this. = deltaCRLIndicator;
    }

    
Returns an instance of this from a X509CRLSelector.

Parameters:
selector A X509CRLSelector instance.
Returns:
An instance of an X509CRLStoreSelector.
Throws:
java.lang.IllegalArgumentException if selector is null or creation fails.
    public static X509CRLStoreSelector getInstance(X509CRLSelector selector)
    {
        if (selector == null)
        {
            throw new IllegalArgumentException(
                "cannot create from null selector");
        }
        X509CRLStoreSelector cs = new X509CRLStoreSelector();
        cs.setCertificateChecking(selector.getCertificateChecking());
        cs.setDateAndTime(selector.getDateAndTime());
        try
        {
            cs.setIssuerNames(selector.getIssuerNames());
        }
        catch (IOException e)
        {
            // cannot happen
            throw new IllegalArgumentException(e.getMessage());
        }
        cs.setIssuers(selector.getIssuers());
        cs.setMaxCRLNumber(selector.getMaxCRL());
        cs.setMinCRLNumber(selector.getMinCRL());
        return cs;
    }
    
    public Object clone()
    {
        X509CRLStoreSelector sel = X509CRLStoreSelector.getInstance(this);
        sel.deltaCRLIndicator = ;
        sel.completeCRLEnabled = ;
        sel.maxBaseCRLNumber = ;
        sel.attrCertChecking = ;
        sel.issuingDistributionPointEnabled = ;
        sel.issuingDistributionPoint = Arrays.clone();
        return sel;
    }

    
If true only complete CRLs are returned. Defaults to false.

Returns:
true if only complete CRLs are returned.
    public boolean isCompleteCRLEnabled()
    {
        return ;
    }

    
If set to true only complete CRLs are returned.

setCompleteCRLEnabled(boolean) and setDeltaCRLIndicatorEnabled(boolean) excluded each other.

Parameters:
completeCRLEnabled true if only complete CRLs should be returned.
    public void setCompleteCRLEnabled(boolean completeCRLEnabled)
    {
        this. = completeCRLEnabled;
    }

    
Get the maximum base CRL number. Defaults to null.

Returns:
Returns the maximum base CRL number.
See also:
setMaxBaseCRLNumber(java.math.BigInteger)
    {
        return ;
    }

    
Sets the maximum base CRL number. Setting to null disables this cheack.

This is only meaningful for delta CRLs. Complete CRLs must have a CRL number which is greater or equal than the base number of the corresponding CRL.

Parameters:
maxBaseCRLNumber The maximum base CRL number to set.
    public void setMaxBaseCRLNumber(BigInteger maxBaseCRLNumber)
    {
        this. = maxBaseCRLNumber;
    }

    
Returns the issuing distribution point. Defaults to null, which is a missing issuing distribution point extension.

The internal byte array is cloned before it is returned.

The criteria must be enable with setIssuingDistributionPointEnabled(boolean).

Returns:
Returns the issuing distribution point.
See also:
setIssuingDistributionPoint(byte[])
    public byte[] getIssuingDistributionPoint()
    {
        return Arrays.clone();
    }

    
Sets the issuing distribution point.

The issuing distribution point extension is a CRL extension which identifies the scope and the distribution point of a CRL. The scope contains among others information about revocation reasons contained in the CRL. Delta CRLs and complete CRLs must have matching issuing distribution points.

The byte array is cloned to protect against subsequent modifications.

You must also enable or disable this criteria with setIssuingDistributionPointEnabled(boolean).

Parameters:
issuingDistributionPoint The issuing distribution point to set. This is the DER encoded OCTET STRING extension value.
See also:
getIssuingDistributionPoint()
    public void setIssuingDistributionPoint(byte[] issuingDistributionPoint)
    {
        this. = Arrays.clone(issuingDistributionPoint);
    }
New to GrepCode? Check out our FAQ X