public class OCSPResponsesCache extends OCSPCacheBase
Modifier and Type | Class and Description |
---|---|
private static class |
OCSPResponsesCache.ResponseCacheEntry |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,OCSPResponsesCache.ResponseCacheEntry> |
responsesCache |
ASCII, diskPath, maxTtl, prefix
Constructor and Description |
---|
OCSPResponsesCache(long maxTtl,
java.io.File diskPath,
java.lang.String prefix) |
Modifier and Type | Method and Description |
---|---|
void |
addToCache(java.lang.String key,
OCSPResponseStructure fullResp,
org.bouncycastle.cert.ocsp.SingleResp singleResp) |
void |
clearMemoryCache() |
java.lang.String |
createResponseKey(java.security.cert.X509Certificate toCheckCert,
java.security.cert.X509Certificate issuerCert) |
org.bouncycastle.cert.ocsp.SingleResp |
getCachedResp(java.lang.String responseKey,
OCSPClientImpl client,
java.security.cert.X509Certificate toCheckCert,
java.security.cert.X509Certificate issuerCert) |
private OCSPResponsesCache.ResponseCacheEntry |
loadResponseFromDisk(java.io.File f,
OCSPClientImpl client,
java.security.cert.X509Certificate toCheckCert,
java.security.cert.X509Certificate issuerCert) |
private void |
storeResponseToDisk(java.io.File f,
OCSPResponseStructure fullResp) |
encodeDigest
private java.util.Map<java.lang.String,OCSPResponsesCache.ResponseCacheEntry> responsesCache
public OCSPResponsesCache(long maxTtl, java.io.File diskPath, java.lang.String prefix)
maxTtl
- maximum time after each cached response expires. Negative for no cache at all, 0 for no limit
(i.e. caching time will be only controlled by the OCSP response validity period). In ms.diskPath
- if not null, cached responses will be stored on disk.prefix
- used if disk cache is enabled, as a common prefix for all files created in the cache directory.public org.bouncycastle.cert.ocsp.SingleResp getCachedResp(java.lang.String responseKey, OCSPClientImpl client, java.security.cert.X509Certificate toCheckCert, java.security.cert.X509Certificate issuerCert) throws java.io.IOException
responseKey
- response keyclient
- OCSP clienttoCheckCert
- mandatory certificate to be checkedissuerCert
- mandatory certificate of the toCheckCert issuerjava.io.IOException
- IO exceptionpublic java.lang.String createResponseKey(java.security.cert.X509Certificate toCheckCert, java.security.cert.X509Certificate issuerCert)
public void addToCache(java.lang.String key, OCSPResponseStructure fullResp, org.bouncycastle.cert.ocsp.SingleResp singleResp) throws java.io.IOException
java.io.IOException
public void clearMemoryCache()
private void storeResponseToDisk(java.io.File f, OCSPResponseStructure fullResp) throws java.io.IOException
java.io.IOException
private OCSPResponsesCache.ResponseCacheEntry loadResponseFromDisk(java.io.File f, OCSPClientImpl client, java.security.cert.X509Certificate toCheckCert, java.security.cert.X509Certificate issuerCert)