CodeLiturgy.Dashboard/BlueWest.Api/Users/Auth/Crypto/IHasher.cs

33 lines
955 B
C#
Raw Normal View History

2022-09-10 00:33:17 +03:00
using BlueWest.WebApi.Context.Users;
using Microsoft.AspNetCore.Identity;
namespace BlueWest.Cryptography;
2022-09-11 01:22:04 +03:00
/// <summary>
/// IHasher contract
/// </summary>
internal interface IHasher : IPasswordHasher<ApplicationUser>
2022-09-10 00:33:17 +03:00
{
2022-09-11 01:22:04 +03:00
/// <summary>
/// Create hash
/// </summary>
/// <param name="text"></param>
/// <param name="algorithm"></param>
/// <returns></returns>
2022-09-10 00:33:17 +03:00
string CreateHash(string text, BaseCryptoItem.HashAlgorithm algorithm);
2022-09-11 01:22:04 +03:00
/// <summary>
/// Create hash
/// </summary>
/// <param name="text"></param>
/// <param name="salt"></param>
/// <param name="algorithm"></param>
/// <returns></returns>
2022-09-10 00:33:17 +03:00
string CreateHash(string text, string salt, BaseCryptoItem.HashAlgorithm algorithm);
2022-09-11 01:22:04 +03:00
/// <summary>
/// MatchesHash
/// </summary>
/// <param name="text"></param>
/// <param name="hash"></param>
/// <returns></returns>
2022-09-10 00:33:17 +03:00
bool MatchesHash(string text, string hash);
}