Files
Dec2017-Script-Dump/mscorlib/System/Security/Cryptography/HMACSHA256.cs
T
2026-06-04 11:42:34 +02:00

31 lines
1.4 KiB
C#

using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// <summary>Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.SHA256" /> hash function.</summary>
// Token: 0x02000505 RID: 1285
[ComVisible(true)]
public class HMACSHA256 : HMAC
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA256" /> class with a randomly generated key.</summary>
// Token: 0x06002F63 RID: 12131 RVA: 0x00098B68 File Offset: 0x00096D68
public HMACSHA256()
: this(KeyBuilder.Key(8))
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA256" /> class with the specified key data.</summary>
/// <param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA256" /> encryption. The key can be any length, but if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is null. </exception>
// Token: 0x06002F64 RID: 12132 RVA: 0x00098B78 File Offset: 0x00096D78
public HMACSHA256(byte[] key)
{
base.HashName = "SHA256";
this.HashSizeValue = 256;
this.Key = key;
}
}
}