From d92475c2305d52cbe8b9f08b96554fe8d0ffbcac Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 18 Dec 2024 14:05:31 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Indexer=20hinzugef=C3=BCgt,=20um=20RSA-?= =?UTF-8?q?Dechiffrierer=20=C3=BCber=20den=20Index=20im=20AsymCryptService?= =?UTF-8?q?=20zuzugreifen=20-=20Neuer=20Indexer=20eingef=C3=BChrt,=20um=20?= =?UTF-8?q?den=20Zugriff=20auf=20Dechiffrierer=20=C3=BCber=20den=20Index?= =?UTF-8?q?=20zu=20erm=C3=B6glichen=20und=20so=20flexibleren=20Zugriff=20a?= =?UTF-8?q?uf=20Elemente=20in=20der=20Decryptors-Sammlung=20zu=20bieten.?= =?UTF-8?q?=20-=20Validierung=20der=20Indexgrenzen=20hinzugef=C3=BCgt,=20u?= =?UTF-8?q?m=20eine=20ArgumentOutOfRangeException=20zu=20werfen,=20wenn=20?= =?UTF-8?q?ein=20ung=C3=BCltiger=20Index=20angegeben=20wird.=20-=20Bestehe?= =?UTF-8?q?nde=20Funktionalit=C3=A4t=20zum=20Zugriff=20auf=20Dechiffrierer?= =?UTF-8?q?=20=C3=BCber=20den=20Schl=C3=BCssel=20beibehalten.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DigitalData.Core.Security/AsymCryptService.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DigitalData.Core.Security/AsymCryptService.cs b/DigitalData.Core.Security/AsymCryptService.cs index 3eafa0a..41539a2 100644 --- a/DigitalData.Core.Security/AsymCryptService.cs +++ b/DigitalData.Core.Security/AsymCryptService.cs @@ -31,6 +31,13 @@ namespace DigitalData.Core.Security } } + public IRSADecryptor this[int index] => index < 0 || index >= Decryptors.Count() + ? Decryptors.ElementAt(index) + : throw new ArgumentOutOfRangeException( + nameof(index), + index, + $"The index {index} is out of range. The valid indices for {GetType()} are between 0 and {Decryptors.Count() - 1} (inclusive). Please ensure the index is within this range."); + public AsymCryptService(IOptions options, ILogger>? logger = null) : base(options) { logger?.LogInformation("Core.Secrets version: {Version}, Created on: {CreationDate}.", Secrets.Version, Secrets.CreationDate.ToString("dd.MM.yyyy"));