CryptoProviderFactory.IsSupportedAlgorithm Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
IsSupportedAlgorithm(String) |
Determines whether the specified hash algorithm is supported. |
IsSupportedAlgorithm(String, SecurityKey) |
Checks if the specified algorithm and SecurityKey are supported. |
IsSupportedAlgorithm(String)
Determines whether the specified hash 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:
- CustomCryptoProvider is set and IsSupportedAlgorithm(String, Object[]) returns true,
- The algorithm is supported.
false
.
Remarks
Considers only known hash algorithms.
Applies to
IsSupportedAlgorithm(String, SecurityKey)
Checks if the specified algorithm and SecurityKey are 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 be used.
- key
- SecurityKey
The SecurityKey.
Returns
true
if:
- CustomCryptoProvider is set and IsSupportedAlgorithm(String, Object[]) returns true,
- The algorithm / key pair is supported.
false
.
Remarks
Algorithms are supported for specific key types. For example:
- RsaSha256 and RsaSecurityKey will return true.
- RsaSha256 and SymmetricSecurityKey will return false.