/** * Gets an OCSP response online and returns it if the status is GOOD * (without further checking). * @param signCert the signing certificate * @param issuerCert the issuer certificate * @return an OCSP response */ virtual public BasicOcspResp GetOcspResponse(X509Certificate signCert, X509Certificate issuerCert) { if (signCert == null && issuerCert == null) { return(null); } OcspClientBouncyCastle ocsp = new OcspClientBouncyCastle(); BasicOcspResp ocspResp = ocsp.GetBasicOCSPResp(signCert, issuerCert, null); if (ocspResp == null) { return(null); } SingleResp[] resp = ocspResp.Responses; for (int i = 0; i < resp.Length; ++i) { Object status = resp[i].GetCertStatus(); if (status == CertificateStatus.Good) { return(ocspResp); } } return(null); }
/** * Gets an OCSP response online and returns it if the status is GOOD * (without further checking). * @param signCert the signing certificate * @param issuerCert the issuer certificate * @return an OCSP response */ public BasicOcspResp GetOcspResponse(X509Certificate signCert, X509Certificate issuerCert) { if (signCert == null && issuerCert == null) { return null; } OcspClientBouncyCastle ocsp = new OcspClientBouncyCastle(); BasicOcspResp ocspResp = ocsp.GetBasicOCSPResp(signCert, issuerCert, null); if (ocspResp == null) { return null; } SingleResp[] resp = ocspResp.Responses; for (int i = 0; i < resp.Length; ++i) { Object status = resp[i].GetCertStatus(); if (status == CertificateStatus.Good) { return ocspResp; } } return null; }