Examples of CertificationAuthority


Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

            if(value != null) response.setRenderParameter(params[i], value);
        }
        String sNo = request.getParameter("sNo");
        if(sNo == null) {
            // Freshly loading the certificate request details screen
            CertificationAuthority ca = getCertificationAuthority(request);
            try {
                sNo = ca.getNextSerialNumber().toString();
                response.setRenderParameter("sNo", sNo);
            } catch (Exception e) {
                log.error("Unable to get next serial number from CA.", e);
                portlet.addErrorMessage(request, portlet.getLocalizedString(request, "errorMsg21"), e.getMessage());
            }
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

        try {
            String password = request.getParameter("password");
            if(password == null) {
                throw new Exception("Password is null.");
            }
            CertificationAuthority ca = getCertificationAuthority(request);
            if(ca == null) {
                throw new Exception("CA is not running.  CA may not have been initialized.");
            }
            ca.unlock(password.toCharArray());

            // Return to CA's index page
            portlet.addInfoMessage(request, portlet.getLocalizedString(request, "infoMsg14"));
            log.info("CA has been unlocked successfully!");
            return INDEX_MODE+BEFORE_ACTION;
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

        return getMode();
    }

    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
        try {
            CertificationAuthority ca = getCertificationAuthority(request);
            if(ca == null) {
                throw new Exception("CA is not running. CA may not have been initialized.");
            }
            if(ca.isLocked()) {
                request.setAttribute("caLocked", Boolean.TRUE);
                throw new Exception("CA is locked.  Unlock CA to view details.");
            }
           
            // Get CA details
            Certificate caCert = ca.getCertificate();
            request.setAttribute("cert", caCert);
            request.setAttribute("highestSerial", ca.getHighestSerialNumber());
            request.setAttribute("certText", CaUtils.base64Certificate(caCert));
            PublicKey publickey = caCert.getPublicKey();
            String keySize = null;
            if(publickey instanceof RSAPublicKey) {
                keySize = ""+((RSAPublicKey)publickey).getModulus().bitLength();
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

            if(!request.getParameterMap().containsKey("sNo")) {
                // Show the page to get serial number of the certificate to be viewed
                request.setAttribute("sNo", null);
                return;
            }
            CertificationAuthority ca = getCertificationAuthority(request);
           
            String certText = ca.getCertificateBase64Text(new BigInteger(sNo.trim()));
            Certificate cert = ca.getCertificate(new BigInteger(sNo.trim()));
            PublicKey publickey = cert.getPublicKey();
            String keySize = null;
            if(publickey instanceof RSAPublicKey) {
                keySize = ""+((RSAPublicKey)publickey).getModulus().bitLength();
            }
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

            if(!request.getParameterMap().containsKey("sNo")) {
                // Show the page to get serial number of the certificate to be viewed
                request.setAttribute("sNo", null);
                return;
            }
            CertificationAuthority ca = getCertificationAuthority(request);
           
            String certText = ca.getCertificateBase64Text(new BigInteger(sNo.trim()));
            Certificate cert = ca.getCertificate(new BigInteger(sNo.trim()));
            PublicKey publickey = cert.getPublicKey();
            String keySize = null;
            if(publickey instanceof RSAPublicKey) {
                keySize = ""+((RSAPublicKey)publickey).getModulus().bitLength();
            }
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

            caKeystore.unlockPrivateKey(alias, password.toCharArray(), password.toCharArray());
           
            // Create CertificationAuthority, CertificateStore and CertificateRequestStore GBeans
            createCARelatedGBeans(request, (GeronimoManagedBean)caKeystore, defaultCAStoreDir, defaultCSRStoreDir);

            CertificationAuthority ca = getCertificationAuthority(request);
            ca.unlock(password.toCharArray());

            // Certificate validity and serial number.
            // Validity of these have been checked before loading the confirmation page.
            Date validFromDate = null, validToDate = null;
            DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
            validFromDate = df.parse(validFrom);
            validToDate = df.parse(validTo);
            BigInteger serialNum = new BigInteger(sNo);
           
            // Instruct the CA to issue a self-signed certificate.
            ca.issueOwnCertificate(serialNum, validFromDate, validToDate, algorithm);
            // Publish the CA's certificate to CertificateStore.
            getCertificateStore(request).storeCACertificate(ca.getCertificate());
           
            // CA Setup is succeessful.
            // Load a page to show CA details.
            portlet.addInfoMessage(request, portlet.getLocalizedString(request, "consolebase.infoMsg15"));
            log.info("CA Setup is successful.");
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

            if(value != null) response.setRenderParameter(params[i], value);
        }
        String sNo = request.getParameter("sNo");
        if(sNo == null) {
            // Freshly loading the certificate request details screen
            CertificationAuthority ca = getCertificationAuthority(request);
            try {
                sNo = ca.getNextSerialNumber().toString();
                response.setRenderParameter("sNo", sNo);
            } catch (Exception e) {
                log.error("Unable to get next serial number from CA.", e);
                portlet.addErrorMessage(request, portlet.getLocalizedString(request, "consolebase.errorMsg21"), e.getMessage());
            }
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

        try {
            String password = request.getParameter("password");
            if(password == null) {
                throw new Exception("Password is null.");
            }
            CertificationAuthority ca = getCertificationAuthority(request);
            if(ca == null) {
                throw new Exception("CA is not running.  CA may not have been initialized.");
            }
            ca.unlock(password.toCharArray());

            // Return to CA's index page
            portlet.addInfoMessage(request, portlet.getLocalizedString(request, "consolebase.infoMsg14"));
            log.info("CA has been unlocked successfully!");
            return INDEX_MODE+BEFORE_ACTION;
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

        return getMode();
    }

    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
        try {
            CertificationAuthority ca = getCertificationAuthority(request);
            if(ca == null) {
                throw new Exception("CA is not running. CA may not have been initialized.");
            }
            if(ca.isLocked()) {
                request.setAttribute("caLocked", Boolean.TRUE);
                throw new Exception("CA is locked.  Unlock CA to view details.");
            }
           
            // Get CA details
            Certificate caCert = ca.getCertificate();
            request.setAttribute("cert", caCert);
            request.setAttribute("highestSerial", ca.getHighestSerialNumber());
            request.setAttribute("certText", CaUtils.base64Certificate(caCert));
            PublicKey publickey = caCert.getPublicKey();
            String keySize = null;
            if(publickey instanceof RSAPublicKey) {
                keySize = ""+((RSAPublicKey)publickey).getModulus().bitLength();
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.CertificationAuthority

    public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
        return getMode();
    }

    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {       
        CertificationAuthority ca = getCertificationAuthority(request);
        if(ca == null) {
            // CA GBean is not running or the CA has not been initialized.
            request.setAttribute("caNotSetup", Boolean.TRUE);
        } else {
            request.setAttribute("caNotSetup", Boolean.FALSE);
            request.setAttribute("caLocked", ca.isLocked() ? Boolean.TRUE : Boolean.FALSE);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.