Partager via


CryptoProviderFactory.IsSupportedAlgorithm Method

Definition

Overloads

IsSupportedAlgorithm(String)

Checks if an algorithm is supported.

IsSupportedAlgorithm(String, SecurityKey)

Checks if the algorithm and SecurityKey is supported.

IsSupportedAlgorithm(String)

Checks if an algorithm is supported.

public virtual bool IsSupportedAlgorithm (string algorithm);
abstract member IsSupportedAlgorithm : string -> bool
override this.IsSupportedAlgorithm : string -> bool
Public Overridable Function IsSupportedAlgorithm (algorithm As String) As Boolean

Parameters

algorithm
String

the name of the Hash algorithm.

Returns

true if:

If CustomCryptoProvider is set and IsSupportedAlgorithm(String, Object[]) returns true.

The algorithm is supported.

Remarks

Only considers known Hash algorithms.

Applies to

IsSupportedAlgorithm(String, SecurityKey)

Checks if the algorithm and SecurityKey is supported.

public virtual bool IsSupportedAlgorithm (string algorithm, Microsoft.IdentityModel.Tokens.SecurityKey key);
abstract member IsSupportedAlgorithm : string * Microsoft.IdentityModel.Tokens.SecurityKey -> bool
override this.IsSupportedAlgorithm : string * Microsoft.IdentityModel.Tokens.SecurityKey -> bool
Public Overridable Function IsSupportedAlgorithm (algorithm As String, key As SecurityKey) As Boolean

Parameters

algorithm
String

the security algorithm to apply.

Returns

true if:

If CustomCryptoProvider is set and IsSupportedAlgorithm(String, Object[]) returns true.

The algorithm / key pair is supported.

Remarks

Algorithms are supported for specific key types. For example:

RsaSha256 and RsaSecurityKey will return true.

RsaSha256 and SymmetricSecurityKey will return false.

Applies to