CapyKit/Documentation/Help/M_CapyKit_Helpers_SecurityHelper_CompareHashedPassword.md

2.1 KiB

CompareHashedPassword(Password, String, Byte[], IPasswordAlgorithm, Object[]) Method

Compares an unencrypted password with a stored, encrypted existingPassword. This method uses the specified algorithm to retrieve the hashed version of the password and then compares it with the existingPassword.

Definition

Namespace: CapyKit.Helpers
Assembly: CapyKit (in CapyKit.dll) Version: 1.0.0

C#

public static bool CompareHashedPassword(
	Password existingPassword,
	string password,
	byte[] salt,
	IPasswordAlgorithm algorithm,
	params Object[] args
)

F#

static member CompareHashedPassword : 
        existingPassword : Password * 
        password : string * 
        salt : byte[] * 
        algorithm : IPasswordAlgorithm * 
        args : Object[] -> bool 

Parameters

  Password
The existing, encrypted password.
  String
The unencrypted password to be compared.
  Byte[]
The salt value used in password hashing.
  IPasswordAlgorithm
The password hashing algorithm.
  Object[]
Additional arguments required for constructing the password algorithm instance.

Return Value

Boolean
true if hash comparison succeeds, false if it fails.

See Also

Reference

SecurityHelper Class
CompareHashedPassword Overload
CapyKit.Helpers Namespace