feat(Core.Security.DIExtensions): Arrangierte DI-Erweiterung

This commit is contained in:
Developer 02 2024-12-05 00:02:03 +01:00
parent 1a941b4728
commit 9396f48f46

View File

@ -6,11 +6,10 @@ namespace DigitalData.Core.Security
{ {
public static class DIExtensions public static class DIExtensions
{ {
public static IServiceCollection AddSecurity(this IServiceCollection services) public static IServiceCollection AddAsymCryptService<TAsymCryptParams>(this IServiceCollection services)
where TAsymCryptParams : AsymCryptParams
{ {
services.TryAddScoped<IRSAFactory>(sp => RSAFactory.Static); services.TryAddScoped<IAsymCryptService<TAsymCryptParams>, AsymCryptService<TAsymCryptParams>>();
services.TryAddScoped<IAsymCryptService, AsymCryptService>();
return services; return services;
} }
} }