// Generate the id for the certificate we are looking for
CertificateID id = new CertificateID(CertificateID.HASH_SHA1, issuerCert, serialNumber);
// basic request generation with nonce
OCSPReqGenerator gen = new OCSPReqGenerator();
gen.addRequest(id);
// create details for nonce extension
Vector<DERObjectIdentifier> oids = new Vector<DERObjectIdentifier>();
Vector<X509Extension> values = new Vector<X509Extension>();
oids.add(OCSPObjectIdentifiers.id_pkix_ocsp_nonce);
values.add(new X509Extension(false, new DEROctetString(new DEROctetString(PdfEncryption.createDocumentId()).getEncoded())));
gen.setRequestExtensions(new X509Extensions(oids, values));
return gen.generate();
}