debug("An error occured: ", e);
    public void execute() throws IllegalAdminCommandException, ErrorAdminCommandException {        // Create new CA.        if (args.length < 6) {           String msg = "Used to create a Root CA.";           msg += "\nUsage: CA init <caname> <dn> <keysize> <validity-days> <policyID>";           msg += "\npolicyId can be 'null' if no Certificate Policy extension should be present, or\nobjectID as '2.5.29.32.0'.";           throw new IllegalAdminCommandException(msg);        }                    try {             	            String caname = args[1];            String dn = CertTools.stringToBCDNString(args[2]);            dn = StringTools.strip(dn);            int keysize = Integer.parseInt(args[3]);            int validity = Integer.parseInt(args[4]);            String policyId = args[5];            if (policyId.equals("null"))              policyId = null;                          System.out.println("Initializing CA");                        Context context = getInitialContext();            ICAAdminSessionHome caadminsessionhome = (ICAAdminSessionHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("CAAdminSession"), ICAAdminSessionHome.class);            ICAAdminSessionRemote caadminsession = caadminsessionhome.create();                        System.out.println("Generating rootCA keystore:");            System.out.println("DN: "+dn);            System.out.println("Keysize: "+keysize);            System.out.println("Validity (days): "+validity);            System.out.println("Policy ID: "+policyId);                                        initAuthorizationModule(dn.hashCode());                                   SoftCATokenInfo catokeninfo = new SoftCATokenInfo();            catokeninfo.setKeySize(keysize);            catokeninfo.setAlgorithm(SoftCATokenInfo.KEYALGORITHM_RSA);            catokeninfo.setSignatureAlgorithm(CATokenInfo.SIGALG_SHA_WITH_RSA);            // Create and active OSCP CA Service.            ArrayList extendedcaservices = new ArrayList();            extendedcaservices.add(              new OCSPCAServiceInfo(ExtendedCAServiceInfo.STATUS_ACTIVE,                                    "CN=OCSPSignerCertificate, " + dn,                                    "",                                    2048,                                    OCSPCAServiceInfo.KEYALGORITHM_RSA));                                      X509CAInfo cainfo = new X509CAInfo(dn,                                              caname, SecConst.CA_ACTIVE,                                             "", SecConst.CERTPROFILE_FIXED_ROOTCA,                                             validity,                                              null, // Expiretime                                                                                          CAInfo.CATYPE_X509,                                             CAInfo.SELFSIGNED,                                             (Collection) null,                                             catokeninfo,                                             "Initial CA",                                             -1, null,                                             policyId, // PolicyId                                             24, // CRLPeriod                                             (Collection) new ArrayList(),                                             true, // Authority Key Identifier                                             false, // Authority Key Identifier Critical                                             true, // CRL Number                                             false, // CRL Number Critical                                             true, // Finish User                                             extendedcaservices);                                 System.out.println("Creating CA...");            caadminsession.createCA(administrator, cainfo);                        int caid = caadminsession.getCAInfo(administrator, caname).getCAId();            System.out.println("CAId for created CA: " + caid);                          System.out.println("-Created and published initial CRL.");            System.out.println("CA initialized");        } catch (Exception e) {            throw new ErrorAdminCommandException(e);        }    } // execute