public byte[] generateCrlReq(String dn, String transactionId, X509Certificate ca) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException, SignatureException, IOException, CMSException, InvalidAlgorithmParameterException, CertStoreException, CertificateEncodingException, IllegalStateException {
this.cacert = ca;
this.reqdn = dn;
X509Name name = CertTools.stringToBcX509Name(cacert.getIssuerDN().getName());
IssuerAndSerialNumber ias = new IssuerAndSerialNumber(name, cacert.getSerialNumber());
// Create self signed cert, validity 1 day
cert = CertTools.genSelfCert(reqdn,24*60*60*1000,null,keys.getPrivate(),keys.getPublic(),AlgorithmConstants.SIGALG_SHA1_WITH_RSA,false);
// wrap message in pkcs#7
byte[] msg = wrap(ias.getEncoded(), "22", transactionId);
return msg;
}