refactor(RSATokenDescriptor): In die Abstraktionsschicht verschoben und in PrivateKeyTokenDescriptor umbenannt

This commit is contained in:
Developer 02
2025-01-07 16:34:19 +01:00
parent dc45cf2c08
commit 34e14fd2f5
6 changed files with 17 additions and 15 deletions

View File

@@ -1,5 +1,4 @@
using DigitalData.Core.Abstractions.Security;
using DigitalData.Core.Security.Config;
using Microsoft.IdentityModel.Tokens;
using System.Security.Cryptography;
@@ -29,11 +28,11 @@ namespace DigitalData.Core.Security.RSAKey
public IAsymmetricPublicKey PublicKey => _lazyPublicKey.Value;
private RSATokenDescriptor? _tokenDescriptor;
private PrivateKeyTokenDescriptor? _tokenDescriptor;
private readonly Lazy<RSATokenDescriptor?> _descLazyInitter;
private readonly Lazy<PrivateKeyTokenDescriptor?> _descriptorInitiator;
public RSATokenDescriptor? TokenDescriptor { get => _descLazyInitter.Value; init => _tokenDescriptor = value; }
public PrivateKeyTokenDescriptor? TokenDescriptor { get => _descriptorInitiator.Value; init => _tokenDescriptor = value; }
public RSAPrivateKey()
{
@@ -43,7 +42,7 @@ namespace DigitalData.Core.Security.RSAKey
Padding = Padding
});
_descLazyInitter = new(() =>
_descriptorInitiator = new(() =>
{
if(_tokenDescriptor is not null)
{