try { if (args.length < 2) { System.out.println("Usage: CA getcrl <outfile>"); return; } String outfile = args[1]; Context context = getInitialContext(); ICertificateStoreSessionHome storehome = (ICertificateStoreSessionHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("CertificateStoreSession"), ICertificateStoreSessionHome.class); ICertificateStoreSessionRemote store = storehome.create(administrator); byte[] crl = store.getLastCRL(); FileOutputStream fos = new FileOutputStream(outfile); fos.write(crl); fos.close(); System.out.println("Wrote latest CRL to " + outfile+ "."); } catch (Exception e) { throw new ErrorAdminCommandException(e); }
if (args.length < 2) { throw new IllegalAdminCommandException("Usage: CA getcrl <outfile>"); } try { String outfile = args[1]; Context context = getInitialContext(); ICertificateStoreSessionHome storehome = (ICertificateStoreSessionHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("CertificateStoreSession"),ICertificateStoreSessionHome.class); ICertificateStoreSessionRemote store = storehome.create(administrator); byte[] crl = store.getLastCRL(); FileOutputStream fos = new FileOutputStream(outfile); fos.write(crl); fos.close(); System.out.println("Wrote latest CRL to " + outfile + "."); } catch (Exception e) { throw new ErrorAdminCommandException(e); }
    public void execute() throws IllegalAdminCommandException, ErrorAdminCommandException {        try {            if (args.length < 2) {                System.out.println("Usage: CA getcrl <outfile>");                return;            }            String outfile = args[1];            Context context = getInitialContext();            ICertificateStoreSessionHome storehome = (ICertificateStoreSessionHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("CertificateStoreSession"), ICertificateStoreSessionHome.class);            ICertificateStoreSessionRemote store = storehome.create(administrator);            byte[] crl = store.getLastCRL();            FileOutputStream fos = new FileOutputStream(outfile);            fos.write(crl);            fos.close();            System.out.println("Wrote latest CRL to " + outfile+ ".");        } catch (Exception e) {            throw new ErrorAdminCommandException(e);        }    } // execute