using Microsoft.AspNetCore.Identity; using SCM.Application.Authentication; namespace SCM.Infrastructure.Security; /// Usa o do ASP.NET Core (PBKDF2 com salt). public sealed class PasswordHasherService : IPasswordHasherService { private static readonly object Placeholder = new(); private readonly PasswordHasher _hasher = new(); public string Hash(string password) => _hasher.HashPassword(Placeholder, password); public bool Verify(string passwordHash, string providedPassword) => _hasher.VerifyHashedPassword(Placeholder, passwordHash, providedPassword) != PasswordVerificationResult.Failed; }