Table of Contents

Class PasswordHashingArgon2

Namespace
GastroSky.Services.Passwords
Assembly
GastroSky.dll

Argon2 implementation of IPasswordHashing.

public sealed class PasswordHashingArgon2 : IPasswordHashing
Inheritance
PasswordHashingArgon2
Implements
Inherited Members

Constructors

PasswordHashingArgon2(IOptionsMonitor<Argon2Settings>)

Argon2 implementation of IPasswordHashing.

public PasswordHashingArgon2(IOptionsMonitor<Argon2Settings> optionsMonitor)

Parameters

optionsMonitor IOptionsMonitor<Argon2Settings>

Methods

HashPassword(string, PepperBrand?)

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

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

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.

public 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.

public 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.