refactor(RSAFactory): Schaffung einer nicht-generischen, getrennten Schnittstelle, um eine statische Standardinstanz erstellen zu können.

- Statische Instanzklasse erstellt.
 - Geordnete DI-Registrierungsmethoden.
This commit is contained in:
Developer 02
2024-12-13 13:47:44 +01:00
parent 36f75d003a
commit 7459f05748
4 changed files with 53 additions and 11 deletions

View File

@@ -7,10 +7,6 @@ namespace DigitalData.Core.Security.Cryptographer
{
public class RSAFactory<TRSAFactoryParams> : IRSAFactory<TRSAFactoryParams> where TRSAFactoryParams : RSAFactoryParams
{
private static readonly Lazy<RSAFactory<RSAFactoryParams>> LazyInstance = new(() => new(Options.Create<RSAFactoryParams>(new())));
public static RSAFactory<RSAFactoryParams> Static => LazyInstance.Value;
protected readonly TRSAFactoryParams _params;
public RSAFactory(IOptions<TRSAFactoryParams> options) => _params = options.Value;