refactor(IRSAFactory): Erstellt, um die Funktionalität von RSAFactory zu trennen
This commit is contained in:
@@ -3,7 +3,7 @@ using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DigitalData.Core.Security
|
||||
{
|
||||
public class AsymCryptService : RSAFactory, IAsymCryptService
|
||||
public class AsymCryptService : RSAFactory, IAsymCryptService, IRSAFactory
|
||||
{
|
||||
private readonly IDictionary<string, IRSADecryptor> _decryptors;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace DigitalData.Core.Security
|
||||
|
||||
public Func<string, string, bool, Version?, string?, string> RSAKeyNameFormatter { get; }
|
||||
|
||||
public AsymCryptService(ILogger<AsymCryptService> logger, IDictionary<string, IRSADecryptor> decryptors, Func<string, string, bool, Version?, string?, string> rsaKeyNameFormatter) : base()
|
||||
public AsymCryptService(IDictionary<string, IRSADecryptor> decryptors, Func<string, string, bool, Version?, string?, string> rsaKeyNameFormatter, ILogger<AsymCryptService>? logger = null) : base()
|
||||
{
|
||||
_decryptors = decryptors ?? new Dictionary<string, IRSADecryptor>();
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace DigitalData.Core.Security
|
||||
{
|
||||
public static IServiceCollection AddSecurity(this IServiceCollection services)
|
||||
{
|
||||
services.TryAddScoped<IRSAFactory>(sp => RSAFactory.Static);
|
||||
services.TryAddScoped<IAsymCryptService, AsymCryptService>();
|
||||
|
||||
return services;
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Text;
|
||||
|
||||
namespace DigitalData.Core.Security
|
||||
{
|
||||
public class RSAFactory
|
||||
public class RSAFactory : IRSAFactory
|
||||
{
|
||||
private static readonly Lazy<RSAFactory> LazyInstance = new(() => new());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user