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));
}