refactor(AsymCryptParams): Umbenennen in CryptographParams.
This commit is contained in:
parent
7f2d2dadfa
commit
0f4b5430a3
@ -2,7 +2,7 @@
|
||||
|
||||
namespace DigitalData.Core.Security.Config
|
||||
{
|
||||
public class AsymCryptParams : RSAFactoryParams
|
||||
public class CryptographParams : RSAFactoryParams
|
||||
{
|
||||
public string PemDirectory { get; init; } = string.Empty;
|
||||
|
||||
@ -43,7 +43,7 @@ namespace DigitalData.Core.Security.Config
|
||||
|
||||
public RSAPrivateKey? VaultPrivateKey { get; init; }
|
||||
|
||||
public AsymCryptParams()
|
||||
public CryptographParams()
|
||||
{
|
||||
// init decryptors
|
||||
AfterCreate += () =>
|
||||
@ -6,7 +6,7 @@ using Microsoft.Extensions.Options;
|
||||
|
||||
namespace DigitalData.Core.Security
|
||||
{
|
||||
public class Cryptograph : RSAFactory<AsymCryptParams>, ICryptograph, IAsymmetricKeyFactory
|
||||
public class Cryptograph : RSAFactory<CryptographParams>, ICryptograph, IAsymmetricKeyFactory
|
||||
{
|
||||
public IEnumerable<IAsymmetricPrivateKey> PrivateKeys { get; }
|
||||
|
||||
@ -21,7 +21,7 @@ namespace DigitalData.Core.Security
|
||||
|
||||
public IEnumerable<TokenDescription> TokenDescriptions { get; init; } = new List<TokenDescription>();
|
||||
|
||||
public Cryptograph(IOptions<AsymCryptParams> options, ILogger<Cryptograph>? logger = null) : base(options)
|
||||
public Cryptograph(IOptions<CryptographParams> options, ILogger<Cryptograph>? logger = null) : base(options)
|
||||
{
|
||||
logger?.LogInformation("Core.Secrets version: {Version}, Created on: {CreationDate}.", Secrets.Version, Secrets.CreationDate.ToString("dd.MM.yyyy"));
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ namespace DigitalData.Core.Security
|
||||
=> services.AddSingleton<IConfigureOptions<TParams>, ParamsConfigureOptions<TParams>>();
|
||||
|
||||
private static IServiceCollection AddAsymCryptHandler(this IServiceCollection services) => services
|
||||
.AddParamsConfigureOptions<AsymCryptParams>()
|
||||
.AddParamsConfigureOptions<CryptographParams>()
|
||||
.AddAutoMapper(typeof(MappingProfile).Assembly)
|
||||
.AddSingleton<ICryptograph, Cryptograph>();
|
||||
|
||||
@ -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 AddAsymCryptHandler(this IServiceCollection services, IConfigurationSection section) => services
|
||||
.Configure<AsymCryptParams>(section)
|
||||
.Configure<CryptographParams>(section)
|
||||
.AddAsymCryptHandler();
|
||||
|
||||
/// <summary>
|
||||
@ -33,7 +33,7 @@ namespace DigitalData.Core.Security
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns>
|
||||
public static IServiceCollection AddAsymCryptHandler(this IServiceCollection services, AsymCryptParams? asymCryptParams = null) => services
|
||||
public static IServiceCollection AddAsymCryptHandler(this IServiceCollection services, CryptographParams? asymCryptParams = null) => services
|
||||
.AddSingleton(Options.Create(asymCryptParams ?? new()))
|
||||
.AddAsymCryptHandler();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user