-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathGost_R3411_2012_512_PRF.cs
52 lines (41 loc) · 1.88 KB
/
Gost_R3411_2012_512_PRF.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
using System.Security;
using GostCryptography.Base;
namespace GostCryptography.Gost_R3411
{
/// <summary>
/// Реализация PRF на базе алгоритма хэширования ГОСТ Р 34.11-2012/512.
/// </summary>
public sealed class Gost_R3411_2012_512_PRF : Gost_R3411_PRF<Gost_R3411_2012_512_HMAC>
{
/// <summary>
/// Наименование алгоритма PRF на базе ГОСТ Р 34.11-2012/512 для использования в протоколе WS-Trust.
/// </summary>
public const string WsTrustAlgorithmNameValue = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:ck-p-gostr3411-2012-512";
/// <summary>
/// Наименование алгоритма PRF на базе ГОСТ Р 34.11-2012/512 для использования в протоколах на базе WS-SecureConversation.
/// </summary>
public const string WsSecureConversationAlgorithmNameValue = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:dk-p-gostr3411-2012-512";
/// <summary>
/// Известные наименования алгоритма PRF на базе ГОСТ Р 34.11-2012/512.
/// </summary>
public static readonly string[] KnownAlgorithmNames = { WsTrustAlgorithmNameValue, WsSecureConversationAlgorithmNameValue };
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_2012_512_PRF(GostSymmetricAlgorithm key, byte[] label, byte[] seed) : base(key, label, seed)
{
}
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_2012_512_PRF(ProviderType providerType, byte[] key, byte[] label, byte[] seed) : base(providerType, key, label, seed)
{
}
/// <inheritdoc />
public override string AlgorithmName => WsTrustAlgorithmNameValue;
/// <inheritdoc />
[SecuritySafeCritical]
protected override Gost_R3411_2012_512_HMAC CreateHMAC(GostSymmetricAlgorithm key)
{
return new Gost_R3411_2012_512_HMAC(key);
}
}
}