code: public static void newCertificateRevocationList(File caRevocationList, File caKeystoreFile, String caKeystorePassword) {
          try {
              // read the Fathom CA key and certificate
              KeyStore store = openKeyStore(caKeystoreFile, caKeystorePassword);
              PrivateKey caPrivateKey = (PrivateKey) store.getKey(CA_ALIAS, caKeystorePassword.toCharArray());
              X509Certificate caCert = (X509Certificate) store.getCertificate(CA_ALIAS);
  
              X500Name issuerDN = new X500Name(PrincipalUtil.getIssuerX509Principal(caCert).getName());
              X509v2CRLBuilder crlBuilder = new X509v2CRLBuilder(issuerDN, new Date());
  
              // build and sign CRL with CA private key
              ContentSigner signer = new JcaContentSignerBuilder(SIGNING_ALGORITHM).setProvider(BC).build(caPrivateKey);
              X509CRLHolder crl = crlBuilder.build(signer);
  
              File tmpFile = new File(caRevocationList.getParentFile(), Long.toHexString(System.currentTimeMillis()) + ".tmp");
              FileOutputStream fos = null;
              try {
                  fos = new FileOutputStream(tmpFile);
                  fos.write(crl.getEncoded());
                  fos.flush();
                  fos.close();
                  if (caRevocationList.exists()) {
                      caRevocationList.delete();
                  }
                  tmpFile.renameTo(caRevocationList);
              } finally {
                  if (fos != null) {
                      fos.close();
                  }
                  if (tmpFile.exists()) {
                      tmpFile.delete();
                  }
              }
          } catch (Exception e) {
              throw new RuntimeException("Failed to create new certificate revocation list " + caRevocationList, e);
          }
      }
docs: Creates a new certificate revocation list (CRL).  This function will
  destroy any existing CRL file.
  
  @param caRevocationList
  @param caKeystoreFile
  @param caKeystorePassword
  @return