Examples of KeystoreManager


Examples of org.apache.geronimo.management.geronimo.KeystoreManager

            if(mode.equals("new")) {
                String protocol = renderRequest.getParameter("protocol");
                String containerDisplayName = renderRequest.getParameter("containerDisplayName");
                renderRequest.setAttribute("maxThreads", "50");
                if(server.equals(WEB_SERVER_JETTY)) {
                    KeystoreManager mgr = PortletManager.getCurrentServer(renderRequest).getKeystoreManager();
                    KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
                    String[] storeNames = new String[stores.length];
                    for (int i = 0; i < storeNames.length; i++) {
                        storeNames[i] = stores[i].getKeystoreName();
                    }
                    renderRequest.setAttribute("keyStores", storeNames);
                    KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
                    String[] trustNames = new String[trusts.length];
                    for (int i = 0; i < trustNames.length; i++) {
                        trustNames[i] = trusts[i].getKeystoreName();
                    }
                    renderRequest.setAttribute("trustStores", trustNames);
                    Map aliases = new HashMap();
                    for (int i = 0; i < stores.length; i++) {
                        try {
                            aliases.put(stores[i].getKeystoreName(), stores[i].getUnlockedKeys(null));
                        } catch (KeystoreException e) {}
                    }
                    renderRequest.setAttribute("unlockedKeys", aliases);
                }
                else if (server.equals(WEB_SERVER_TOMCAT)) {
                    //todo:   Any Tomcat specific processing?
                }
                else {
                    //todo:   Handle "should not occur" condition
                }
                renderRequest.setAttribute("protocol", protocol);
                renderRequest.setAttribute("mode", "add");
                renderRequest.setAttribute("containerDisplayName", containerDisplayName);
                if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
                    editHttpsView.include(renderRequest, renderResponse);
                } else {
                    editHttpView.include(renderRequest, renderResponse);
                }

            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter("connectorURI");
                WebConnector connector = PortletManager.getWebConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                  String displayName = new AbstractName(URI.create(connectorURI)).getName().get("name").toString();
                    renderRequest.setAttribute("displayName", displayName);
                    renderRequest.setAttribute("connectorURI", connectorURI);
                    renderRequest.setAttribute("port", new Integer(connector.getPort()));
                    renderRequest.setAttribute("host", connector.getHost());
                    int maxThreads = connector.getMaxThreads();
                    renderRequest.setAttribute("maxThreads", Integer.toString(maxThreads));
                    if(server.equals(WEB_SERVER_JETTY)) {
                        KeystoreManager mgr = PortletManager.getCurrentServer(renderRequest).getKeystoreManager();
                        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
                        String[] storeNames = new String[stores.length];
                        for (int i = 0; i < storeNames.length; i++) {
                            storeNames[i] = stores[i].getKeystoreName();
                        }
                        renderRequest.setAttribute("keyStores", storeNames);
                        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
                        String[] trustNames = new String[trusts.length];
                        for (int i = 0; i < trustNames.length; i++) {
                            trustNames[i] = trusts[i].getKeystoreName();
                        }
                        renderRequest.setAttribute("trustStores", trustNames);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.KeystoreManager

    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 {
        KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] keystores = manager.getKeystores();
        PortletSession session = request.getPortletSession(true);
        KeystoreData[] datas = new KeystoreData[keystores.length];
        Map keys = new HashMap();
        for (int i = 0; i < datas.length; i++) {
            AbstractName aName = PortletManager.getNameFor(request, keystores[i]);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.KeystoreManager

        // provide the three possible values for secure algorithm - Default, SunX509, and IbmX509
        enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });
       
        // provide the possible values for the keystore name
        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
        String[] storeNames = new String[stores.length];
        for (int i = 0; i < storeNames.length; i++) {
            storeNames[i] = stores[i].getKeystoreName();
        }
        enumValues.put("keyStore", storeNames);
       
        // provide the possible values for the trust store name
        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
        String[] trustNames = new String[trusts.length];
        for (int i = 0; i < trustNames.length; i++) {
            trustNames[i] = trusts[i].getKeystoreName();
        }
        enumValues.put("trustStore", trustNames);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.KeystoreManager

    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 {
        KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] keystores = manager.getKeystores();
        PortletSession session = request.getPortletSession(true);
        KeystoreData[] datas = new KeystoreData[keystores.length];
        Map keys = new HashMap();
        for (int i = 0; i < datas.length; i++) {
            AbstractName aName = PortletManager.getNameFor(request, keystores[i]);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.KeystoreManager

        // provide the three possible values for secure algorithm - Default, SunX509, and IbmX509
        enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });

        // provide the possible values for the keystore name
        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
        String[] storeNames = new String[stores.length];
        for (int i = 0; i < storeNames.length; i++) {
            storeNames[i] = stores[i].getKeystoreName();
        }
        enumValues.put("keyStore", storeNames);

        // provide the possible values for the trust store name
        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
        String[] trustNames = new String[trusts.length];
        for (int i = 0; i < trustNames.length; i++) {
            trustNames[i] = trusts[i].getKeystoreName();
        }
        enumValues.put("trustStore", trustNames);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.KeystoreManager

        // provide the three possible values for secure algorithm - Default, SunX509, and IbmX509
        enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });

        // provide the possible values for the keystore name
        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
        String[] storeNames = new String[stores.length];
        for (int i = 0; i < storeNames.length; i++) {
            storeNames[i] = stores[i].getKeystoreName();
        }
        enumValues.put("keyStore", storeNames);

        // provide the possible values for the trust store name
        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
        String[] trustNames = new String[trusts.length];
        for (int i = 0; i < trustNames.length; i++) {
            trustNames[i] = trusts[i].getKeystoreName();
        }
        enumValues.put("trustStore", trustNames);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.KeystoreManager

        // provide the three possible values for secure algorithm - Default, SunX509, and IbmX509
        enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });
       
        // provide the possible values for the keystore name
        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
        String[] storeNames = new String[stores.length];
        for (int i = 0; i < storeNames.length; i++) {
            storeNames[i] = stores[i].getKeystoreName();
        }
        enumValues.put("keyStore", storeNames);
       
        // provide the possible values for the trust store name
        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
        String[] trustNames = new String[trusts.length];
        for (int i = 0; i < trustNames.length; i++) {
            trustNames[i] = trusts[i].getKeystoreName();
        }
        enumValues.put("trustStore", trustNames);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.KeystoreManager

        String[] params = {ERROR_MSG, INFO_MSG};
        for(int i = 0; i < params.length; ++i) {
            String value = request.getParameter(params[i]);
            if(value != null) request.setAttribute(params[i], value);
        }
        KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] keystores = manager.getKeystores();
        PortletSession session = request.getPortletSession(true);
        KeystoreData[] datas = new KeystoreData[keystores.length];
        Map keys = new HashMap();
        for (int i = 0; i < datas.length; i++) {
            AbstractName aName = PortletManager.getNameFor(request, keystores[i]);
View Full Code Here

Examples of org.apache.geronimo.management.geronimo.KeystoreManager

        // provide the three possible values for secure algorithm - Default, SunX509, and IbmX509
        enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });
       
        // provide the possible values for the keystore name
        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
        String[] storeNames = new String[stores.length];
        for (int i = 0; i < storeNames.length; i++) {
            storeNames[i] = stores[i].getKeystoreName();
        }
        enumValues.put("keyStore", storeNames);
       
        // provide the possible values for the trust store name
        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
        String[] trustNames = new String[trusts.length];
        for (int i = 0; i < trustNames.length; i++) {
            trustNames[i] = trusts[i].getKeystoreName();
        }
        enumValues.put("trustStore", trustNames);
View Full Code Here

Examples of org.apache.karaf.jaas.config.KeystoreManager

        try {
            logger.debug("Setting up SSL");
            env.put(Context.SECURITY_PROTOCOL, "ssl");
            env.put("java.naming.ldap.factory.socket", ManagedSSLSocketFactory.class.getName());
            ref = bundleContext.getServiceReference(KeystoreManager.class.getName());
            KeystoreManager manager = (KeystoreManager) bundleContext.getService(ref);
            SSLSocketFactory factory = manager.createSSLFactory(sslProvider, sslProtocol, sslAlgorithm, sslKeystore, sslKeyAlias, sslTrustStore);
            ManagedSSLSocketFactory.setSocketFactory(factory);
            Thread.currentThread().setContextClassLoader(ManagedSSLSocketFactory.class.getClassLoader());
        } catch (Exception e) {
            throw new LoginException("Unable to setup SSL support for LDAP: " + e.getMessage());
        } finally {
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.