feat(Abstraktionen.Sicherheit): Schnittstellen für IRSACryptographer, IRSADecryptor und IRSAEncryptor erstellt.

This commit is contained in:
Developer 02 2024-11-18 10:54:57 +01:00
parent c5b422921b
commit 8cc6fd95f7
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,9 @@
using System.Security.Cryptography;
namespace DigitalData.Core.Abstractions.Security
{
public interface IRSACryptographer
{
public RSAEncryptionPadding Padding { get; init; }
}
}

View File

@ -0,0 +1,13 @@
namespace DigitalData.Core.Abstractions.Security
{
public interface IRSADecryptor : IRSACryptographer
{
public string PrivateKeyPem { init; }
public IRSAEncryptor Encryptor { get; }
public byte[] Decrypt(byte[] data);
public string Decrypt(string data);
}
}

View File

@ -0,0 +1,13 @@
namespace DigitalData.Core.Abstractions.Security
{
public interface IRSAEncryptor : IRSACryptographer
{
public string PublicKeyPem { get; init; }
public byte[] Encrypt(byte[] data);
public string Encrypt(string data);
public bool Verify(string data, string signature) => Encrypt(data) == signature;
}
}