public override Properties <string, string> GetInvalidCredentials(int index) { Properties <string, string> props = new Properties <string, string>(); int aliasnum = (index % 10) + 1; props.Insert(KeyStoreFileProp, GetKeyStoreDir(m_clientDataDir) + "geode11.keystore"); props.Insert(KeyStoreAliasProp, "geode11"); props.Insert(KeyStorePasswordProp, "geode"); if (!IsMultiUserMode) { return(props); } else { Properties <string, object> pkcsprops = Pkcs.GetCredentials/*<string, string>*/ (props, "0:0"); Properties <string, string> stringprops = new Properties <string, string>(); PropertyVisitorGeneric <string, object> visitor = delegate(string key, object value) { stringprops.Insert(key, value.ToString()); }; pkcsprops.ForEach(visitor); return(stringprops); } }
public override Properties <string, string> GetValidCredentials(Properties <string, string> principal) { string userName = (string)principal.Find(KeyStoreAliasProp); Properties <string, string> props = new Properties <string, string>(); props.Insert(KeyStoreFileProp, GetKeyStoreDir(m_clientDataDir) + userName + ".keystore"); props.Insert(KeyStoreAliasProp, userName); props.Insert(KeyStorePasswordProp, "geode"); if (!IsMultiUserMode) { return(props); } else { Properties <string, object> pkcsprops = Pkcs.GetCredentials/*<string, string>*/ (props, "0:0"); Properties <string, string> stringprops = new Properties <string, string>(); PropertyVisitorGeneric <string, object> visitor = delegate(string key, object value) { stringprops.Insert(key, value.ToString()); }; pkcsprops.ForEach(visitor); return(stringprops); } }
/// <summary> /// Build the string to be passed to the cacheserver command for the given /// security authenticator/accessor properties. /// </summary> public static string GetServerArgs(string authenticator, string accessor, string accessorPP, Properties <string, string> extraProps, Properties <string, string> javaProps) { string args = string.Empty; if (authenticator != null && authenticator.Length > 0) { args += (" security-client-authenticator=" + authenticator); } if (accessor != null && accessor.Length > 0) { args += (" security-client-accessor=" + accessor); } if (accessorPP != null && accessorPP.Length > 0) { args += (" security-client-accessor-pp=" + accessorPP); } if (extraProps != null) { PropertyVisitorGeneric <string, string> visitor = delegate(string key, string value) { args += (' ' + key.ToString() + '=' + value); }; extraProps.ForEach(visitor); } if (javaProps != null) { PropertyVisitorGeneric <string, string> visitor = delegate(string key, string value) { args += (" -J-D" + key.ToString() + '=' + value); }; javaProps.ForEach(visitor); } args = args.Trim(); return(args); }