IPasswordHasher<TUser> Interface

Provides an abstraction for hashing passwords.

Namespace
Microsoft.AspNetCore.Identity
Assemblies
  • Microsoft.AspNetCore.Identity

Syntax

public interface IPasswordHasher<TUser>
    where TUser : class
interface Microsoft.AspNetCore.Identity.IPasswordHasher<TUser>

Methods

HashPassword(TUser, System.String)

Returns a hashed representation of the supplied <em>password</em> for the specified <em>user</em>.

Arguments:
  • user (TUser) – The user whose password is to be hashed.
  • password (System.String) – The password to hash.
Return type:

System.String

Returns:

A hashed representation of the supplied <em>password</em> for the specified <em>user</em>.

string HashPassword(TUser user, string password)
VerifyHashedPassword(TUser, System.String, System.String)

Returns a Microsoft.AspNetCore.Identity.PasswordVerificationResult indicating the result of a password hash comparison.

Arguments:
  • user (TUser) – The user whose password should be verified.
  • hashedPassword (System.String) – The hash value for a user’s stored password.
  • providedPassword (System.String) – The password supplied for comparison.
Return type:

Microsoft.AspNetCore.Identity.PasswordVerificationResult

Returns:

A Microsoft.AspNetCore.Identity.PasswordVerificationResult indicating the result of a password hash comparison.

PasswordVerificationResult VerifyHashedPassword(TUser user, string hashedPassword, string providedPassword)