feat(Abstraktionen.Sicherheit): Schnittstellen für IRSACryptographer, IRSADecryptor und IRSAEncryptor erstellt.
This commit is contained in:
parent
c5b422921b
commit
8cc6fd95f7
@ -0,0 +1,9 @@
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace DigitalData.Core.Abstractions.Security
|
||||
{
|
||||
public interface IRSACryptographer
|
||||
{
|
||||
public RSAEncryptionPadding Padding { get; init; }
|
||||
}
|
||||
}
|
||||
13
DigitalData.Core.Abstractions/Security/IRSADecryptor.cs
Normal file
13
DigitalData.Core.Abstractions/Security/IRSADecryptor.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
13
DigitalData.Core.Abstractions/Security/IRSAEncryptor.cs
Normal file
13
DigitalData.Core.Abstractions/Security/IRSAEncryptor.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user