Class OCSPResponsesCache
- java.lang.Object
-
- eu.emi.security.authn.x509.helpers.ocsp.OCSPCacheBase
-
- eu.emi.security.authn.x509.helpers.ocsp.OCSPResponsesCache
-
public class OCSPResponsesCache extends OCSPCacheBase
OCSP responses cache: in memory with disk persistence.- Author:
- K. Benedyczak
-
-
Field Summary
-
Fields inherited from class eu.emi.security.authn.x509.helpers.ocsp.OCSPCacheBase
ASCII, diskPath, maxTtl, prefix
-
-
Constructor Summary
Constructors Constructor Description OCSPResponsesCache(long maxTtl, File diskPath, String prefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToCache(String key, OCSPResponseStructure fullResp, org.bouncycastle.cert.ocsp.SingleResp singleResp)
void
clearMemoryCache()
String
createResponseKey(X509Certificate toCheckCert, X509Certificate issuerCert)
org.bouncycastle.cert.ocsp.SingleResp
getCachedResp(String responseKey, OCSPClientImpl client, X509Certificate toCheckCert, X509Certificate issuerCert)
-
Methods inherited from class eu.emi.security.authn.x509.helpers.ocsp.OCSPCacheBase
encodeDigest
-
-
-
-
Constructor Detail
-
OCSPResponsesCache
public OCSPResponsesCache(long maxTtl, File diskPath, String prefix)
- Parameters:
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.
-
-
Method Detail
-
getCachedResp
public org.bouncycastle.cert.ocsp.SingleResp getCachedResp(String responseKey, OCSPClientImpl client, X509Certificate toCheckCert, X509Certificate issuerCert) throws IOException
- Parameters:
responseKey
- response keyclient
- OCSP clienttoCheckCert
- mandatory certificate to be checkedissuerCert
- mandatory certificate of the toCheckCert issuer- Returns:
- The cached response if available, null otherwise.
- Throws:
IOException
- IO exception
-
createResponseKey
public String createResponseKey(X509Certificate toCheckCert, X509Certificate issuerCert)
-
addToCache
public void addToCache(String key, OCSPResponseStructure fullResp, org.bouncycastle.cert.ocsp.SingleResp singleResp) throws IOException
- Throws:
IOException
-
clearMemoryCache
public void clearMemoryCache()
-
-