refactor(Privatekey): Die Klasse decryptor wurde erstellt und die Verschlüsselungsfunktionen für eine einfache und saubere Konfiguration dorthin verschoben.

This commit is contained in:
Developer 02
2025-01-08 18:45:36 +01:00
parent 608d266d1c
commit 9f0facc487
11 changed files with 43 additions and 30 deletions

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Security;
namespace DigitalData.Core.Security.RSAKey
{
public class RSADecryptor : RSAPrivateKey, IAsymmetricDecryptor
{
public byte[] Decrypt(byte[] data) => RSA.Decrypt(data, Padding);
}
}

View File

@@ -54,10 +54,6 @@ namespace DigitalData.Core.Security.RSAKey
});
}
public byte[] Decrypt(byte[] data) => RSA.Decrypt(data, Padding);
public string Decrypt(string data) => RSA.Decrypt(data.Base64ToByte(), Padding).BytesToString();
internal void SetPem(string pem)
{
_pem = pem;