Share via


Crypto.VerifyHashedPassword Method

Determines whether the specified RFC 2898 hash and password are a cryptographic match.

Namespace:  System.Web.Helpers
Assembly:  System.Web.Helpers (in System.Web.Helpers.dll)

Syntax

'Declaration
Public Shared Function VerifyHashedPassword ( _
    hashedPassword As String, _
    password As String _
) As Boolean
'Usage
Dim hashedPassword As String 
Dim password As String 
Dim returnValue As Boolean 

returnValue = Crypto.VerifyHashedPassword(hashedPassword, _
    password)
public static bool VerifyHashedPassword(
    string hashedPassword,
    string password
)
public:
static bool VerifyHashedPassword(
    String^ hashedPassword, 
    String^ password
)
static member VerifyHashedPassword : 
        hashedPassword:string * 
        password:string -> bool
public static function VerifyHashedPassword(
    hashedPassword : String, 
    password : String
) : boolean

Parameters

  • hashedPassword
    Type: System.String
    The previously-computed RFC 2898 hash value as a base-64-encoded string.
  • password
    Type: System.String
    The plaintext password to cryptographically compare with hashedPassword.

Return Value

Type: System.Boolean
true if the hash value is a cryptographic match for the password; otherwise, false.

Exceptions

Exception Condition
ArgumentNullException

hashedPassword or password is null reference (Nothing in Visual Basic).

See Also

Reference

Crypto Class

System.Web.Helpers Namespace

HashPassword(String)