diff --git a/DigitalData.Core.Security/AsymCryptService.cs b/DigitalData.Core.Security/AsymCryptService.cs index 82cf984..e5d24a4 100644 --- a/DigitalData.Core.Security/AsymCryptService.cs +++ b/DigitalData.Core.Security/AsymCryptService.cs @@ -12,6 +12,13 @@ namespace DigitalData.Core.Security { public IEnumerable 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