Table of Contents

Interface IPasswordHashing

Namespace
GastroSky.Services.Passwords
Assembly
GastroSky.dll

Password hashing service.

public interface IPasswordHashing

Methods

HashPassword(string, PepperBrand?)

Hashes a password to make it feasible for insertion into a db.

Task<string> HashPassword(string password, PepperBrand? pepperBrand = null)

Parameters

password string

The password to hash.

pepperBrand PepperBrand

[OPTIONAL] Pepper brand to append to the PW.

Returns

Task<string>

The hashed string.

VerifyPassword(string, User)

Verifies a User's password.

Task<bool> VerifyPassword(string password, User user)

Parameters

password string

The password to verify.

user User

The user whose password needs to be verified.

Returns

Task<bool>

Whether the password is valid or not.

VerifyPassword(string, string)

Verifies a password against a hash.

Task<bool> VerifyPassword(string password, string hash)

Parameters

password string

The password to verify.

hash string

The hash to verify against.

Returns

Task<bool>

Whether the password is valid or not.