type = SecConst.USER_ROOTCA;
type = SecConst.CERTTYPE_ROOTCA;
    public void execute() throws IllegalAdminCommandException, ErrorAdminCommandException {        try {            System.out.println("Initializing CA");            // First get and publish CA certificates            Context context = getInitialContext();            ISignSessionHome signhome = (ISignSessionHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("RSASignSession"), ISignSessionHome.class);            ISignSessionRemote sign = signhome.create();            Certificate[] certs = sign.getCertificateChain(administrator);            initCertificateStore();            for (int j=0;j<certs.length;j++) {                X509Certificate cert = (X509Certificate)certs[j];                String cafingerprint = null;                int type = SecConst.USER_CA;                if ( (!CertTools.isSelfSigned(cert)) && ((j+1) < certs.length) )                    cafingerprint = CertTools.getFingerprintAsString((X509Certificate)certs[j+1]);                else {                    cafingerprint = CertTools.getFingerprintAsString(cert);                    type = SecConst.USER_ROOTCA;                }                try {                    // We will get an exception if the entity already exist                    certificateStore.storeCertificate(administrator, cert, "cainit", cafingerprint, CertificateData.CERT_ACTIVE, type);                } catch (java.rmi.ServerException e) {                    System.out.println("Certificate for subject '"+cert.getSubjectDN()+"' already exist in the certificate store.");                }                for (int i=0;i<publishers.size();i++) {                    boolean ret = ((IPublisherSessionRemote)(publishers.get(i))).storeCertificate(administrator, cert, "cainit", cafingerprint, CertificateData.CERT_ACTIVE, type);                    if (ret == true)                        System.out.println("Published certificate in publisher no "+i+1);                    else                        System.out.println("Failed to publish certificate in publisher no "+i+1);                }                System.out.println("-Stored CA certificates in certificate store(s).");            }            // Second create (and publish) CRL            createCRL();            System.out.println("-Created and published initial CRL.");            System.out.println("CA initialized");        } catch (Exception e) {            throw new ErrorAdminCommandException(e);        }    } // execute