C# Class Aqueduct.Utils.HashService

Hash a plain string with given salt and compare the hashed strings with plain text.
Afficher le fichier Open project: aqueduct/Aqueduct.SitecoreLib

Méthodes publiques

Méthode Description
ComputeBase64Hash ( string plainText, string salt ) : string

hashes the given string with given salt to base 64 string

ComputeHash ( string plainText, string salt ) : string

hashes the given string with given salt to base 64 string

ComputeHexadecimalStringHash ( string plainText, string salt ) : string

hashes the given string with given salt to hexadecimal string

HashService ( ) : System

Default constructor that creates defaul hash algorithm to use

HashService ( HashAlgorithm hashAlgorithm ) : System

Constractor to pass a hash algorithm to using in hashing process

VerifyHash ( string plainText, string hashValue, string salt ) : bool

Verifies if the hashValue is hashed form of plainText with given salt

Private Methods

Méthode Description
GetHashBytes ( string plainText, string salt ) : byte[]

Method Details

ComputeBase64Hash() public méthode

hashes the given string with given salt to base 64 string
public ComputeBase64Hash ( string plainText, string salt ) : string
plainText string plain text to be hashed
salt string Salt that will be used in hashing
Résultat string

ComputeHash() public méthode

hashes the given string with given salt to base 64 string
public ComputeHash ( string plainText, string salt ) : string
plainText string plain text to be hashed
salt string Salt that will be used in hashing
Résultat string

ComputeHexadecimalStringHash() public méthode

hashes the given string with given salt to hexadecimal string
public ComputeHexadecimalStringHash ( string plainText, string salt ) : string
plainText string plain text to be hashed
salt string Salt that will be used in hashing
Résultat string

HashService() public méthode

Default constructor that creates defaul hash algorithm to use
public HashService ( ) : System
Résultat System

HashService() public méthode

Constractor to pass a hash algorithm to using in hashing process
public HashService ( HashAlgorithm hashAlgorithm ) : System
hashAlgorithm System.Security.Cryptography.HashAlgorithm
Résultat System

VerifyHash() public méthode

Verifies if the hashValue is hashed form of plainText with given salt
public VerifyHash ( string plainText, string hashValue, string salt ) : bool
plainText string Plain text to be verified
hashValue string Hash value to be verified
salt string Salt that will be used in hashing
Résultat bool