feat(RSACryptographerList): Hinzufügen der Methode try get mit dem Wort out-key
This commit is contained in:
parent
738005f5dc
commit
016d8bdcf2
@ -19,6 +19,12 @@ namespace DigitalData.Core.Security.Cryptographer
|
|||||||
=> _cryptographers.SingleOrDefault(crypt => _keyGenerator(crypt) == key)
|
=> _cryptographers.SingleOrDefault(crypt => _keyGenerator(crypt) == key)
|
||||||
?? throw new InvalidOperationException($"No {typeof(TRSACryptographer).GetType().Name.TrimStart('I')} found with Key: {key}.");
|
?? throw new InvalidOperationException($"No {typeof(TRSACryptographer).GetType().Name.TrimStart('I')} found with Key: {key}.");
|
||||||
|
|
||||||
|
public bool TryGet(string key, out TRSACryptographer? cryptographer)
|
||||||
|
{
|
||||||
|
cryptographer = _cryptographers.SingleOrDefault(crypt => _keyGenerator(crypt) == key);
|
||||||
|
return cryptographer is not null;
|
||||||
|
}
|
||||||
|
|
||||||
public IEnumerator<TRSACryptographer> GetEnumerator() => _cryptographers.GetEnumerator();
|
public IEnumerator<TRSACryptographer> GetEnumerator() => _cryptographers.GetEnumerator();
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user