using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
/// Represents the abstract class from which all implementations of keyed hash algorithms must derive.
// Token: 0x0200050D RID: 1293
[ComVisible(true)]
public abstract class KeyedHashAlgorithm : HashAlgorithm
{
// Token: 0x06002F93 RID: 12179 RVA: 0x000990DC File Offset: 0x000972DC
~KeyedHashAlgorithm()
{
this.Dispose(false);
}
/// Gets or sets the key to use in the hash algorithm.
/// The key to use in the hash algorithm.
/// An attempt was made to change the property after hashing has begun.
// Token: 0x1700096B RID: 2411
// (get) Token: 0x06002F94 RID: 12180 RVA: 0x00099118 File Offset: 0x00097318
// (set) Token: 0x06002F95 RID: 12181 RVA: 0x0009912C File Offset: 0x0009732C
public virtual byte[] Key
{
get
{
return (byte[])this.KeyValue.Clone();
}
set
{
if (this.State != 0)
{
throw new CryptographicException(Locale.GetText("Key can't be changed at this state."));
}
this.ZeroizeKey();
this.KeyValue = (byte[])value.Clone();
}
}
/// Releases the unmanaged resources used by the and optionally releases the managed resources.
/// true to release both managed and unmanaged resources; false to release only unmanaged resources.
// Token: 0x06002F96 RID: 12182 RVA: 0x0009916C File Offset: 0x0009736C
protected override void Dispose(bool disposing)
{
this.ZeroizeKey();
base.Dispose(disposing);
}
// Token: 0x06002F97 RID: 12183 RVA: 0x0009917C File Offset: 0x0009737C
private void ZeroizeKey()
{
if (this.KeyValue != null)
{
Array.Clear(this.KeyValue, 0, this.KeyValue.Length);
}
}
/// Creates an instance of the default implementation of a keyed hash algorithm.
/// A new instance, unless the default settings have been changed.
///
///
///
// Token: 0x06002F98 RID: 12184 RVA: 0x000991A0 File Offset: 0x000973A0
public new static KeyedHashAlgorithm Create()
{
return KeyedHashAlgorithm.Create("System.Security.Cryptography.KeyedHashAlgorithm");
}
/// Creates an instance of the specified implementation of a keyed hash algorithm.
/// A new instance of the specified keyed hash algorithm.
/// The keyed hash algorithm implementation to use. The following table shows the valid values for the parameter and the algorithms they map to.Parameter valueImplements System.Security.Cryptography.HMACSystem.Security.Cryptography.KeyedHashAlgorithmHMACMD5System.Security.Cryptography.HMACMD5HMACRIPEMD160System.Security.Cryptography.HMACRIPEMD160HMACSHA1System.Security.Cryptography.HMACSHA1HMACSHA256System.Security.Cryptography.HMACSHA256HMACSHA384System.Security.Cryptography.HMACSHA384HMACSHA512System.Security.Cryptography.HMACSHA512MACTripleDESSystem.Security.Cryptography.MACTripleDES
// Token: 0x06002F99 RID: 12185 RVA: 0x000991AC File Offset: 0x000973AC
public new static KeyedHashAlgorithm Create(string algName)
{
return (KeyedHashAlgorithm)CryptoConfig.CreateFromName(algName);
}
/// The key to use in the hash algorithm.
// Token: 0x04001364 RID: 4964
protected byte[] KeyValue;
}
}