code: private boolean verifySignature(X509Certificate cert)
          throws CertPathValidatorException {
  
          try {
              Signature respSignature = Signature.getInstance(sigAlgId.getName());
              respSignature.initVerify(cert.getPublicKey());
              respSignature.update(tbsResponseData);
  
              if (respSignature.verify(signature)) {
                  if (debug != null) {
                      debug.println("Verified signature of OCSP Response");
                  }
                  return true;
  
              } else {
                  if (debug != null) {
                      debug.println(
                          "Error verifying signature of OCSP Response");
                  }
                  return false;
              }
          } catch (InvalidKeyException | NoSuchAlgorithmException |
                   SignatureException e)
          {
              throw new CertPathValidatorException(e);
          }
      }
docs: /*
  Verify the signature of the OCSP response.