View Source
Class LegacyPasswordSecurity
Handles password hashing and formatting for legacy hashing algorithms.
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public class LegacyPasswordSecurity
Methods
View Source
Declaration
public string FormatPasswordForStorage(string algorithmType, string hashedPassword, string salt)
Parameters
Type |
Name |
Description |
System.String |
algorithmType |
|
System.String |
hashedPassword |
|
System.String |
salt |
|
Returns
Type |
Description |
System.String |
|
View Source
GenerateSalt()
Declaration
public static string GenerateSalt()
Returns
Type |
Description |
System.String |
|
View Source
HashNewPassword(String, String, out String)
Create a new password hash and a new salt
Declaration
public string HashNewPassword(string algorithm, string newPassword, out string salt)
Parameters
Type |
Name |
Description |
System.String |
algorithm |
The hashing algorithm for the password.
|
System.String |
newPassword |
|
System.String |
salt |
|
Returns
Type |
Description |
System.String |
|
View Source
HashPasswordForStorage(String, String)
Declaration
public string HashPasswordForStorage(string algorithmType, string password)
Parameters
Type |
Name |
Description |
System.String |
algorithmType |
|
System.String |
password |
|
Returns
Type |
Description |
System.String |
|
View Source
ParseStoredHashPassword(String, String, out String)
Parses out the hashed password and the salt from the stored password string value
Declaration
public string ParseStoredHashPassword(string algorithm, string storedString, out string salt)
Parameters
Type |
Name |
Description |
System.String |
algorithm |
The hashing algorithm for the stored password.
|
System.String |
storedString |
|
System.String |
salt |
returns the salt
|
Returns
Type |
Description |
System.String |
|
View Source
SupportHashAlgorithm(String)
Declaration
public bool SupportHashAlgorithm(string algorithm)
Parameters
Type |
Name |
Description |
System.String |
algorithm |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
VerifyLegacyHashedPassword(String, String)
Verify a legacy hashed password (HMACSHA1)
Declaration
public bool VerifyLegacyHashedPassword(string password, string dbPassword)
Parameters
Type |
Name |
Description |
System.String |
password |
|
System.String |
dbPassword |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
VerifyPassword(String, String, String)
Verifies if the password matches the expected hash+salt of the stored password string
Declaration
public bool VerifyPassword(string algorithm, string password, string dbPassword)
Parameters
Type |
Name |
Description |
System.String |
algorithm |
The hashing algorithm for the stored password.
|
System.String |
password |
The password.
|
System.String |
dbPassword |
The value of the password stored in a data store.
|
Returns
Type |
Description |
System.Boolean |
|