CRLSelector that selects X509CRLs that
match all specified criteria. This class is particularly useful when
selecting CRLs from a CertStore to check revocation status
of a particular certificate.
When first constructed, an X509CRLSelector has no criteria
enabled and each of the get methods return a default
value (null). Therefore, the match method
would return true for any X509CRL. Typically,
several criteria are enabled (by calling setIssuers
or setDateAndTime, for instance) and then the
X509CRLSelector is passed to
CertStore. or some similar
method.
Please refer to RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile for definitions of the X.509 CRL fields and extensions mentioned below.
Concurrent Access
Unless otherwise specified, the methods defined in this class are not thread-safe. Multiple threads that need to access a single object concurrently should synchronize amongst themselves and provide the necessary locking. Multiple threads each manipulating separate objects need not synchronize.
CRLSelector, X509CRL
| Modifier and Type | Field and Description |
|---|---|
| private X509Certificate | |
| private Date | |
| private static final Debug | |
| private HashSet | |
| private HashSet | |
| private BigInteger | |
| private BigInteger | |
| private long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addIssuerName(String
the name in
RFC 2253 form name)
Deprecated
since 16. Use
addIssuer(X500Principal) or
addIssuerName(byte[]) instead.
Adds a name to the issuerNames criterion. |
| public void | addIssuerName(byte[]
a byte array containing the name in ASN.1 DER encoded form name)Adds a name to the issuerNames criterion. |
| private void | addIssuerNameInternal(Object
the name in string or byte array form name, X500Principal the name in X500Principal form principal)A private method that adds a name (String or byte array) to the issuerNames criterion. |
| public Object | Returns: the copyOverrides java. Implements java. Returns a copy of this object. |
| private static HashSet | Returns: a deep copy of the specifiedCollectiona names)Collection of names. Each entry is a
String or a byte array (the name, in string or ASN.1
DER encoded form, respectively). null is
not an acceptable value.Clone and check an argument of the form passed to setIssuerNames. |
| private static HashSet | Returns: a deep copy of the specifiedCollectiona names)Collection of names. Each entry is a
String or a byte array (the name, in string or ASN.1
DER encoded form, respectively). null is
not an acceptable value.Clone an argument of the form passed to setIssuerNames. |
| public X509Certificate | Returns: the certificate being checked (ornull)Returns the certificate being checked. |
| public Date | |
| public Collection | Returns: aCollection of names (or null)Returns a copy of the issuerNames criterion. |
| public Collection | Returns: an unmodifiableCollection of names
(or null)Returns the issuerNames criterion. |
| public BigInteger | |
| public BigInteger | |
| public boolean | Returns: true if the CRL should be selected,
false otherwisethe crl)CRL to be checkedImplements java. Decides whether a |
| private static HashSet | Returns: a HashSet of issuerX500Principalsa names)Collection of names. Each entry is a
String or a byte array (the name, in string or ASN.1
DER encoded form, respectively). Null is
not an acceptable value.Parse an argument of the form passed to setIssuerNames, returning a Collection of issuerX500Principals. |
| public void | setCertificateChecking(X509Certificate
the cert)X509Certificate being checked
(or null)Sets the certificate being checked. |
| public void | |
| pack-priv void | setDateAndTime(Date dateAndTime, long skew)
Sets the dateAndTime criterion and allows for the specified clock skew (in milliseconds) when checking against the validity period of the CRL. |
| public void | |
| public void | setIssuers(Collection<X500Principal>
a issuers)Collection of X500Principals
(or null)Sets the issuerNames criterion. |
| public void | setMaxCRLNumber(BigInteger
the maximum CRL number accepted (or maxCRL)null)Sets the maxCRLNumber criterion. |
| public void | setMinCRLNumber(BigInteger
the minimum CRL number accepted (or minCRL)null)Sets the minCRLNumber criterion. |
| public String | Returns: aString describing the contents of the
X509CRLSelector.Overrides java. Returns a printable representation of the |
| certChecking | back to summary |
|---|---|
| private X509Certificate certChecking | |
| dateAndTime | back to summary |
|---|---|
| private Date dateAndTime | |
| debug | back to summary |
|---|---|
| private static final Debug debug | |
| issuerNames | back to summary |
|---|---|
| private HashSet<Object> issuerNames | |
| issuerX500Principals | back to summary |
|---|---|
| private HashSet<X500Principal> issuerX500Principals | |
| maxCRL | back to summary |
|---|---|
| private BigInteger maxCRL | |
| minCRL | back to summary |
|---|---|
| private BigInteger minCRL | |
| skew | back to summary |
|---|---|
| private long skew | |
| X509CRLSelector | back to summary |
|---|---|
| public X509CRLSelector() Creates an | |
| addIssuer | back to summary |
|---|---|
| public void addIssuer(X500Principal issuer) Adds a name to the issuerNames criterion. The issuer distinguished
name in the
This method allows the caller to add a name to the set of issuer names
which
| |
| addIssuerName | back to summary |
|---|---|
| public void addIssuerName(String name) throws IOException
Deprecated since 16. Use Adds a name to the issuerNames criterion. The issuer distinguished
name in the
This method allows the caller to add a name to the set of issuer names
which
| |
| addIssuerName | back to summary |
|---|---|
| public void addIssuerName(byte[] name) throws IOException Adds a name to the issuerNames criterion. The issuer distinguished
name in the
This method allows the caller to add a name to the set of issuer names
which
The name is provided as a byte array. This byte array should contain
a single DER encoded distinguished name, as defined in X.501. The ASN.1
notation for this structure appears in the documentation for
Note that the byte array supplied here is cloned to protect against subsequent modifications.
| |
| addIssuerNameInternal | back to summary |
|---|---|
| private void addIssuerNameInternal(Object name, X500Principal principal) A private method that adds a name (String or byte array) to the
issuerNames criterion. The issuer distinguished
name in the
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Implements java. Returns a copy of this object.
| |
| cloneAndCheckIssuerNames | back to summary |
|---|---|
| private static HashSet Clone and check an argument of the form passed to setIssuerNames. Throw an IOException if the argument is malformed.
| |
| cloneIssuerNames | back to summary |
|---|---|
| private static HashSet Clone an argument of the form passed to setIssuerNames. Throw a RuntimeException if the argument is malformed. This method wraps cloneAndCheckIssuerNames, changing any IOException into a RuntimeException. This method should be used when the object being cloned has already been checked, so there should never be any exceptions.
| |
| getCertificateChecking | back to summary |
|---|---|
| public X509Certificate getCertificateChecking() Returns the certificate being checked. This is not a criterion. Rather,
it is optional information that may help a
| |
| getDateAndTime | back to summary |
|---|---|
| public Date getDateAndTime() Returns the dateAndTime criterion. The specified date must be
equal to or later than the value of the thisUpdate component
of the
Note that the
| |
| getIssuerNames | back to summary |
|---|---|
| public Collection Returns a copy of the issuerNames criterion. The issuer distinguished
name in the
If the value returned is not
If a name is specified as a byte array, it should contain a single DER
encoded distinguished name, as defined in X.501. The ASN.1 notation for
this structure is given in the documentation for
Note that a deep copy is performed on the
| |
| getIssuers | back to summary |
|---|---|
| public Collection Returns the issuerNames criterion. The issuer distinguished
name in the
If the value returned is not
| |
| getMaxCRL | back to summary |
|---|---|
| public BigInteger getMaxCRL() Returns the maxCRLNumber criterion. The
| |
| getMinCRL | back to summary |
|---|---|
| public BigInteger getMinCRL() Returns the minCRLNumber criterion. The
| |
| match | back to summary |
|---|---|
| public boolean match(CRL crl) Implements java. Decides whether a
| |
| parseIssuerNames | back to summary |
|---|---|
| private static HashSet Parse an argument of the form passed to setIssuerNames, returning a Collection of issuerX500Principals. Throw an IOException if the argument is malformed.
| |
| setCertificateChecking | back to summary |
|---|---|
| public void setCertificateChecking(X509Certificate cert) Sets the certificate being checked. This is not a criterion. Rather,
it is optional information that may help a
| |
| setDateAndTime | back to summary |
|---|---|
| public void setDateAndTime(Date dateAndTime) Sets the dateAndTime criterion. The specified date must be
equal to or later than the value of the thisUpdate component
of the
Note that the
| |
| setDateAndTime | back to summary |
|---|---|
| pack-priv void setDateAndTime(Date dateAndTime, long skew) Sets the dateAndTime criterion and allows for the specified clock skew (in milliseconds) when checking against the validity period of the CRL. | |
| setIssuerNames | back to summary |
|---|---|
| public void setIssuerNames(Collection<?> names) throws IOException Note use setIssuers(Collection) instead
or only specify the byte array form of distinguished names when using
this method. See
Sets the issuerNames criterion. The issuer distinguished name in the
This method allows the caller to specify, with a single method call,
the complete set of issuer names which
The
Note that the If a name is specified as a byte array, it should contain a single DER encoded distinguished name, as defined in X.501. The ASN.1 notation for this structure is as follows.
Note that a deep copy is performed on the
| |
| setIssuers | back to summary |
|---|---|
| public void setIssuers(Collection<X500Principal> issuers) Sets the issuerNames criterion. The issuer distinguished name in the
This method allows the caller to specify, with a single method call,
the complete set of issuer names which
The
Note that the
Note that a copy is performed on the
| |
| setMaxCRLNumber | back to summary |
|---|---|
| public void setMaxCRLNumber(BigInteger maxCRL) Sets the maxCRLNumber criterion. The
| |
| setMinCRLNumber | back to summary |
|---|---|
| public void setMinCRLNumber(BigInteger minCRL) Sets the minCRLNumber criterion. The
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a printable representation of the
| |