refactor(IRSAFactory): umbenannt in IAsymmetricKey

This commit is contained in:
Developer 02 2025-01-07 11:48:27 +01:00
parent 09dae1b1ac
commit e8c98115b6
6 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
namespace DigitalData.Core.Abstractions.Security namespace DigitalData.Core.Abstractions.Security
{ {
public interface IAsymCryptHandler : IRSAFactory public interface IAsymCryptHandler : IAsymmetricKeyFactory
{ {
IEnumerable<IAsymmetricPrivateKey> PrivateKeys { get; } IEnumerable<IAsymmetricPrivateKey> PrivateKeys { get; }

View File

@ -2,7 +2,7 @@
namespace DigitalData.Core.Abstractions.Security namespace DigitalData.Core.Abstractions.Security
{ {
public interface IRSAFactory public interface IAsymmetricKeyFactory
{ {
string CreatePrivateKeyPem(int? keySizeInBits = null, bool encrypt = false); string CreatePrivateKeyPem(int? keySizeInBits = null, bool encrypt = false);

View File

@ -6,7 +6,7 @@ using Microsoft.Extensions.Options;
namespace DigitalData.Core.Security namespace DigitalData.Core.Security
{ {
public class AsymCryptHandler : RSAFactory<AsymCryptParams>, IAsymCryptHandler, IRSAFactory public class AsymCryptHandler : RSAFactory<AsymCryptParams>, IAsymCryptHandler, IAsymmetricKeyFactory
{ {
public IEnumerable<IAsymmetricPrivateKey> PrivateKeys { get; } public IEnumerable<IAsymmetricPrivateKey> PrivateKeys { get; }

View File

@ -5,7 +5,7 @@ using System.Security.Cryptography;
namespace DigitalData.Core.Security.Cryptographer namespace DigitalData.Core.Security.Cryptographer
{ {
public class RSAFactory<TRSAFactoryParams> : IRSAFactory where TRSAFactoryParams : RSAFactoryParams public class RSAFactory<TRSAFactoryParams> : IAsymmetricKeyFactory where TRSAFactoryParams : RSAFactoryParams
{ {
protected readonly TRSAFactoryParams _params; protected readonly TRSAFactoryParams _params;

View File

@ -46,7 +46,7 @@ namespace DigitalData.Core.Security
public static IServiceCollection AddRSAFactory(this IServiceCollection services, IConfigurationSection section) => services public static IServiceCollection AddRSAFactory(this IServiceCollection services, IConfigurationSection section) => services
.AddParamsConfigureOptions<RSAFactoryParams>() .AddParamsConfigureOptions<RSAFactoryParams>()
.Configure<RSAFactoryParams>(section) .Configure<RSAFactoryParams>(section)
.AddSingleton<IRSAFactory, RSAFactory<RSAFactoryParams>>(); .AddSingleton<IAsymmetricKeyFactory, RSAFactory<RSAFactoryParams>>();
private static IServiceCollection AddClaimDescriptor<TPrincipal>(this IServiceCollection services, private static IServiceCollection AddClaimDescriptor<TPrincipal>(this IServiceCollection services,
Func<TPrincipal, IDictionary<string, object>>? claimsMapper = null, Func<TPrincipal, IDictionary<string, object>>? claimsMapper = null,

View File

@ -9,6 +9,6 @@ namespace DigitalData.Core.Security
{ {
private static readonly Lazy<RSAFactory<RSAFactoryParams>> LazyInstance = new(() => new(Options.Create<RSAFactoryParams>(new()))); private static readonly Lazy<RSAFactory<RSAFactoryParams>> LazyInstance = new(() => new(Options.Create<RSAFactoryParams>(new())));
public static IRSAFactory RSAFactory => LazyInstance.Value; public static IAsymmetricKeyFactory RSAFactory => LazyInstance.Value;
} }
} }