-
Notifications
You must be signed in to change notification settings - Fork 41
/
Gost_R3411_94_HMAC.cs
59 lines (47 loc) · 1.94 KB
/
Gost_R3411_94_HMAC.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System.Security;
using GostCryptography.Base;
using GostCryptography.Native;
namespace GostCryptography.Gost_R3411
{
/// <summary>
/// Реализация HMAC на базе алгоритма хэширования ГОСТ Р 34.11-94.
/// </summary>
public sealed class Gost_R3411_94_HMAC : Gost_R3411_HMAC<Gost_R3411_94_HashAlgorithm>
{
/// <summary>
/// Наименование алгоритма HMAC на базе ГОСТ Р 34.11-94.
/// </summary>
public const string AlgorithmNameValue = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:hmac-gostr3411";
/// <summary>
/// Устаревшее наименование алгоритма HMAC на базе ГОСТ Р 34.11-94.
/// </summary>
public const string ObsoleteAlgorithmNameValue = "http://www.w3.org/2001/04/xmldsig-more#hmac-gostr3411";
/// <summary>
/// Известные наименования алгоритма HMAC на базе ГОСТ Р 34.11-94.
/// </summary>
public static readonly string[] KnownAlgorithmNames = { AlgorithmNameValue, ObsoleteAlgorithmNameValue };
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_94_HMAC() : base(Gost_R3411_94_HashAlgorithm.DefaultHashSizeValue)
{
}
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_94_HMAC(ProviderType providerType) : base(providerType, Gost_R3411_94_HashAlgorithm.DefaultHashSizeValue)
{
}
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_94_HMAC(GostSymmetricAlgorithm keyAlgorithm) : base(keyAlgorithm, Gost_R3411_94_HashAlgorithm.DefaultHashSizeValue)
{
}
/// <inheritdoc />
public override string AlgorithmName => AlgorithmNameValue;
/// <inheritdoc />
[SecuritySafeCritical]
protected override SafeHashHandleImpl CreateHashHMAC(ProviderType providerType, SafeProvHandleImpl providerHandle, SafeKeyHandleImpl symKeyHandle)
{
return CryptoApiHelper.CreateHashHMAC_94(providerType, providerHandle, symKeyHandle);
}
}
}