public class ArchiveCRLCache extends RevocationStore
An archive CRL cache provided the ability to read and write from Entrust's
.CRL and .ARL file formats. These files both
represent archives are CRLs and ARLs respectively.
This class can be used in two main ways. It can be used as a
RevocationStore object, providing access to revocation lists
that could not be retrieved otherwise after a user has logged in with
no Directory connection, for example. In this case, the archive CRL cache
must first be initialized and then added to the user's collection of
revocation stores. This can be done as follows:
ValidationInfo validationInfo = user.getCertVerifier();
ArchiveCRLCache archiveCrlCache = new ArchiveCRLCache(inputStream, validationInfo);
user.getRevocationStore().attach(archiveCrlCache);
It can also be used to provide persistent storage of all CRLs in a user's
memory CRL cache. To do this, before the application terminates, call
addMemoryCache to store all CRLs currently held in the user's
memory CRL cache in the archive CRL cache, and then call write
to store archive CRL cache to a persistent location (disk). Then, when
the application is run again, after the user has logged in, all the CRLs in
the archive CRL cache can be loaded back into the user's memory CRL cache
by calling initMemoryCache(com.entrust.toolkit.x509.revocation.CachedCRLRS). In this case, the archive does not
need to be attached to the user's collection of revocation stores..
| Modifier and Type | Field and Description |
|---|---|
static int |
ARL_ONLY
Specifies that only ARLs should be written during a write operation.
|
static int |
CRL_AND_ARL
Specifies that both CRLs and ARLs should be written during a write
operation.
|
static int |
CRL_ONLY
Specifies that only CRLs should be written during a write operation.
|
m_enableOfflineLookup, m_validationInfo| Constructor and Description |
|---|
ArchiveCRLCache(java.io.InputStream is,
ValidationInfo validationInfo)
The constructor; creates a new
ArchiveCRLCache object
initializing it with data read from the provided input stream. |
ArchiveCRLCache(ValidationInfo validationInfo)
The constructor; creates a new empty
ArchiveCRLCache object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCRL(DistPointAndCRL dpcrl)
Adds the CRL to the archive CRL cache.
|
void |
addCRLs(DistPointAndCRL[] dpcrls)
Adds the CRLs to the archive CRL cache.
|
void |
addMemoryCache(CachedCRLRS memoryCrlCache)
Adds all the CRLs contained in the provided memory CRL cache to this archive
CRL cache.
|
void |
cleanup()
Removes all expired CRLs from this archive CRL cache.
|
protected GeneralName |
getCrlsByType(java.util.Collection crls,
CRLType crlType,
GeneralNames dpDistributionPoint)
Retrieves all CRLs of the indicated type that exist at the indicated
distrubution point.
|
protected java.lang.String |
getName()
Returns the name of this X.509 CRL revocation store.
|
void |
initMemoryCache(CachedCRLRS memoryCrlCache)
Adds the CRLs contained in this archive CRL cache to the provided memory
CRL cache.
|
void |
parse(java.io.InputStream inputStream)
Parses an input stream containing an archive CRL cache in Entrust revocation
list cache format.
|
void |
removeCRL(ASN1Type distributionPointName)
Removes all CRLs contained in the archive CRL cache under the indicated
distribution point.
|
void |
write(java.io.OutputStream outputStream,
int writeMode)
Writes the acrhive CRL cache to an output stream in Entrust revocation list
cache format.
|
enableOfflineLookuppublic static final int CRL_ONLY
public static final int ARL_ONLY
public static final int CRL_AND_ARL
public ArchiveCRLCache(ValidationInfo validationInfo)
ArchiveCRLCache object.
Following creation, the archive CRL cache is empty, it does not contain any
CRLs. CRLs can be manually added using the add APIs, or
CRLs can be loaded from an archive cache file using the parse
API.
validationInfo - the validation information that will be used during the validation of
the CRLs this CRL revocation store contains.public ArchiveCRLCache(java.io.InputStream is,
ValidationInfo validationInfo)
throws UserFatalException
ArchiveCRLCache object
initializing it with data read from the provided input stream.
Following creation, CRLs are automatically loaded into the CRL archive
cache by parsing them from the input stream. The input stream must
represent a valid CRL archive cache format; this is Entrust's
.CRL or .ARL file format.
validationInfo - the validation information that will be used during the validation of
the CRLs this CRL revocation store contains.UserFatalException - if there is an error parsing the data in input streampublic void addCRL(DistPointAndCRL dpcrl)
The CRL is added under the distribution point from which it was originally retrieved.
dpcrl - the CRL and the distribution point from which it was retrievedpublic void addCRLs(DistPointAndCRL[] dpcrls)
The CRLs are added under the distribution point from which each was originally retrieved.
dpcrls - the CRLs and the distribution points from which they were retrievedpublic void addMemoryCache(CachedCRLRS memoryCrlCache)
memoryCrlCache - the memory CRL cachepublic void cleanup()
A CRL is considered to have expired if the current time/date is not before the next update time/date, taking into account the CRL grace period from the client settings.
public void initMemoryCache(CachedCRLRS memoryCrlCache)
CRLs that exist in the archive CRL cache and have expired are not added to the memory CRL cache. A CRL is considered to have expired if the current time/date is not before the next update time/date (or expiry time/date), taking into account the CRL grace period from the client settings.
memoryCrlCache - the memory CRL cachepublic void parse(java.io.InputStream inputStream)
throws UserFatalException
All CRLs found in input stream are added to this archive CRL cache.
Typically, an archive CRL cache in Entrust revocation list cache format is
contained in files with a .CRL or .ARL extension.
inputStream - an input stream containing an archive CRL cache in Entrust revocation
list formatUserFatalException - if an error occurs while parsing the data contained in the input
stream; indicates an improperly formatted Entrust revocation list cachepublic void removeCRL(ASN1Type distributionPointName)
CRLs contained in an archive CRL cache, unlike those contained in a memory CRL cache, are not automatically removed when they expire. This method provides a way to remove all CRLs contained in the cache under a specific distribution point.
distributionPointName - the name of the distribution point under which all CRLs contained
in the archive CRL cache are to be removedpublic void write(java.io.OutputStream outputStream,
int writeMode)
throws java.lang.IllegalArgumentException,
java.security.cert.CRLException
The output stream is not closed by this API, it is up to the caller to do so when appropriate. The write mode gives the caller control over which types of RLs are written. The following modes are permitted:
CRL_ONLY only write CRLs (RLs that only contain
revocation information about user certificates)ARL_ONLY only write ARLs (RLs that only contain
revocation information about CA certificates)CRL_AND_ARL write both CRLs and ARLs.outputStream - the output stream the archive CRL cache will be written towriteMode - allows the caller to control which types of CRLs are writtenjava.lang.IllegalArgumentException - if the write mode is not permittedjava.security.cert.CRLException - thrown in the error occurred while DER encoding one of the CRL
contained in the archive CRL cacheprotected GeneralName getCrlsByType(java.util.Collection crls, CRLType crlType, GeneralNames dpDistributionPoint)
getCrlsByType in class RevocationStorecrls - a collection of X.509 CRLs in InternalX509CRL format; all
retrieved CRLs will be added to this collectioncrlType - the type of CRLs to be loadeddpDistributionPoint - the distribution point in GeneralNames format from which
the CRLs will be loadedGeneralName representation of the distribution point
name the CRLs were loaded from if any were in fact loaded;
null otherwiseprotected java.lang.String getName()
getName in class RevocationStore