feat: Unterstützung für IRSADecryptor und Verwaltung der RSA-Entschlüsselung in den Klassen ICryptFactory und CryptFactory hinzugefügt
ICryptFactory: - `IRSADecryptor this[string key]`-Indexer für den Zugriff auf Entschlüssler per Schlüssel hinzugefügt. - Methode `TryGetRSADecryptor` für das sichere Abrufen von Entschlüsslern eingeführt. CryptFactory: - `IRSADecryptor`-Indexer für die Verwaltung von Entschlüsslern implementiert. - Ein `Decryptors`-Dictionary hinzugefügt, um RSA-Entschlüssler nach Schlüssel zu speichern. - Konstruktor aktualisiert, um `Decryptors` mit einem bereitgestellten oder leeren Dictionary zu initialisieren. - `TryGetRSADecryptor` zur Entschlüssler-Abfrage implementiert.
This commit is contained in:
@@ -4,19 +4,19 @@ namespace DigitalData.Core.Abstractions.Security
|
||||
{
|
||||
public interface ICryptFactory
|
||||
{
|
||||
public int KeySizeInBits { get; init; }
|
||||
int KeySizeInBits { get; init; }
|
||||
|
||||
public string PbePassword { init; }
|
||||
string PbePassword { init; }
|
||||
|
||||
public PbeEncryptionAlgorithm PbeEncryptionAlgorithm { get; init; }
|
||||
PbeEncryptionAlgorithm PbeEncryptionAlgorithm { get; init; }
|
||||
|
||||
public HashAlgorithmName PbeHashAlgorithmName { get; init; }
|
||||
HashAlgorithmName PbeHashAlgorithmName { get; init; }
|
||||
|
||||
public int PbeIterationCount { get; init; }
|
||||
int PbeIterationCount { get; init; }
|
||||
|
||||
public PbeParameters PbeParameters { get; }
|
||||
PbeParameters PbeParameters { get; }
|
||||
|
||||
public string EncryptedPrivateKeyPemLabel { get; init; }
|
||||
string EncryptedPrivateKeyPemLabel { get; init; }
|
||||
|
||||
string CreateRSAPrivateKeyPem(int? keySizeInBits = null);
|
||||
|
||||
@@ -26,5 +26,9 @@ namespace DigitalData.Core.Abstractions.Security
|
||||
PbeEncryptionAlgorithm? pbeEncryptionAlgorithm = null,
|
||||
HashAlgorithmName? hashAlgorithmName = null,
|
||||
int? iterationCount = null);
|
||||
|
||||
IRSADecryptor this[string key] { get; }
|
||||
|
||||
bool TryGetRSADecryptor(string key, out IRSADecryptor? decryptor);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user