CryptoProviderFactory.CreateKeyedHashAlgorithm(Byte[], String) Method

Definition

Returns a KeyedHashAlgorithm for a specific algorithm.

public virtual System.Security.Cryptography.KeyedHashAlgorithm CreateKeyedHashAlgorithm (byte[] keyBytes, string algorithm);
abstract member CreateKeyedHashAlgorithm : byte[] * string -> System.Security.Cryptography.KeyedHashAlgorithm
override this.CreateKeyedHashAlgorithm : byte[] * string -> System.Security.Cryptography.KeyedHashAlgorithm
Public Overridable Function CreateKeyedHashAlgorithm (keyBytes As Byte(), algorithm As String) As KeyedHashAlgorithm

Parameters

keyBytes
Byte[]

bytes to use to create the Keyed Hash.

algorithm
String

the name of the keyed hash algorithm to create.

Returns

A KeyedHashAlgorithm.

Exceptions

thrown if algorithm is null or empty.

thrown if Create(String, Object[]) returns a type that is not assignable from KeyedHashAlgorithm.

algorithm is not supported.

Remarks

When finished with the KeyedHashAlgorithm call ReleaseHashAlgorithm(HashAlgorithm).

If CustomCryptoProvider is set and IsSupportedAlgorithm(String, Object[]) returns true. Create(String, Object[]) is called to obtain the KeyedHashAlgorithm.

Applies to