다음을 통해 공유


CryptoProviderFactory.CreateHashAlgorithm Method

Definition

Overloads

CreateHashAlgorithm(HashAlgorithmName)

Creates a HashAlgorithm for a specific algorithm.

CreateHashAlgorithm(String)

Creates a HashAlgorithm for a specific algorithm.

CreateHashAlgorithm(HashAlgorithmName)

Creates a HashAlgorithm for a specific 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.

Exceptions

thrown if algorithm is null or empty.

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

thrown if algorithm is not supported.

Remarks

When finished 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 for a specific 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.

Exceptions

thrown if algorithm is null or empty.

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

thrown if algorithm is not supported.

Remarks

When finished 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