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