using DigitalData.Core.Abstractions.Security.Key;
using DigitalData.Core.Security.RSAKey.Base;
using Microsoft.IdentityModel.Tokens;

namespace DigitalData.Core.Security.RSAKey.Auth;

public class RSATokenValidator : RSAPublicKey, IAsymmetricTokenValidator
{
    private readonly Lazy<RsaSecurityKey> _lazyRsaSecurityKey;

    public SecurityKey SecurityKey => _lazyRsaSecurityKey.Value;

    public RSATokenValidator()
    {
        _lazyRsaSecurityKey = new(() => new RsaSecurityKey(RSA));
    }
}