public bool TryLookup(byte[] username, out ScramUserCredential user) { lock (m_users) { return m_users.TryGetValue(new ReadonlyByteArray(username), out user); } }
public void AddUser(string username, string password, int iterations = 4000, int saltSize = 32, HashMethod hashMethod = HashMethod.Sha256) { var user = new ScramUserCredential(username, password, iterations, saltSize, hashMethod); lock (m_users) { m_users.Add(user.UserBytes, user); } }