Exemple #1
0
 /// <summary>
 /// Determines if this password matches this users current password hash
 /// </summary>
 /// <param name="password">The password to check against the current password hash</param>
 /// <returns>True if this new password + current salt == current PasswordHash</returns>
 public bool PasswordsMatch(string password)
 {
     return(UserUtils.DoPasswordsMatch(password, PasswordHash, Salt));
 }
Exemple #2
0
 /// <summary>
 /// Updates this users password by updating both the salt and passwordHash
 /// </summary>
 /// <param name="password">The new password to use for this user</param>
 public void UpdatePassword(string password)
 {
     Salt         = UserUtils.GenerateSalt();
     PasswordHash = UserUtils.HashPassword(password, Salt);
 }