refactor(Privatekey): Die Klasse encryptor wurde erstellt und die Verschlüsselungsfunktionen wurden zur einfachen und sauberen Konfiguration dorthin verschoben.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user