public class RevocationTrustCache extends java.lang.Object implements RevocationChecker
setTrustInterval(int) method.
the certificate is trusted if it meets the following criteria:
(CurrentTime - EntryTime) > trust interval
CurrentTime is the current time, Entry time is the point in time which the certificate was added into the cache.
The object should be used in conjunction with the RevocationManager
RevocationManager,
RevocationChecker| Modifier and Type | Field and Description |
|---|---|
static int |
TWENTYFOURHOURS
The value of 24 hours in seconds
|
LOG| Constructor and Description |
|---|
RevocationTrustCache(int seconds)
Creates a new RevocationTrustCache which will be used to trust the revocation status
of a certificate for the number of seconds supplied
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCertificate(X509Certificate cert)
Add a certificate into the RevocationTrustCache
|
void |
check(X509Certificate cert)
Convienance method for checking revocation of a signle certificate
|
void |
check(X509Certificate[] chain)
Checks whether all certificates contained in the chain are in the
RevocationTrustCache.
|
void |
check(X509Certificate cert,
X509Certificate[] chain)
Checks whether the given certificate is in the RevocationTrustCache.
|
void |
check(X509Certificate cert,
X509Certificate[] chain,
int position)
This method does not need to use the position of certificate in the chain.
|
void |
clearCache()
Clears the RevocationTrustCache
|
int |
getTrustInterval() |
void |
setTrustInterval(int seconds)
Sets the Trust interval to the given number of seconds.
|
public static final int TWENTYFOURHOURS
public RevocationTrustCache(int seconds)
seconds - The number of seconds that a certificate is trustedpublic void check(X509Certificate[] chain) throws CertificationException
check in interface RevocationCheckerchain - the certificate chain from the certificate to the rootCertificationException - if the Certificate is not contained in the RevocationTrustCache, or
the lifetime of the Certificate has expired.public void check(X509Certificate cert, X509Certificate[] chain) throws CertificationException
(CurrentTime - EntryTime) > seconds
CurrentTime is the current time
EntryTime is the time which the certificate was added into the Cache
Seconds in the number of seconds the Certificate is trusted
check in interface RevocationCheckercert - the certificate whose revocation status is being checkedchain - the certificate chain from the certificate to the root. Not used
by this method, so passing in null will have no ill effects.CertificationException - if the Certificate is not contained in the RevocationTrustCache, or
the trust interval of the Certificate has expired.public void addCertificate(X509Certificate cert)
cert - the certificate to be added into the cachepublic void setTrustInterval(int seconds)
seconds - The number of seconds the Revocation status of the certificate is validpublic int getTrustInterval()
public void check(X509Certificate cert, X509Certificate[] chain, int position) throws CertificationException
check in interface RevocationCheckercert - the certificate which revocation will be checkedchain - the certificate chainCertificationException - if revocation status could not be determinedpublic void check(X509Certificate cert) throws CertificationException
check in interface RevocationCheckercert - the certificate which revocation will be checkedCertificationException - if revocation status could not be determinedpublic void clearCache()