refactor(DigitalData.Core.Security.RSAKey.Base): Ordnerverzeichnisse und Namespaces geordnet

This commit is contained in:
Developer 02
2025-03-14 12:32:40 +01:00
parent 9ec9bcd474
commit 192a93d153
40 changed files with 371 additions and 372 deletions

View File

@@ -0,0 +1,23 @@
using System.Security.Cryptography;
using DigitalData.Core.Abstractions.Security.Key;
namespace DigitalData.Core.Abstractions.Security.Services;
public interface IAsymmetricKeyFactory
{
string CreatePrivateKeyPem(int? keySizeInBits = null, bool encrypt = false);
string CreateEncryptedPrivateKeyPem(
PbeEncryptionAlgorithm? pbeEncryptionAlgorithm = null,
HashAlgorithmName? hashAlgorithmName = null,
int? iterationCount = null,
int? keySizeInBits = null,
string? password = null);
string CreateEncryptedPrivateKeyPem(
PbeParameters pbeParameters,
int? keySizeInBits = null,
string? password = null);
IAsymmetricDecryptor CreateDecryptor(string pem, string? issuer = null, string? audience = null, bool encrypt = false, RSAEncryptionPadding? padding = null);
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstractions.Security.Key;
namespace DigitalData.Core.Abstractions.Security.Services;
public interface IAsymmetricKeyPool : IAsymmetricKeyFactory
{
IEnumerable<IAsymmetricDecryptor> Decryptors { get; }
IAsymmetricDecryptor VaultDecryptor { get; }
IEnumerable<IAsymmetricTokenDescriptor> TokenDescriptors { get; }
}

View File

@@ -0,0 +1,16 @@
using DigitalData.Core.Abstractions.Security.Key;
using Microsoft.IdentityModel.Tokens;
namespace DigitalData.Core.Abstractions.Security.Services
{
public interface IJwtSignatureHandler<TPrincipal>
{
SecurityToken CreateToken(SecurityTokenDescriptor tokenDescriptor);
SecurityToken CreateToken(TPrincipal subject, IAsymmetricTokenDescriptor descriptor);
SecurityToken CreateToken(TPrincipal subject, string issuer, string audience);
string WriteToken(SecurityToken token);
}
}