// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.AspNetCore.Identity { /// /// Provides an abstraction for hashing passwords. /// /// The type used to represent a user. public interface IPasswordHasher where TUser : class { /// /// Returns a hashed representation of the supplied for the specified . /// /// The user whose password is to be hashed. /// The password to hash. /// A hashed representation of the supplied for the specified . string HashPassword(TUser user, string password); /// /// Returns a indicating the result of a password hash comparison. /// /// The user whose password should be verified. /// The hash value for a user's stored password. /// The password supplied for comparison. /// A indicating the result of a password hash comparison. /// Implementations of this method should be time consistent. PasswordVerificationResult VerifyHashedPassword(TUser user, string hashedPassword, string providedPassword); } }