8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: ServicesDefaultValues.java,v 1.38 2009/01/28 05:35:02 ww203982 Exp $
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott * Portions Copyrighted 2013-2016 ForgeRock AS.
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshottimport org.forgerock.openam.utils.ValidateIPaddress;
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshottimport com.iplanet.am.util.SecureRandomManager;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.iplanet.am.util.SystemProperties;
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshottimport com.sun.identity.shared.encode.Base64;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.sun.identity.shared.xml.XMLUtils;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This class holds the default values of service schema.
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott public static final String RANDOM_SECURE = "@128_BIT_RANDOM_SECURE@";
adc14d0be45af50dbde99eb71c21de3bc1ddb1c6Phill Cunnington public static final String RANDOM_SECURE_256 = "@256_BIT_RANDOM_SECURE@";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static ServicesDefaultValues instance = new ServicesDefaultValues();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static Set preappendSlash = new HashSet();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster preappendSlash.add(SetupConstants.CONFIG_VAR_PRODUCT_NAME);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster preappendSlash.add(SetupConstants.CONFIG_VAR_OLD_CONSOLE_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster preappendSlash.add(SetupConstants.CONFIG_VAR_CONSOLE_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster preappendSlash.add(SetupConstants.CONFIG_VAR_SERVER_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster trimSlash.add(SetupConstants.CONFIG_VAR_CONSOLE_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster trimSlash.add(SetupConstants.CONFIG_VAR_SERVER_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ResourceBundle bundle = ResourceBundle.getBundle(
0be6372051459d02acfe49de71e8d6653f0b412eAlin Brici "serviceDefaultValues");
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott secureRandom = SecureRandomManager.getSecureRandom();
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott throw new IllegalStateException("Failed to initialise secure random");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This method validates the form fields and populates the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * map with valid values.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param request is the Servlet Request.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_BASE_DIR, base);
f274741b561a21b347710fcca8afbc5f3265fc4fJames Phillpotts map.put(SetupConstants.USER_HOME, System.getProperty("user.home", ""));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.encryptkey",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // this set the encryption password for crypt class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // otherwises password in serverconfig.xml will be incorrect
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SystemProperties.initializeProperties("am.encryption.pwd", ekey);
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major throw new ConfiguratorException("configurator.invalidhostname", null, locale);
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major String cookieDomain = (String) map.get(SetupConstants.CONFIG_VAR_COOKIE_DOMAIN);
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major throw new ConfiguratorException("configurator.invalidcookiedomain", null, locale);
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major map.put(SetupConstants.CONFIG_VAR_COOKIE_DOMAIN, getCookieDomain(cookieDomain, hostname));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String dbOption = (String)map.get(SetupConstants.CONFIG_VAR_DATA_STORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean embedded = dbOption.equals(SetupConstants.SMS_EMBED_DATASTORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster AMSetupDSConfig dsConfig = AMSetupDSConfig.getInstance();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.CONFIG_VAR_DIRECTORY_SERVER_SSL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean ssl = (sslEnabled != null) && sslEnabled.equals("SSL");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "configurator.dsconnnectfailure", null, locale);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington SetupConstants.CONFIG_VAR_ROOT_SUFFIX))) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.invalidsuffix",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.DIT_LOADED, dsConfig.isDITLoaded(ssl));
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste // Enable data store notifications and switch persistent search on for sms.
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste // This is now done by default for embedded data stores as well as external
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste // to ensure consistent behaviour for refreshing data store cache.
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste map.put(SetupConstants.DATASTORE_NOTIFICATION, "true");
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste map.put(SetupConstants.DISABLE_PERSISTENT_SEARCH, "aci,um");
4e8a549dc885858e1d99b551f4964753e68d3046Mark de Reeper Map userRepo = (Map)map.get(SetupConstants.USER_STORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean bUseExtUMDS = (userRepo != null) && !userRepo.isEmpty();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String s = (String) userRepo.get(SetupConstants.USER_STORE_SSL);
597f05fe6c5f9c5b48ee85ea72f7af5cfc8ae83eSachiko Wallace final String isSecure = ((s != null) && s.equals("SSL")) ? "true" : "false";
597f05fe6c5f9c5b48ee85ea72f7af5cfc8ae83eSachiko Wallace map.put(SetupConstants.LDAP_CONNECTION_MODE_TAG, SetupConstants.LDAP_CONNECTION_MODE_LDAPS);
597f05fe6c5f9c5b48ee85ea72f7af5cfc8ae83eSachiko Wallace map.put(SetupConstants.LDAP_CONNECTION_MODE_TAG, SetupConstants.LDAP_CONNECTION_MODE_LDAP);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.get(SetupConstants.CONFIG_VAR_DS_MGR_PWD));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.get(SetupConstants.CONFIG_VAR_DIRECTORY_SERVER_HOST));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.get(SetupConstants.CONFIG_VAR_DIRECTORY_SERVER_PORT));
597f05fe6c5f9c5b48ee85ea72f7af5cfc8ae83eSachiko Wallace map.put(SetupConstants.LDAP_CONNECTION_MODE_TAG, SetupConstants.LDAP_CONNECTION_MODE_LDAP);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington String normalizedDN = DN.valueOf(umRootSuffix).toString();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String escapedDN = SMSSchema.escapeSpecialCharacters(normalizedDN);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.UM_NORMALIZED_ORGBASE, escapedDN);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Set the platform locale.
0be6372051459d02acfe49de71e8d6653f0b412eAlin Brici map.put(SetupConstants.CONFIG_VAR_PLATFORM_LOCALE,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Validates serverURL.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if service URL is valid.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String hostURL = (String)map.get(SetupConstants.CONFIG_VAR_SERVER_URL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean valid = (hostURL != null) && (hostURL.length() > 0);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_SERVER_HOST, hostName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_SERVER_PROTO, protocol);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_SERVER_PORT, port);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Validates if cookie Domain is syntactically correct.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param cookieDomain is the user specified cookie domain.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if syntax for cookie domain is correct.
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major public static boolean isCookieDomainValid(String cookieDomain) {
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major return StringUtils.isEmpty(cookieDomain) || !cookieDomain.contains(":");
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major * Returns the cookie Domain based on the hostname. In case the hostname has only one component, or if the hostname
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major * ends with a '.', or if the hostname is a valid IP address, host only cookies shall be used.
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major * @param cookieDomain Is the user specified cookie domain.
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major * @param hostname Is the host for which the cookie domain is set.
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major * @return CookieDomain containing the valid cookie domain for the specified hostname.
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major private static String getCookieDomain(String cookieDomain, String hostname) {
45481c31e00d6fc1792f7a8beae92607b4557749Peter Major if (idx == -1 || idx == hostname.length() - 1 || ValidateIPaddress.isValidIP(hostname)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Validates the encryption key.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if ecryption key is valid.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static boolean isEncryptionKeyValid() {
cfba646ddfa9d543f0c40e4c7788c65b4a24b34dPhill Cunnington ekey = AMSetupUtils.getRandomString().trim();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_ENCRYPTION_KEY, ekey);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // in future release need to check if length of greater from 10.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return ((ekey != null) && (ekey.length() > 0)) ? true : false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Validates Admin passwords.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static void validatePassword(Locale locale) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.CONFIG_VAR_CONFIRM_ADMIN_PWD)).trim();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (isPasswordValid(adminPwd, confirmAdminPwd, locale)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.ENC_PWD_PROPERTY, (((String) map.get(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.CONFIG_VAR_ENCRYPTION_KEY)).trim()));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.HASH_ADMIN_PWD, (String)Hash.hash(adminPwd));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String urlAccessAgentPwdConfirm = ((String)map.get(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.CONFIG_VAR_AMLDAPUSERPASSWD_CONFIRM)).trim();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster validateURLAccessAgentPassword(adminPwd, urlAccessAgentPwd,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.remove(SetupConstants.CONFIG_VAR_AMLDAPUSERPASSWD_CONFIRM);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String dbOption = (String)map.get(SetupConstants.CONFIG_VAR_DATA_STORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dbOption.equals(SetupConstants.SMS_EMBED_DATASTORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean dbSunDS = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean dbMsAD = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else { // Keep old behavior for now.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dbSunDS = dbOption.equals(SetupConstants.SMS_DS_DATASTORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dbMsAD = dbOption.equals(SetupConstants.SMS_AD_DATASTORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_DS_MGR_PWD, adminPwd);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String ldapUserPwd = (String)map.get(SetupConstants.LDAP_USER_PWD);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String encryptAdminPwd = Crypt.encrypt(adminPwd);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.ENCRYPTED_ADMIN_PWD, encryptAdminPwd);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.ENCRYPTED_AD_ADMIN_PWD, encryptAdminPwd);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.remove(SetupConstants.CONFIG_VAR_CONFIRM_ADMIN_PWD);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * valid: password greater than 8 characters
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * valid: password and confirm passwords match
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param pwd is the Admin password.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param cPwd is the confirm Admin password.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param locale Locale of the HTTP Request.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if password is valid.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.nopasswdmatch",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.passwdlength",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return true;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static boolean validateURLAccessAgentPassword(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "configurator.urlaccessagent.passwd.nomatch", null, locale);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "configurator.urlaccessagent.passwd.match.amadmin.pwd",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.passwdlength",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return true;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the map of default attribute name to its value.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the map of default attribute name to its value.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Set the deploy URI.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param deployURI Deploy URI.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param map Service attribute values.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static void setDeployURI(String deployURI, Map map) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_PRODUCT_NAME, deployURI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_OLD_CONSOLE_URI, deployURI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_CONSOLE_URI, deployURI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_SERVER_URI, deployURI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the tag swapped string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param orig String to be tag swapped.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the tag swapped string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the tag swapped string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param orig String to be tag swapped.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param bXML <code>true</code> if it is an XML file. and value
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * needs to be escaped.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the tag swapped string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static String tagSwap(String orig, boolean bXML) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster value = XMLUtils.escapeSpecialCharacters(value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster orig = orig.replaceAll("/@" + key + "@", value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (key.equals(SetupConstants.CONFIG_VAR_ROOT_SUFFIX)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String normalized = DNUtils.normalizeDN(value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster tmp = (bXML) ? XMLUtils.escapeSpecialCharacters(tmp) :
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "@" + SetupConstants.SM_ROOT_SUFFIX_HAT + "@", tmp);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington String rfced = DN.valueOf(value).toString();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster tmp = (bXML) ? XMLUtils.escapeSpecialCharacters(rfced) :
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "@" + SetupConstants.CONFIG_VAR_ROOT_SUFFIX + "@",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster key.equals(SetupConstants.SM_ROOT_SUFFIX_HAT) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster key.equals(SetupConstants.NORMALIZED_ORG_BASE) ||
9fa57a4f31580310b62bb2f08906e6b73d510817jeff.schenk key.equals(SetupConstants.SM_ROOT_SUFFIX_HAT) ||
9fa57a4f31580310b62bb2f08906e6b73d510817jeff.schenk key.equals(SetupConstants.CONFIG_VAR_SESSION_ROOT_SUFFIX) ||
9fa57a4f31580310b62bb2f08906e6b73d510817jeff.schenk key.equals(SetupConstants.CONFIG_VAR_SESSION_STORE_TYPE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster orig = orig.replaceAll("@" + key + "@", value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster value = XMLUtils.escapeSpecialCharacters(value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster orig = orig.replaceAll("@" + key + "@", value);
adc14d0be45af50dbde99eb71c21de3bc1ddb1c6Phill Cunnington orig = replaceRandomSecureTags(orig, RANDOM_SECURE, 128);
adc14d0be45af50dbde99eb71c21de3bc1ddb1c6Phill Cunnington orig = replaceRandomSecureTags(orig, RANDOM_SECURE_256, 256);
adc14d0be45af50dbde99eb71c21de3bc1ddb1c6Phill Cunnington private static String replaceRandomSecureTags(String orig, String tag, int size) {
adc14d0be45af50dbde99eb71c21de3bc1ddb1c6Phill Cunnington // Each Secure Random tag should be a newly generated random.