com.distrimind.bouncycastle.jce.provider.OcspCache Maven / Gradle / Ivy
package com.distrimind.bouncycastle.jce.provider;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.ref.WeakReference;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.security.cert.CertPathValidatorException;
import java.security.cert.Extension;
import java.security.cert.X509Certificate;
import java.text.ParseException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import com.distrimind.bouncycastle.asn1.ocsp.Signature;
import com.distrimind.bouncycastle.asn1.ASN1EncodableVector;
import com.distrimind.bouncycastle.asn1.ASN1GeneralizedTime;
import com.distrimind.bouncycastle.asn1.ASN1ObjectIdentifier;
import com.distrimind.bouncycastle.asn1.ASN1OctetString;
import com.distrimind.bouncycastle.asn1.ASN1Sequence;
import com.distrimind.bouncycastle.asn1.DERSequence;
import com.distrimind.bouncycastle.asn1.ocsp.BasicOCSPResponse;
import com.distrimind.bouncycastle.asn1.ocsp.CertID;
import com.distrimind.bouncycastle.asn1.ocsp.OCSPObjectIdentifiers;
import com.distrimind.bouncycastle.asn1.ocsp.OCSPRequest;
import com.distrimind.bouncycastle.asn1.ocsp.OCSPResponse;
import com.distrimind.bouncycastle.asn1.ocsp.OCSPResponseStatus;
import com.distrimind.bouncycastle.asn1.ocsp.Request;
import com.distrimind.bouncycastle.asn1.ocsp.ResponseBytes;
import com.distrimind.bouncycastle.asn1.ocsp.ResponseData;
import com.distrimind.bouncycastle.asn1.ocsp.SingleResponse;
import com.distrimind.bouncycastle.asn1.ocsp.TBSRequest;
import com.distrimind.bouncycastle.asn1.x509.Extensions;
import com.distrimind.bouncycastle.jcajce.PKIXCertRevocationCheckerParameters;
import com.distrimind.bouncycastle.jcajce.util.JcaJceHelper;
import com.distrimind.bouncycastle.util.io.Streams;
class OcspCache
{
private static final int DEFAULT_TIMEOUT = 15000;
private static final int DEFAULT_MAX_RESPONSE_SIZE = 32 * 1024;
private static Map>> cache
= Collections.synchronizedMap(new WeakHashMap>>());
static OCSPResponse getOcspResponse(
CertID certID, PKIXCertRevocationCheckerParameters parameters,
URI ocspResponder, X509Certificate responderCert, List ocspExtensions,
JcaJceHelper helper)
throws CertPathValidatorException
{
Map responseMap = null;
WeakReference
© 2015 - 2025 Weber Informatics LLC | Privacy Policy