Partager via


CryptoProviderFactory.CreateHashAlgorithm Method

Definition

Overloads

CreateHashAlgorithm(HashAlgorithmName)

Creates a HashAlgorithm instance for a specific hash algorithm.

CreateHashAlgorithm(String)

Creates a HashAlgorithm instance for a specific hash algorithm.

CreateHashAlgorithm(HashAlgorithmName)

Creates a HashAlgorithm instance for a specific hash algorithm.

public virtual System.Security.Cryptography.HashAlgorithm CreateHashAlgorithm (System.Security.Cryptography.HashAlgorithmName algorithm);
abstract member CreateHashAlgorithm : System.Security.Cryptography.HashAlgorithmName -> System.Security.Cryptography.HashAlgorithm
override this.CreateHashAlgorithm : System.Security.Cryptography.HashAlgorithmName -> System.Security.Cryptography.HashAlgorithm
Public Overridable Function CreateHashAlgorithm (algorithm As HashAlgorithmName) As HashAlgorithm

Parameters

algorithm
HashAlgorithmName

The name of the hash algorithm to create.

Returns

A HashAlgorithm instance that corresponds to the specified algorithm.

Exceptions

Thrown if algorithm is null or empty.

Thrown if Create(String, Object[]) returns a type that is not assignable to HashAlgorithm.

Thrown if algorithm is not supported.

Remarks

Once done with the HashAlgorithm, call ReleaseHashAlgorithm(HashAlgorithm).

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

Applies to

CreateHashAlgorithm(String)

Creates a HashAlgorithm instance for a specific hash algorithm.

public virtual System.Security.Cryptography.HashAlgorithm CreateHashAlgorithm (string algorithm);
abstract member CreateHashAlgorithm : string -> System.Security.Cryptography.HashAlgorithm
override this.CreateHashAlgorithm : string -> System.Security.Cryptography.HashAlgorithm
Public Overridable Function CreateHashAlgorithm (algorithm As String) As HashAlgorithm

Parameters

algorithm
String

The name of the hash algorithm to create.

Returns

A HashAlgorithm instance that corresponds to the specified algorithm.

Exceptions

Thrown if algorithm is null or empty.

Thrown if Create(String, Object[]) returns a type that is not assignable to HashAlgorithm.

Thrown if algorithm is not supported.

Remarks

Once done with the HashAlgorithm, call ReleaseHashAlgorithm(HashAlgorithm).

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

Applies to