update
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
namespace CMSMicroservice.Application.Common.Interfaces;
|
||||
public interface IHashService
|
||||
{
|
||||
// Computes a deterministic SHA-256 hex string for the given input (legacy helper)
|
||||
string ComputeSha256Hex(string input);
|
||||
// Compares plain input with a stored hex hash (case-insensitive) (legacy helper)
|
||||
bool VerifySha256Hex(string input, string? expectedHexHash);
|
||||
|
||||
// Computes HMAC-SHA256 hex using a provided secret (for OTP and similar)
|
||||
string ComputeHmacSha256Hex(string input, string secret);
|
||||
// Verifies input against expected HMAC-SHA256 hex using the secret
|
||||
bool VerifyHmacSha256Hex(string input, string? expectedHexHash, string secret);
|
||||
|
||||
// Creates a salted password hash using PBKDF2; returns an encoded string containing algorithm params and salt
|
||||
string HashPassword(string password);
|
||||
// Verifies a password against the stored hash; supports both PBKDF2 format and legacy SHA-256 hex
|
||||
bool VerifyPassword(string password, string? storedHash);
|
||||
}
|
||||
Reference in New Issue
Block a user