stabilizaiton work - projects rework for maintenanceability and ui livening

This commit is contained in:
master
2026-02-03 23:40:04 +02:00
parent 074ce117ba
commit 557feefdc3
3305 changed files with 186813 additions and 107843 deletions

View File

@@ -0,0 +1,67 @@
using StellaOps.Cryptography;
using StellaOps.Cryptography.DependencyInjection;
using StellaOps.Cryptography.Plugin.Pkcs11Gost;
using System;
#if STELLAOPS_CRYPTO_PRO
using StellaOps.Cryptography.Plugin.CryptoPro;
#endif
namespace StellaOps.Configuration;
public static partial class StellaOpsCryptoServiceCollectionExtensions
{
private static void ApplyRegistry(
CryptoProviderRegistryOptions target,
CryptoProviderRegistryOptions source)
{
target.ActiveProfile = source.ActiveProfile;
target.PreferredProviders.Clear();
foreach (var provider in source.PreferredProviders)
{
if (!string.IsNullOrWhiteSpace(provider))
{
target.PreferredProviders.Add(provider.Trim());
}
}
target.Profiles.Clear();
foreach (var kvp in source.Profiles)
{
if (kvp.Value is null)
{
continue;
}
var profile = new CryptoProviderProfileOptions();
foreach (var provider in kvp.Value.PreferredProviders)
{
if (!string.IsNullOrWhiteSpace(provider))
{
profile.PreferredProviders.Add(provider.Trim());
}
}
target.Profiles[kvp.Key] = profile;
}
}
private static void CopyPkcs11Options(Pkcs11GostProviderOptions target, Pkcs11GostProviderOptions source)
{
target.Keys.Clear();
foreach (var key in source.Keys)
{
target.Keys.Add(key.Clone());
}
}
#if STELLAOPS_CRYPTO_PRO
private static void CopyCryptoProOptions(CryptoProGostProviderOptions target, CryptoProGostProviderOptions source)
{
target.Keys.Clear();
foreach (var key in source.Keys)
{
target.Keys.Add(key.Clone());
}
}
#endif
}