Files
git.stella-ops.org/src/__Libraries/StellaOps.Cryptography.Plugin.Pkcs11Gost/Pkcs11CryptoServiceCollectionExtensions.cs
2026-02-01 21:37:40 +02:00

27 lines
739 B
C#

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<Pkcs11GostProviderOptions>? configure = null)
{
ArgumentNullException.ThrowIfNull(services);
if (configure is not null)
{
services.Configure(configure);
}
services.TryAddEnumerable(
ServiceDescriptor.Singleton<StellaOps.Cryptography.ICryptoProvider, Pkcs11GostCryptoProvider>());
return services;
}
}