CertTemplate myCertTemplate = new CertTemplate();
myCertTemplate.setIssuer(new X509Name(issuerDN));
myCertTemplate.setSubject(new X509Name(userDN));
myCertTemplate.setSerialNumber(new DERInteger(serNo));
RevDetails myRevDetails = new RevDetails(myCertTemplate);
ReasonFlags reasonbits = new ReasonFlags(ReasonFlags.keyCompromise);
myRevDetails.setRevocationReason(reasonbits);
if (crlEntryExtension) {
CRLReason crlReason = new CRLReason(CRLReason.cessationOfOperation);
X509Extension ext = new X509Extension(false, new DEROctetString(crlReason.getEncoded()));
Hashtable<DERObjectIdentifier, X509Extension> ht = new Hashtable<DERObjectIdentifier, X509Extension>();
ht.put(X509Extensions.ReasonCode, ext);
myRevDetails.setCrlEntryDetails(new X509Extensions(ht));
}
RevReqContent myRevReqContent = new RevReqContent(myRevDetails);
PKIHeader myPKIHeader = new PKIHeader(new DERInteger(2), new GeneralName(new X509Name(userDN)), new GeneralName(new X509Name(((X509Certificate)cacert).getSubjectDN()