feat(RSAFactoryParams): Erstellt, um die Konfigurationen der RSA-Fabrik zu trennen

This commit is contained in:
Developer 02
2024-12-02 18:08:13 +01:00
parent f720ea9cd6
commit 5991444efd
4 changed files with 76 additions and 79 deletions

View File

@@ -1,9 +1,10 @@
using DigitalData.Core.Abstractions.Security;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace DigitalData.Core.Security
{
public class AsymCryptService : RSAFactory, IAsymCryptService, IRSAFactory
public class AsymCryptService<TRSAFactoryParams> : RSAFactory<TRSAFactoryParams>, IAsymCryptService, IRSAFactory<TRSAFactoryParams> where TRSAFactoryParams : RSAFactoryParams
{
private readonly IDictionary<string, IRSADecryptor> _decryptors;
@@ -11,7 +12,7 @@ namespace DigitalData.Core.Security
public Func<string, string, bool, Version?, string?, string> RSAKeyNameFormatter { get; }
public AsymCryptService(IDictionary<string, IRSADecryptor> decryptors, Func<string, string, bool, Version?, string?, string> rsaKeyNameFormatter, ILogger<AsymCryptService>? logger = null) : base()
public AsymCryptService(IOptions<TRSAFactoryParams> options, IDictionary<string, IRSADecryptor> decryptors, Func<string, string, bool, Version?, string?, string> rsaKeyNameFormatter, ILogger<AsymCryptService<TRSAFactoryParams>>? logger = null) : base(options)
{
_decryptors = decryptors ?? new Dictionary<string, IRSADecryptor>();