refactor(AsymCryptService): Methode Default.get hinzugefügt, um den ersten Decryptor zu erhalten.

- Wirft InvalidOperationException, wenn kein Decryptor verfügbar ist.
This commit is contained in:
Developer 02 2024-12-16 10:54:48 +01:00
parent 324a5bdb1e
commit b32f0df125

View File

@ -12,6 +12,13 @@ namespace DigitalData.Core.Security
{
public IEnumerable<IRSADecryptor> Decryptors => _params.Decryptors;
public IRSADecryptor Default => Decryptors.FirstOrDefault()
?? throw new InvalidOperationException(
"No default decryptor is available. Ensure that at least one decryptor is configured in the provided parameters. " +
"This issue typically arises if the configuration for decryptors is incomplete or missing. " +
"Check the 'Decryptors' collection in the configuration and verify that it contains valid entries."
);
public IRSADecryptor this[string key]
{
get