refactor(CryptographParams): umbenannt in CryptoFactoryParams

This commit is contained in:
Developer 02 2025-01-09 22:33:56 +01:00
parent 5981ba7a8d
commit 97c4f7bf8f
3 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@
namespace DigitalData.Core.Security.Config
{
public class CryptographParams : RSAFactoryParams
public class CryptoFactoryParams : RSAFactoryParams
{
public string PemDirectory { get; init; } = string.Empty;
@ -45,7 +45,7 @@ namespace DigitalData.Core.Security.Config
public RSADecryptor? VaultDecryptor { get; init; }
public CryptographParams()
public CryptoFactoryParams()
{
// init decryptors
AfterCreate += () =>

View File

@ -6,7 +6,7 @@ using Microsoft.Extensions.Options;
namespace DigitalData.Core.Security
{
public class CryptoFactory : RSAFactory<CryptographParams>, ICryptoFactory, IAsymmetricKeyFactory
public class CryptoFactory : RSAFactory<CryptoFactoryParams>, ICryptoFactory, IAsymmetricKeyFactory
{
public IEnumerable<IAsymmetricDecryptor> Decryptors { get; }
@ -17,7 +17,7 @@ namespace DigitalData.Core.Security
public IEnumerable<IAsymmetricTokenDescriptor> TokenDescriptors { get; init; } = new List<IAsymmetricTokenDescriptor>();
public CryptoFactory(IOptions<CryptographParams> options, ILogger<CryptoFactory>? logger = null) : base(options)
public CryptoFactory(IOptions<CryptoFactoryParams> options, ILogger<CryptoFactory>? logger = null) : base(options)
{
logger?.LogInformation("Core.Secrets version: {Version}, Created on: {CreationDate}.", Secrets.Version, Secrets.CreationDate.ToString("dd.MM.yyyy"));

View File

@ -14,7 +14,7 @@ namespace DigitalData.Core.Security
=> services.AddSingleton<IConfigureOptions<TParams>, ParamsConfigureOptions<TParams>>();
private static IServiceCollection AddCryptoFactory(this IServiceCollection services) => services
.AddParamsConfigureOptions<CryptographParams>()
.AddParamsConfigureOptions<CryptoFactoryParams>()
.AddAutoMapper(typeof(MappingProfile).Assembly)
.AddSingleton<ICryptoFactory, CryptoFactory>();
@ -25,7 +25,7 @@ namespace DigitalData.Core.Security
/// <param name="section"></param>
/// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns>
public static IServiceCollection AddCryptoFactory(this IServiceCollection services, IConfigurationSection section) => services
.Configure<CryptographParams>(section)
.Configure<CryptoFactoryParams>(section)
.AddCryptoFactory();
/// <summary>
@ -33,8 +33,8 @@ namespace DigitalData.Core.Security
/// </summary>
/// <param name="services"></param>
/// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns>
public static IServiceCollection AddCryptoFactory(this IServiceCollection services, CryptographParams? asymCryptParams = null) => services
.AddSingleton(Options.Create(asymCryptParams ?? new()))
public static IServiceCollection AddCryptoFactory(this IServiceCollection services, CryptoFactoryParams? factoryParams = null) => services
.AddSingleton(Options.Create(factoryParams ?? new()))
.AddCryptoFactory();
/// <summary>