Add migrated to .NET 8.0 variant of Hcs.Client

This commit is contained in:
2025-09-26 19:48:32 +09:00
parent da127df8f6
commit 6cd2fb82e9
503 changed files with 223796 additions and 0 deletions

View File

@ -0,0 +1,51 @@
using GostCryptography.Base;
using GostCryptography.Gost_28147_89;
using GostCryptography.Native;
using System.Security;
namespace GostCryptography.Gost_R3411
{
/// <summary>
/// Реализация HMAC на базе алгоритма хэширования ГОСТ Р 34.11-2012/256
/// </summary>
public sealed class Gost_R3411_2012_256_HMAC : Gost_R3411_HMAC<Gost_R3411_2012_256_HashAlgorithm>
{
/// <summary>
/// Наименование алгоритма HMAC на базе ГОСТ Р 34.11-2012/256
/// </summary>
public const string AlgorithmNameValue = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:hmac-gostr34112012-256";
/// <summary>
/// Известные наименования алгоритма HMAC на базе ГОСТ Р 34.11-2012/256
/// </summary>
public static readonly string[] KnownAlgorithmNames = { AlgorithmNameValue };
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_2012_256_HMAC() : base(Gost_R3411_2012_256_HashAlgorithm.DefaultHashSizeValue)
{
}
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_2012_256_HMAC(ProviderType providerType) : base(providerType, Gost_R3411_2012_256_HashAlgorithm.DefaultHashSizeValue)
{
}
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_2012_256_HMAC(Gost_28147_89_SymmetricAlgorithmBase keyAlgorithm) : base(keyAlgorithm, Gost_R3411_2012_256_HashAlgorithm.DefaultHashSizeValue)
{
}
/// <inheritdoc />
public override string AlgorithmName => AlgorithmNameValue;
/// <inheritdoc />
[SecuritySafeCritical]
protected override SafeHashHandleImpl CreateHashHMAC(ProviderType providerType, SafeProvHandleImpl providerHandle, SafeKeyHandleImpl symKeyHandle)
{
return CryptoApiHelper.CreateHashHMAC_2012_256(providerType, providerHandle, symKeyHandle);
}
}
}