// "application/ocsp-response; charset=UTF-8"
assertNotNull(con.getContentType());
assertTrue(con.getContentType().startsWith("application/ocsp-response"));
OCSPResp response = new OCSPResp(new ByteArrayInputStream(OcspJunitHelper.inputStreamToBytes(con.getInputStream())));
assertEquals("Response status not the expected.", 0, response.getStatus());
BasicOCSPResp brep = (BasicOCSPResp) response.getResponseObject();
X509Certificate[] chain = brep.getCerts("BC");
boolean verify = brep.verify(chain[0].getPublicKey(), "BC");
assertTrue("Response failed to verify.", verify);
SingleResp[] singleResps = brep.getResponses();
assertEquals("No of SingResps should be 1.", 1, singleResps.length);
CertificateID certId = singleResps[0].getCertID();
assertEquals("Serno in response does not match serno in request.", certId.getSerialNumber(), ocspTestCert.getSerialNumber());
assertNull("Status is not null.", singleResps[0].getCertStatus());
Date thisUpdate = singleResps[0].getThisUpdate();
Date nextUpdate = singleResps[0].getNextUpdate();
Date producedAt = brep.getProducedAt();
assertNotNull("thisUpdate was not set.", thisUpdate);
assertNotNull("nextUpdate was not set. (This test requires ocsp.untilNextUpdate to be configured.)", nextUpdate);
assertNotNull("producedAt was not set.", producedAt);
assertTrue("nextUpdate cannot be before thisUpdate.", !nextUpdate.before(thisUpdate));
assertTrue("producedAt cannot be before thisUpdate.", !producedAt.before(thisUpdate));