/** * Initialize X509 certificate settings. Read settings from database, fallback reading from * property file if settings could not be read from database. */ public void initializeX509() { this.X509_ROOT_SUBJECT = ConfigurationQueries.getValue(ConfigurationQueries.X509_ROOT_SUBJECT); this.X509_ROOT_VALID_FROM = ConfigurationQueries.getValue(ConfigurationQueries.X509_ROOT_VALID_FROM); this.X509_ROOT_VALID_TO = ConfigurationQueries.getValue(ConfigurationQueries.X509_ROOT_VALID_TO); this.X509_SERVER_SUBJECT = ConfigurationQueries.getValue(ConfigurationQueries.X509_SERVER_SUBJECT); this.X509_SERVER_VALID_FOR = ConfigurationQueries.getValue(ConfigurationQueries.X509_SERVER_VALID_FOR); this.X509_SERVER_VALID_FROM = ConfigurationQueries.getValue(ConfigurationQueries.X509_SERVER_VALID_FROM); this.X509_CLIENT_SUBJECT = ConfigurationQueries.getValue(ConfigurationQueries.X509_CLIENT_SUBJECT); this.X509_CLIENT_VALID_FOR = ConfigurationQueries.getValue(ConfigurationQueries.X509_CLIENT_VALID_FOR); this.X509_CLIENT_VALID_FROM = ConfigurationQueries.getValue(ConfigurationQueries.X509_CLIENT_VALID_FROM); this.X509_KEY_STRENGTH = ConfigurationQueries.getValue(ConfigurationQueries.X509_KEY_STRENGTH); ResourceBundle rootCertBundle = null; ResourceBundle serverCertBundle = null; ResourceBundle clientCertBundle = null; try { rootCertBundle = ResourceBundle.getBundle(Constants.ROOT_BUNDLE_NAME); serverCertBundle = ResourceBundle.getBundle(Constants.SERVER_BUNDLE_NAME); clientCertBundle = ResourceBundle.getBundle(Constants.CLIENT_BUNDLE_NAME); if (this.X509_ROOT_SUBJECT == null || "".equals(this.X509_ROOT_SUBJECT)) this.X509_ROOT_SUBJECT = rootCertBundle.getString("subject"); if (this.X509_ROOT_VALID_FROM == null || "".equals(this.X509_ROOT_VALID_FROM)) this.X509_ROOT_VALID_FROM = formatStartDate(rootCertBundle.getString("startDate")); if (this.X509_ROOT_VALID_TO == null || "".equals(this.X509_ROOT_VALID_TO)) this.X509_ROOT_VALID_TO = formatEndDate(rootCertBundle.getString("endDate")); if (this.X509_SERVER_SUBJECT == null || "".equals(this.X509_SERVER_SUBJECT)) this.X509_SERVER_SUBJECT = serverCertBundle.getString("subject"); if (this.X509_SERVER_VALID_FROM == null || "".equals(this.X509_SERVER_VALID_FROM)) this.X509_SERVER_VALID_FROM = formatStartDate(serverCertBundle.getString("startDate")); if (this.X509_SERVER_VALID_FOR == null || "".equals(this.X509_SERVER_VALID_FOR)) this.X509_SERVER_VALID_FOR = Integer.toString(Constants.DEFAULT_SERVER_CERT_VALIDITY); if (this.X509_CLIENT_SUBJECT == null || "".equals(this.X509_CLIENT_SUBJECT)) this.X509_CLIENT_SUBJECT = clientCertBundle.getString("subject"); if (this.X509_CLIENT_VALID_FROM == null || "".equals(this.X509_CLIENT_VALID_FROM)) this.X509_CLIENT_VALID_FROM = formatStartDate(clientCertBundle.getString("startDate")); if (this.X509_CLIENT_VALID_FOR == null || "".equals(this.X509_CLIENT_VALID_FOR)) this.X509_CLIENT_VALID_FOR = Integer.toString(Constants.DEFAULT_CLIENT_CERT_VALIDITY); if (this.X509_KEY_STRENGTH == null || "".equals(this.X509_KEY_STRENGTH)) this.X509_KEY_STRENGTH = rootCertBundle.getString("key_strength"); } catch (MissingResourceException mre) { logger.log(Level.SEVERE, "Error: *_cert.properties could not be read", mre); } }
/** * Sets the status, if the default database or an external database will be used * * @param defaultDB true, if the default database will be used */ public void setUseDefaultDB(boolean defaultDB) { this.USE_DEFAULT_DB = defaultDB; ConfigurationQueries.setValue( ConfigurationQueries.USE_DEFAULT_DB, defaultDB + "", DBConnector.getInstance().getBaseConnection()); }
/** * Helper Function to initialize Window Positioning * * @param query the query for the db * @param fallback_pos fallback value for position * @param screen size of the screen * @return the position for the window */ private int setWindowPosition(String query, int fallback_pos, int screen) { int pos; String get_pos = ConfigurationQueries.getValue(query); if (!StringUtils.isEmptyOrWhitespaces(get_pos)) pos = Integer.parseInt(get_pos); else pos = fallback_pos; if (pos > screen) { pos = fallback_pos; } return pos; }
public void setGuiShowOpenVPNIpWarningDialog(boolean show) { ConfigurationQueries.setValue( ConfigurationQueries.GUI_SHOW_OPENVPN_IP_WARNING_DIALOG, show + ""); this.GUI_SHOW_OPENVPN_IP_WARNING = show; }
public void setGuiShowExitDialog(boolean showExitDialog) { ConfigurationQueries.setValue(ConfigurationQueries.GUI_SHOW_EXIT_DIALOG, showExitDialog + ""); this.GUI_SHOW_EXIT_DIALOG = showExitDialog; }
public void setGuiShowCRL(boolean showCRL) { ConfigurationQueries.setValue(ConfigurationQueries.GUI_SHOW_CRL_TAB, showCRL + ""); this.GUI_SHOW_CRL_TAB = showCRL; }
public void setX509GuiLocationY(int locationY) { ConfigurationQueries.setValue(ConfigurationQueries.X509_GUI_LOCATION_Y, locationY + ""); this.X509_GUI_LOCATION_Y = locationY; }
public void setX509GuiWidth(int width) { ConfigurationQueries.setValue(ConfigurationQueries.X509_GUI_WIDTH, width + ""); this.X509_GUI_WIDTH = width; }
public void setUpdateProxyPassword(String proxyPassword) { ConfigurationQueries.setValue(ConfigurationQueries.UPDATE_PROXY_PASSWORD, proxyPassword); UDPATE_PROXY_PASSWORD = proxyPassword; }
public void setX509ClientSubject(String x509_client_subject) { ConfigurationQueries.setValue(ConfigurationQueries.X509_CLIENT_SUBJECT, x509_client_subject); this.X509_CLIENT_SUBJECT = x509_client_subject; }
public void setX509ServerValidFor(String x509_server_valid_for) { ConfigurationQueries.setValue( ConfigurationQueries.X509_SERVER_VALID_FOR, x509_server_valid_for); this.X509_SERVER_VALID_FOR = x509_server_valid_for; }
public void setX509ServerValidFrom(String x509_server_valid_from) { ConfigurationQueries.setValue( ConfigurationQueries.X509_SERVER_VALID_FROM, x509_server_valid_from); this.X509_SERVER_VALID_FROM = x509_server_valid_from; }
public void setX509ServerSubject(String x509_server_subject) { ConfigurationQueries.setValue(ConfigurationQueries.X509_SERVER_SUBJECT, x509_server_subject); this.X509_SERVER_SUBJECT = x509_server_subject; }
public void setX509RootValidTo(String x509_root_valid_to) { ConfigurationQueries.setValue(ConfigurationQueries.X509_ROOT_VALID_TO, x509_root_valid_to); this.X509_ROOT_VALID_TO = x509_root_valid_to; }
public void setX509RootValidFrom(String x509_root_valid_from) { ConfigurationQueries.setValue(ConfigurationQueries.X509_ROOT_VALID_FROM, x509_root_valid_from); this.X509_ROOT_VALID_FROM = x509_root_valid_from; }
public void setUpdateProxyPort(String proxyPort) { ConfigurationQueries.setValue(ConfigurationQueries.UPDATE_PROXY_PORT, proxyPort); UPDATE_PROXY_PORT = proxyPort; }
public void setUpdateProxyUsername(String proxyUsername) { ConfigurationQueries.setValue(ConfigurationQueries.UPDATE_PROXY_USERNAME, proxyUsername); UPDATE_PROXY_USERNAME = proxyUsername; }
public void setX509ClientValidFrom(String x509_client_valid_from) { ConfigurationQueries.setValue( ConfigurationQueries.X509_CLIENT_VALID_FROM, x509_client_valid_from); this.X509_CLIENT_VALID_FROM = x509_client_valid_from; }
public void setX509GuiHeight(int height) { ConfigurationQueries.setValue(ConfigurationQueries.X509_GUI_HEIGHT, height + ""); this.X509_GUI_HEIGHT = height; }
public void setX509ClientValidFor(String x509_client_valid_for) { ConfigurationQueries.setValue( ConfigurationQueries.X509_CLIENT_VALID_FOR, x509_client_valid_for); this.X509_CLIENT_VALID_FOR = x509_client_valid_for; }
public void setX509GuiLocationX(int locationX) { ConfigurationQueries.setValue(ConfigurationQueries.X509_GUI_LOCATION_X, locationX + ""); this.X509_GUI_LOCATION_X = locationX; }
public void setX509KeyStrength(String x509_key_strength) { ConfigurationQueries.setValue(ConfigurationQueries.X509_KEY_STRENGTH, x509_key_strength); this.X509_KEY_STRENGTH = x509_key_strength; }
public void setServerUserTreeDividerLocation(int serverUserTreeDividerLocation) { ConfigurationQueries.setValue( ConfigurationQueries.SERVER_USER_TREE_DIVIDER_LOCATION, serverUserTreeDividerLocation + ""); this.SERVER_USER_TREE_DIVIDER_LOCATION = serverUserTreeDividerLocation; }
public void setUpdateAutomatically(boolean autoUpdate) { ConfigurationQueries.setValue(ConfigurationQueries.UPDATE_AUTOMATICALLY, autoUpdate + ""); UPDATE_AUTOMATICALLY = autoUpdate; }
public void setGuiShowCRX509(boolean crX509) { ConfigurationQueries.setValue(ConfigurationQueries.GUI_SHOW_CR_X509, crX509 + ""); this.GUI_SHOW_CR_X509 = crX509; }
public void setUpdateServerPath(String path) { ConfigurationQueries.setValue(ConfigurationQueries.UPDATE_SERVER_PATH, path); UPDATE_SERVER = path; }
public void setGuiShowExitDialogActiveThreads(boolean showExitDialogActiveThreads) { ConfigurationQueries.setValue( ConfigurationQueries.GUI_SHOW_EXIT_DIALOG_ACTIVE_THREADS, showExitDialogActiveThreads + ""); this.GUI_SHOW_EXIT_DIALOG_ACTIVE_THREADS = showExitDialogActiveThreads; }
public void setUpdateRepository(String repo) { ConfigurationQueries.setValue(ConfigurationQueries.UPDATE_REPOSITORY, repo); UPDATE_REPOSITORY = repo; }
public void setCreateOpenVPNConfigFiles(boolean createOpenVPNConfigFiles) { ConfigurationQueries.setValue( ConfigurationQueries.CREATE_OPENVPN_CONFIG_FILES, createOpenVPNConfigFiles + ""); this.CREATE_OPENVPN_CONFIG_FILES = createOpenVPNConfigFiles; }
public void setUpdateProxy(String proxy) { ConfigurationQueries.setValue(ConfigurationQueries.UPDATE_PROXY, proxy); UPDATE_PROXY = proxy; }