refactor: Mergen von Encryptors und Decryptors in eine einzelne Sammlung
- Kombiniert `Encryptors` und `Decryptors` in `cryptographers` für eine vereinfachte Initialisierung in `OnDeserialized`.
This commit is contained in:
parent
08ffe821ff
commit
0bfec426d4
@ -36,21 +36,23 @@ namespace DigitalData.Core.Security.Config
|
||||
{
|
||||
base.OnDeserialized();
|
||||
|
||||
foreach (var decryptor in Decryptors)
|
||||
var cryptographers = Encryptors.Cast<IRSACryptographer>().Concat(Decryptors.Cast<IRSACryptographer>());
|
||||
|
||||
foreach (var crypt in cryptographers)
|
||||
{
|
||||
// set default path
|
||||
if (decryptor.Pem is null)
|
||||
if (crypt.Pem is null)
|
||||
{
|
||||
decryptor.Directory ??= Directory;
|
||||
decryptor.FileName ??= string.Format(
|
||||
crypt.Directory ??= Directory;
|
||||
crypt.FileName ??= string.Format(
|
||||
FileNameFormat,
|
||||
decryptor.Issuer,
|
||||
decryptor.Audience,
|
||||
TypeTagOf(decryptor),
|
||||
crypt.Issuer,
|
||||
crypt.Audience,
|
||||
TypeTagOf(crypt),
|
||||
Secrets.Version);
|
||||
}
|
||||
}
|
||||
|
||||
decryptor.Init();
|
||||
crypt.Init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user