Skip to main content

PasswordHasher

The Password Hasher provider used to hash users passwords which uses the same algorithm used by ASP.NET Identity v3: PBKDF2 with HMAC-SHA256, 128-bit salt, 256-bit subkey, 10000 iterations.

Assembly: ServiceStack.dll
View Source
Declaration
public class PasswordHasher : IPasswordHasher

Properties

IterationCount

Gets the number of iterations used when hashing passwords using PBKDF2. Default is 10,000.

View Source
Declaration
public int IterationCount { get; }

Version

The Format Version specifier for this PasswordHasher embedded as the first byte in password hashes.

View Source
Declaration
public byte Version { get; }

Fields

Log

View Source
Declaration
public static ILog Log

DefaultIterationCount

View Source
Declaration
public const int DefaultIterationCount = 10000

Methods

VerifyPassword(String, String, out Boolean)

View Source
Declaration
public bool VerifyPassword(string hashedPassword, string providedPassword, out bool needsRehash)
Returns

System.Boolean

Parameters
TypeName
System.StringhashedPassword
System.StringprovidedPassword
System.BooleanneedsRehash

HashPassword(String)

Returns a hashed representation of the supplied <code data-dev-comment-type="paramref" class="paramref">password</code> for the specified user.

View Source
Declaration
public virtual string HashPassword(string password)
Returns

System.String: A hashed representation of the supplied <code data-dev-comment-type="paramref" class="paramref">password</code> for the specified user.

Parameters
TypeNameDescription
System.StringpasswordThe password to hash.

|

Implements