public static RevocationStatus check(X509Certificate cert,X509Certificate issuerCert) throws IOException, CertPathValidatorException {
  CertId certId=null;
  URI responderURI=null;
  try {
    X509CertImpl certImpl=X509CertImpl.toImpl(cert);
    responderURI=getResponderURI(certImpl);
    if (responderURI == null) {
      throw new CertPathValidatorException("No OCSP Responder URI in certificate");
    }
    certId=new CertId(issuerCert,certImpl.getSerialNumberObject());
  }
 catch (  CertificateException|IOException e) {
    throw new CertPathValidatorException("Exception while encoding OCSPRequest",e);
  }
  OCSPResponse ocspResponse=check(Collections.singletonList(certId),responderURI,issuerCert,null,null,Collections.<Extension>emptyList());
  return (RevocationStatus)ocspResponse.getSingleResponse(certId);
}

public static RevocationStatus check ( X509Certificate cert , X509Certificate issuerCert ) throws IOException , CertPathValidatorException { CertId certId = null ; URI responderURI = null ; try { X509CertImpl certImpl = X509CertImpl . toImpl ( cert ) ; responderURI = getResponderURI ( certImpl ) ; if ( responderURI == null ) { throw new CertPathValidatorException ( "No OCSP Responder URI in certificate" ) ; } certId = new CertId ( issuerCert , certImpl . getSerialNumberObject ( ) ) ; } catch ( CertificateException | IOException e ) { throw new CertPathValidatorException ( "Exception while encoding OCSPRequest" , e ) ; } OCSPResponse ocspResponse = check ( Collections . singletonList ( certId ) , responderURI , issuerCert , null , null , Collections . < Extension > emptyList ( ) ) ; return ( RevocationStatus ) ocspResponse . getSingleResponse ( certId ) ; }
obtains the revocation status of a certificate using ocsp using the most common defaults . the ocsp responder uri is retrieved from the certificate ' s aia extension . the ocsp responder certificate is assumed to be the issuer ' s certificate ( or issued by the issuer ca ) .
