C# Класс System.Security.Cryptography.IncrementalHash

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AppendData ( byte data ) : void

Append the entire contents of data to the data already processed in the hash or HMAC.

AppendData ( byte data, int offset, int count ) : void

Append count bytes of data, starting at offset, to the data already processed in the hash or HMAC.

CreateHMAC ( HashAlgorithmName hashAlgorithm, byte key ) : IncrementalHash

Create an IncrementalHash for the Hash-based Message Authentication Code (HMAC) algorithm utilizing the hash algorithm specified by hashAlgorithm, and a key specified by key.

CreateHash ( HashAlgorithmName hashAlgorithm ) : IncrementalHash

Create an IncrementalHash for the algorithm specified by hashAlgorithm.

Dispose ( ) : void

Release all resources used by the current instance of the IncrementalHash class.

GetHashAndReset ( ) : byte[]

Retrieve the hash or HMAC for the data accumulated from prior calls to AppendData(byte[]), and return to the state the object was in at construction.

Приватные методы

Метод Описание
GetHMAC ( HashAlgorithmName hashAlgorithm, byte key ) : HashAlgorithm
GetHashAlgorithm ( HashAlgorithmName hashAlgorithm ) : HashAlgorithm
IncrementalHash ( HashAlgorithmName name, HashAlgorithm hash ) : System.Diagnostics

Описание методов

AppendData() публичный Метод

Append the entire contents of data to the data already processed in the hash or HMAC.
is null. The object has already been disposed.
public AppendData ( byte data ) : void
data byte The data to process.
Результат void

AppendData() публичный Метод

Append count bytes of data, starting at offset, to the data already processed in the hash or HMAC.
is null. /// is out of range. This parameter requires a non-negative number. /// /// is out of range. This parameter requires a non-negative number less than /// the value of . /// /// is greater than /// . - . /// The object has already been disposed.
public AppendData ( byte data, int offset, int count ) : void
data byte The data to process.
offset int The offset into the byte array from which to begin using data.
count int The number of bytes in the array to use as data.
Результат void

CreateHMAC() публичный статический Метод

Create an IncrementalHash for the Hash-based Message Authentication Code (HMAC) algorithm utilizing the hash algorithm specified by hashAlgorithm, and a key specified by key.
/// . is null, or /// the empty string. /// is not a known hash algorithm.
public static CreateHMAC ( HashAlgorithmName hashAlgorithm, byte key ) : IncrementalHash
hashAlgorithm HashAlgorithmName The name of the hash algorithm to perform within the HMAC.
key byte /// The secret key for the HMAC. The key can be any length, but a key longer than the output size /// of the hash algorithm specified by will be hashed (using the /// algorithm specified by ) to derive a correctly-sized key. Therefore, /// the recommended size of the secret key is the output size of the hash specified by /// . ///
Результат IncrementalHash

CreateHash() публичный статический Метод

Create an IncrementalHash for the algorithm specified by hashAlgorithm.
/// . is null, or /// the empty string. /// is not a known hash algorithm.
public static CreateHash ( HashAlgorithmName hashAlgorithm ) : IncrementalHash
hashAlgorithm HashAlgorithmName The name of the hash algorithm to perform.
Результат IncrementalHash

Dispose() публичный Метод

Release all resources used by the current instance of the IncrementalHash class.
public Dispose ( ) : void
Результат void

GetHashAndReset() публичный Метод

Retrieve the hash or HMAC for the data accumulated from prior calls to AppendData(byte[]), and return to the state the object was in at construction.
The object has already been disposed.
public GetHashAndReset ( ) : byte[]
Результат byte[]