refactor(DIExtensions): Umbenennung der Methode AddAsymCryptHandler in AddCryptograph

This commit is contained in:
Developer 02 2025-01-07 12:19:42 +01:00
parent 0f4b5430a3
commit b5cecac745

View File

@ -13,7 +13,7 @@ namespace DigitalData.Core.Security
private static IServiceCollection AddParamsConfigureOptions<TParams>(this IServiceCollection services) where TParams : RSAFactoryParams
=> services.AddSingleton<IConfigureOptions<TParams>, ParamsConfigureOptions<TParams>>();
private static IServiceCollection AddAsymCryptHandler(this IServiceCollection services) => services
private static IServiceCollection AddCryptograph(this IServiceCollection services) => services
.AddParamsConfigureOptions<CryptographParams>()
.AddAutoMapper(typeof(MappingProfile).Assembly)
.AddSingleton<ICryptograph, Cryptograph>();
@ -24,18 +24,18 @@ namespace DigitalData.Core.Security
/// <param name="services"></param>
/// <param name="section"></param>
/// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns>
public static IServiceCollection AddAsymCryptHandler(this IServiceCollection services, IConfigurationSection section) => services
public static IServiceCollection AddCryptograph(this IServiceCollection services, IConfigurationSection section) => services
.Configure<CryptographParams>(section)
.AddAsymCryptHandler();
.AddCryptograph();
/// <summary>
/// Registers an asym crypt service with the specified parameters from the given instance.
/// </summary>
/// <param name="services"></param>
/// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns>
public static IServiceCollection AddAsymCryptHandler(this IServiceCollection services, CryptographParams? asymCryptParams = null) => services
public static IServiceCollection AddCryptograph(this IServiceCollection services, CryptographParams? asymCryptParams = null) => services
.AddSingleton(Options.Create(asymCryptParams ?? new()))
.AddAsymCryptHandler();
.AddCryptograph();
/// <summary>
/// Registers a custom RSA Factory with specified parameters from the given configuration section.