refactor(Privatekey): Die Klasse encryptor wurde erstellt und die Verschlüsselungsfunktionen wurden zur einfachen und sauberen Konfiguration dorthin verschoben.

This commit is contained in:
Developer 02
2025-01-08 20:03:25 +01:00
parent 9f0facc487
commit 7a938f0379
14 changed files with 67 additions and 33 deletions

View File

@@ -15,9 +15,9 @@ namespace DigitalData.Core.Security
/// </summary>
public IAsymmetricDecryptor VaultDecryptor { get; }
private readonly Lazy<IEnumerable<IAsymmetricPublicKey>> _lazyPublicKeys;
private readonly Lazy<IEnumerable<IAsymmetricEncryptor>> _lazyEncryptors;
public IEnumerable<IAsymmetricPublicKey> PublicKeys => _lazyPublicKeys.Value;
public IEnumerable<IAsymmetricEncryptor> Encryptors => _lazyEncryptors.Value;
public IEnumerable<PrivateKeyTokenDescriptor> TokenDescriptions { get; init; } = new List<PrivateKeyTokenDescriptor>();
@@ -36,7 +36,7 @@ namespace DigitalData.Core.Security
VaultDecryptor = _params.VaultDecryptor ?? Decryptors.First();
_lazyPublicKeys = new(Decryptors.Select(decryptor => decryptor.PublicKey));
_lazyEncryptors = new(Decryptors.Select(decryptor => decryptor.Encryptor));
}
}
}