builder.addExtension(X509Extension.authorityKeyIdentifier, false, authorityKeyIdentifier);
builder.addExtension(X509Extension.cRLNumber, false, new CRLNumber(bcRequest.getNumber()));
if (bcRequest.getOldCrl() != null) {
X509CRLHolder current = new X509CRLHolder(bcRequest.getOldCrl());
builder.addCRL(current);
}
PrivateKey privateKey = bcRequest.getIssuerPrivateKey();
JcaContentSignerBuilder contentSignerBuilder = new JcaContentSignerBuilder(bcRequest.getSignAlgorithm());
contentSignerBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
ContentSigner contentSigner = contentSignerBuilder.build(privateKey);
for (CRLEntry entry : bcRequest.getEntries()) {
builder.addCRLEntry(entry.getSerialNumber(), entry.getDate(), entry.getReason().getCode());
}
X509CRLHolder crlh = builder.build(contentSigner);
JcaX509CRLConverter crlConverter = new JcaX509CRLConverter();
crlConverter.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
X509CRL crl = crlConverter.getCRL(crlh);