OCSPReq req = gen.generate("SHA1WithRSA", keys.getPrivate(), chain, "BC");
// First test with a signed OCSP request that can be verified
Collection<Certificate> cacerts = new ArrayList<Certificate>();
cacerts.add(cacert);
ICertificateCache certcache = CertificateCacheTstFactory.getInstance(cacerts);
X509Certificate signer = OCSPUtil.checkRequestSignature("127.0.0.1", req, certcache);
assertNotNull(signer);
assertEquals(ocspTestCert.getSerialNumber().toString(16), signer.getSerialNumber().toString(16));
// Try with an unsigned request, we should get a SignRequestException