refactor(IRSAFactory): umbenannt in IAsymmetricKey
This commit is contained in:
parent
09dae1b1ac
commit
e8c98115b6
@ -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; }
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
@ -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; }
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user