using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using System; namespace StellaOps.Cryptography.Plugin.Pkcs11Gost; public static class Pkcs11CryptoServiceCollectionExtensions { public static IServiceCollection AddPkcs11GostProvider( this IServiceCollection services, Action? configure = null) { ArgumentNullException.ThrowIfNull(services); if (configure is not null) { services.Configure(configure); } services.TryAddEnumerable( ServiceDescriptor.Singleton()); return services; } }