Refactor(Core.Security): Getrennte Pem-Eigenschaften für öffentliche und private Schlüssel wurden entfernt.

- Pem-Eigenschaft in der Hauptklasse RSACryptographer erstellt
This commit is contained in:
Developer 02
2024-11-18 14:39:18 +01:00
parent 6ff0d0a876
commit eccf2b32ce
6 changed files with 11 additions and 14 deletions

View File

@@ -5,10 +5,9 @@ namespace DigitalData.Core.Security
{
public class RSAEncryptor : RSACryptographer, IRSAEncryptor, IRSACryptographer
{
public required string PublicKeyPem
public RSAEncryptor()
{
get => _rsa.ExportRSAPublicKeyPem();
init => _rsa.ImportFromPem(value);
_rsa.ImportFromPem(Pem);
}
public byte[] Encrypt(byte[] data) => _rsa.Encrypt(data, Padding);