GetBasicOCSPResp() public method

public GetBasicOCSPResp ( X509Certificate checkCert, X509Certificate rootCert, String url ) : BasicOcspResp
checkCert Org.BouncyCastle.X509.X509Certificate
rootCert Org.BouncyCastle.X509.X509Certificate
url String
return Org.BouncyCastle.Ocsp.BasicOcspResp
Beispiel #1
0
        /**
         * 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);
        }
Beispiel #2
0
	    /**
	     * 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;
	    }