refactor: Umbenennung von CryptoFactory in RSAPool und ICryptoFactory in IAsymmetricKeyPool

This commit is contained in:
Developer 02
2025-03-14 10:47:28 +01:00
parent 0523308083
commit b8de148c52
6 changed files with 30 additions and 32 deletions

View File

@@ -19,7 +19,7 @@ namespace DigitalData.Core.Security
public static IServiceCollection AddCryptoFactory(this IServiceCollection services, IConfiguration configuration) => services
.Configure<CryptoFactoryParams>(configuration)
.AddAutoMapper(typeof(MappingProfile).Assembly)
.AddSingleton<ICryptoFactory, CryptoFactory>()
.AddSingleton<IAsymmetricKeyPool, RSAPool>()
.AddSingleton<IAsymmetricKeyFactory, RSAFactory>()
.AddHostedService<PemFileInitalizer>();

View File

@@ -13,9 +13,9 @@ public class JwtSignatureHandler<TPrincipal> : JwtSecurityTokenHandler, IJwtSign
private readonly IMapper _mapper;
private readonly ICryptoFactory _cryptoFactory;
private readonly IAsymmetricKeyPool _cryptoFactory;
public JwtSignatureHandler(IOptions<ClaimDescriptor<TPrincipal>> claimDescriptorOptions, IMapper mapper, ICryptoFactory cryptoFactory)
public JwtSignatureHandler(IOptions<ClaimDescriptor<TPrincipal>> claimDescriptorOptions, IMapper mapper, IAsymmetricKeyPool cryptoFactory)
{
_claimDescriptor = claimDescriptorOptions.Value;
_mapper = mapper;

View File

@@ -5,7 +5,7 @@ using Microsoft.Extensions.Options;
namespace DigitalData.Core.Security.Services;
public class CryptoFactory : RSAFactory, ICryptoFactory, IAsymmetricKeyFactory
public class RSAPool : RSAFactory, IAsymmetricKeyPool, IAsymmetricKeyFactory
{
private readonly CryptoFactoryParams _params;
@@ -18,7 +18,7 @@ public class CryptoFactory : RSAFactory, ICryptoFactory, IAsymmetricKeyFactory
public IEnumerable<IAsymmetricTokenDescriptor> TokenDescriptors { get; init; } = new List<IAsymmetricTokenDescriptor>();
public CryptoFactory(IOptions<CryptoFactoryParams> cryptoFactoryParamsOptions, ILogger<CryptoFactory>? logger = null)
public RSAPool(IOptions<CryptoFactoryParams> cryptoFactoryParamsOptions, ILogger<RSAPool>? logger = null)
{
_params = cryptoFactoryParamsOptions.Value;