Package org.wso2.carbon.base

Examples of org.wso2.carbon.base.ServerConfiguration


                            response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                            outputStream.write("<h4>Policy not found!</h4>".getBytes());
                        } else {
                            String ipAddress = "http://" + NetworkUtils.getLocalHostname() + ":" +
                                               CarbonUtils.getTransportPort(configCtx, "http");
                            ServerConfiguration serverCofig = ServerConfiguration.getInstance();
                            outputStream.write(("<html><head>" +
                                                "<title>WSO2 Server v" +
                                                serverCofig.getFirstProperty("Version") +
                                                " Management Console - " +
                                                axisService.getName() +
                                                " Service Policies</title>" +
                                                "</head>" +
                                                "<body>" +
View Full Code Here


    }
   
    private static PrivateKey getDefaultPrivateKey() throws Exception {
        KeyStoreManager keyStoreMan = KeyStoreManager.getInstance(null);
        KeyStore keyStore = keyStoreMan.getPrimaryKeyStore();
        ServerConfiguration config = ServerConfiguration.getInstance();
        String password = config
                .getFirstProperty(RegistryResources.SecurityManagement.SERVER_PRIMARY_KEYSTORE_PASSWORD);
        String alias = config.getFirstProperty(RegistryResources.SecurityManagement.SERVER_PRIMARY_KEYSTORE_KEY_ALIAS);
        PrivateKey privateKey = (PrivateKey)keyStore.getKey(alias, password.toCharArray());
        return privateKey;
    }
View Full Code Here

    }
   
    private static PublicKey getDefaultPublicKey() throws Exception {
        KeyStoreManager keyStoreMan = KeyStoreManager.getInstance(null);
        KeyStore keyStore = keyStoreMan.getPrimaryKeyStore();
        ServerConfiguration config = ServerConfiguration.getInstance();
        String alias = config
                .getFirstProperty(RegistryResources.SecurityManagement.SERVER_PRIMARY_KEYSTORE_KEY_ALIAS);
        PublicKey publicKey = (PublicKey) keyStore.getCertificate(alias).getPublicKey();
        return publicKey;

    }
View Full Code Here

     * @return Generated OpenID
     * @throws IdentityProviderException
     */
    public static String generateOpenID(String user) throws IdentityProviderException {

        ServerConfiguration serverConfig = null;
        String openIDUserUrl = null;
        String openID = null;
        URI uri = null;
        URL url = null;

        serverConfig = ServerConfiguration.getInstance();
        openIDUserUrl = serverConfig.getFirstProperty(IdentityConstants.OPENID_USER);

        user = normalizeUrlEncoding(user);

        openID = String.format(openIDUserUrl, user);

View Full Code Here

        assertion = (Assertion) buildXMLObject(Assertion.DEFAULT_ELEMENT_NAME);
        Conditions conditions = (Conditions) buildXMLObject(Conditions.DEFAULT_ELEMENT_NAME);
        conditions.setNotBefore(notBefore);
        conditions.setNotOnOrAfter(notAfter);

        ServerConfiguration config = ServerConfiguration.getInstance();
        String host = "http://" + config.getFirstProperty("HostName");
        assertion.setIssuer(host);
        assertion.setIssueInstant(new DateTime());

        if (appilesTo != null) {
            Audience audience = (Audience) buildXMLObject(Audience.DEFAULT_ELEMENT_NAME);
View Full Code Here

        IdentityPersistenceManager dbman = null;
        String host = null;
        RelyingPartyDO rp = null;
        String alias = null;
        String keyStoreName = null;
        ServerConfiguration serverConfig = null;

        host = IdentityProviderUtil.getAppliesToHostName(data);
        serverConfig = ServerConfiguration.getInstance();
        String userName = UserCoreUtil.getTenantLessUsername(userIdentifier);

        try {
            dbman = IdentityPersistenceManager.getPersistanceManager();
        } catch (Exception e) {
            log.error("Error while instantiating IdentityUserStore", e);
            throw new IdentityProviderException("Error while instantiating IdentityUserStore", e);
        }

        try {
      rp = dbman.getGloballyTrustedRelyingParty(IdentityTenantUtil
          .getRegistry(null, userName), host);
    } catch (Exception ignore) {
      // Lets proceed with the user trusted relying parties.
    }

        keyStoreName = serverConfig.getFirstProperty("Security.KeyStore.Location");

        if (rp != null) {
            // This is a globally trusted RP
            alias = rp.getAlias();
            // Get key store name
View Full Code Here

    private static Registry registry;
    private static final String CARBON_HOME = "/home/kasun/development/wso2/wso2-distrns/wso2greg-3.6.0-SNAPSHOT" ;

   
    public RemoteRegistryClient() {
        ServerConfiguration config = ServerConfiguration.getInstance();
        String type = config.getFirstProperty("Security.KeyStore.Type");
        String password = config.getFirstProperty("Security.KeyStore.Password");
        String storeFile = new File(config.getFirstProperty("Security.KeyStore.Location")).getAbsolutePath();

        System.setProperty("javax.net.ssl.trustStore", storeFile);
        System.setProperty("javax.net.ssl.trustStoreType", type);
        System.setProperty("javax.net.ssl.trustStorePassword", password);
    }
View Full Code Here

   * if(promiscuous) ->read nothing else if(blackList) ->read the blacklist and key store details
   * else if (whiteList)->read the white-list and key store details
   */
  private void loadData() throws IdentityException {

    ServerConfiguration serverConfig = null;
    KeyStore store = null;
    FileInputStream stream = null;

    serverConfig = ServerConfiguration.getInstance();
    String keyStore = serverConfig.getFirstProperty("Security.KeyStore.Location");
    String storeType = serverConfig.getFirstProperty("Security.KeyStore.Type");
    String storePass = serverConfig.getFirstProperty("Security.KeyStore.Password");
    String keyAlias = serverConfig.getFirstProperty("Security.KeyStore.KeyAlias");
    String keyPass = serverConfig.getFirstProperty("Security.KeyStore.KeyPassword");

    issuerPolicy = IdentityUtil.getProperty(ServerConfig.ISSUER_POLICY);

    if (issuerPolicy == null || issuerPolicy.trim().length() == 0) {
      // Set the default value
View Full Code Here

        }
        return url;
    }

    private static String getHostName() {
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        if (serverConfig.getFirstProperty("HostName") != null) {
            return TenantUtils.getDomainNameFromOpenId(serverConfig.getFirstProperty("HostName"));
        } else {
            return "localhost";
        }
    }
View Full Code Here

            SecurityConfigAdmin admin = new SecurityConfigAdmin(axisConfig,
                    IdentitySTSMgtServiceComponent.getRegistryService().getConfigSystemRegistry(),
                    new IPPasswordCallbackHandler());

            ServerConfiguration serverConfig = ServerConfiguration.getInstance();
            String ksName = serverConfig.getFirstProperty("Security.KeyStore.Location");
            ksName = ksName.substring(ksName.lastIndexOf("/") + 1);

            if (log.isDebugEnabled()) {
                log.debug("Applying identity security policy for service " + serviceName);
            }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.base.ServerConfiguration

Copyright © 2018 www.massapicom. 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.