Class X509CRLSelector
- All Implemented Interfaces:
Cloneable,CRLSelector
- Direct Known Subclasses:
X509CRLStoreSelector
public class X509CRLSelector extends Object implements CRLSelector
CRLSelector for selecting
X509CRLs that match the specified criteria.
When constructed, all criteria are set to default values that will match any
X509CRL.
-
Constructor Summary
Constructors Constructor Description X509CRLSelector()Creates a newX509CertSelector. -
Method Summary
Modifier and Type Method Description voidaddIssuer(X500Principal issuer)Adds an issuer to the criterion for the issuer distinguished names.voidaddIssuerName(byte[] iss_name)Adds an issuer to the criterion for the issuer distinguished names.voidaddIssuerName(String iss_name)Do not use:, useaddIssuer(X500Principal)oraddIssuerName(byte[])instead.Objectclone()Clones thisX509CRLinstance.X509CertificategetCertificateChecking()Returns the certificate hint to find CRLs.DategetDateAndTime()Returns the criterion for the CRL update period.Collection<Object>getIssuerNames()Returns the criterion for the issuer distinguished names.Collection<X500Principal>getIssuers()Returns the criterion for the issuer distinguished names.BigIntegergetMaxCRL()Returns the criterion for the maximum CRL number.BigIntegergetMinCRL()Returns the criterion for the minimum CRL number.booleanmatch(CRL crl)Returns whether the specified CRL matches all the criteria collected in this instance.voidsetCertificateChecking(X509Certificate cert)Sets a certificate hint to find CRLs.voidsetDateAndTime(Date dateAndTime)Sets the criterion for the CRL update period.voidsetIssuerNames(Collection<?> names)Do not use: usesetIssuers(Collection)or one ofaddIssuerName(java.lang.String)instead.voidsetIssuers(Collection<X500Principal> issuers)Sets the criterion for the issuer distinguished names.voidsetMaxCRLNumber(BigInteger maxCRL)Sets the criterion for the maximum CRL number.voidsetMinCRLNumber(BigInteger minCRL)Sets the criterion for the minimum CRL number.StringtoString()Returns a string representation of thisX509CRLSelectorinstance.
-
Constructor Details
-
X509CRLSelector
public X509CRLSelector()Creates a newX509CertSelector.
-
-
Method Details
-
setIssuers
Sets the criterion for the issuer distinguished names.The CRL issuer must match at least one of the specified distinguished names.
- Parameters:
issuers- the list of issuer distinguished names to match, ornullif any issuer distinguished name will do.
-
setIssuerNames
Do not use: usesetIssuers(Collection)or one ofaddIssuerName(java.lang.String)instead. Sets the criterion for the issuer distinguished names.The CRL issuer must match at least one of the specified distinguished names.
The specified parameter
namesis a collection with an entry for each name to be included in the criterion. The name is specified as aStringor a byte array specifying the name (in RFC 2253 or ASN.1 DER encoded form)- Parameters:
names- the list of issuer distinguished names to match, ornullif any issuer distinguished name will do.- Throws:
IOException- if parsing fails.
-
addIssuer
Adds an issuer to the criterion for the issuer distinguished names.The CRL issuer must match at least one of the specified distinguished names.
- Parameters:
issuer- the issuer to add to the criterion
-
addIssuerName
Do not use:, useaddIssuer(X500Principal)oraddIssuerName(byte[])instead. It can fail to match some CRLs because of a loss of encoding information in a RFC 2253 string.Adds an issuer to the criterion for the issuer distinguished names. The CRK issuer must match at least one of the specified distinguished names.
- Parameters:
iss_name- the RFC 2253 encoded name.- Throws:
IOException- if parsing fails.
-
addIssuerName
Adds an issuer to the criterion for the issuer distinguished names.The CRL issuer must match at least one of the specified distinguished names.
- Parameters:
iss_name- the issuer to add to the criterion in ASN.1 DER encoded form.- Throws:
IOException- if parsing fails.
-
setMinCRLNumber
Sets the criterion for the minimum CRL number.The CRL must have a number extension with a value greater than or equal to the specified parameter.
- Parameters:
minCRL- the minimum CRL number or null to not check the minimum CRL number
-
setMaxCRLNumber
Sets the criterion for the maximum CRL number.The CRL must have a number extension with a value less than or equal to the specified parameter.
- Parameters:
maxCRL- the maximum CRL number or null to not check the maximum CRL number.
-
setDateAndTime
Sets the criterion for the CRL update period.The CRL's
thisUpdatevalue must be equal or before the specified date and thenextUpdatevalue must be after the specified date.- Parameters:
dateAndTime- the date to search for valid CRL's ornullto not check the date.
-
setCertificateChecking
Sets a certificate hint to find CRLs. It's not a criterion but may help finding relevant CRLs.- Parameters:
cert- the certificate hint ornull.
-
getIssuers
Returns the criterion for the issuer distinguished names.The CRL issuer must match at least one of the distinguished names.
- Returns:
- the unmodifiable list of issuer distinguished names to match, or
nullif any issuer distinguished name will do.
-
getIssuerNames
Returns the criterion for the issuer distinguished names.The CRL issuer must match at least one of the distinguished names.
- Returns:
- a copy of the list of issuer distinguished names to
match, or
nullif any issuer distinguished name will do. The elements may be strings or ASN.1 DER encoded byte arrays.
-
getMinCRL
Returns the criterion for the minimum CRL number.The CRL must have a number extension with a value greater than or equal to the returned value.
- Returns:
- the minimum CRL number or
nullif the minimum CRL number is not to be checked.
-
getMaxCRL
Returns the criterion for the maximum CRL number.The CRL must have a number extension with a value less than or equal to the returned value.
- Returns:
- the maximum CRL number or null if the maximum CRL number is not checked.
-
getDateAndTime
Returns the criterion for the CRL update period.The CRL's
thisUpdatevalue must be equal or before the returned date and thenextUpdatevalue must be after the returned date.- Returns:
- the date to search for valid CRL's or
nullif the date is not checked.
-
getCertificateChecking
Returns the certificate hint to find CRLs. It's not a criterion but may help finding relevant CRLs.- Returns:
- the certificate hint or
nullif none set.
-
toString
Returns a string representation of thisX509CRLSelectorinstance. -
match
Returns whether the specified CRL matches all the criteria collected in this instance.- Specified by:
matchin interfaceCRLSelector- Parameters:
crl- the CRL to check.- Returns:
trueif the CRL matches all the criteria, otherwisefalse.
-
clone
Clones thisX509CRLinstance.- Specified by:
clonein interfaceCRLSelector- Overrides:
clonein classObject- Returns:
- the cloned instance.
-