code: public RevocationStatus checkRevocationStatus(X509Certificate peerCert, X509Certificate issuerCert)
              throws CertificateVerificationException {
  
          //check cache. Check inside the cache, before calling CA.
          if (cache != null) {
              SingleResp resp = cache.getCacheValue(peerCert.getSerialNumber());
              if (resp != null) {
                  //If cant be casted, we have used the wrong cache.
                  RevocationStatus status = getRevocationStatus(resp);
                  if (LOG.isInfoEnabled()) {
                      LOG.info("OCSP response taken from cache.");
                  }
                  return status;
              }
          }
  
          OCSPReq request = generateOCSPRequest(issuerCert, peerCert.getSerialNumber());
          List<String> locations = getAIALocations(peerCert);
          OCSPResp ocspResponse = null;
          for (String serviceUrl : locations) {
  
              SingleResp[] responses;
              try {
                  ocspResponse = getOCSPResponce(serviceUrl, request);
                  if (OCSPResponseStatus.SUCCESSFUL != ocspResponse.getStatus()) {
                      continue; // Server didn't give the correct response.
                  }
  
                  BasicOCSPResp basicResponse = (BasicOCSPResp) ocspResponse.getResponseObject();
                  responses = (basicResponse == null) ? null : basicResponse.getResponses();
              } catch (Exception e) {
                  continue;
              }
  
              if (responses != null && responses.length == 1) {
                  SingleResp resp = responses[0];
                  RevocationStatus status = getRevocationStatus(resp);
                  if (cache != null) {
                      cache.setCacheValue(ocspResponse, peerCert.getSerialNumber(), resp, request, serviceUrl);
                  }
                  return status;
              }
          }
          throw new CertificateVerificationException("Could not get revocation status from OCSP.");
      }
docs: Gets the revocation status (Good, Revoked or Unknown) of the given peer certificate.
  
  @param peerCert The certificate that needs to be validated.
  @param issuerCert Needs to create OCSP request.
  @return Revocation status of the peer certificate.
  @throws CertificateVerificationException Occurs when it fails to verify the ocsp status of certificate.