IPasswordHasher Interface

Summary

Provides an abstraction for hashing passwords.

Syntax

public interface IPasswordHasher

GitHub

View on GitHub

interface Microsoft.AspNet.Identity.IPasswordHasher

Methods

HashPassword<TUser>(TUser, System.String)

Returns a hashed representation of the supplied password for the specified user.

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 <paramref name=”password” /> for the specified <paramref name=”user” />.

string HashPassword<TUser>(TUser user, string password)where TUser : class
VerifyHashedPassword<TUser>(TUser, System.String, System.String)

Returns a Microsoft.AspNet.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.AspNet.Identity.PasswordVerificationResult

Returns:

A <see cref=”T:Microsoft.AspNet.Identity.PasswordVerificationResult” /> indicating the result of a password hash comparison.

PasswordVerificationResult VerifyHashedPassword<TUser>(TUser user, string hashedPassword, string providedPassword)where TUser : class