Share via


CryptoProviderFactory.CreateForVerifying Method

Definition

Overloads

CreateForVerifying(SecurityKey, String)

Creates a SignatureProvider for verifying signatures with the specified key and algorithm.

CreateForVerifying(SecurityKey, String, Boolean)

Creates a SignatureProvider for verifying signatures with the specified key and algorithm.

CreateForVerifying(SecurityKey, String)

Creates a SignatureProvider for verifying signatures with the specified key and algorithm.

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

Parameters

key
SecurityKey

The SecurityKey to use for signature verification.

algorithm
String

The algorithm to use for verifying signatures.

Returns

A SignatureProvider instance that can be used to validate signatures using the SecurityKey and algorithm.

Exceptions

Thrown if algorithm is null or empty.

Thrown if KeySize is too small.

Thrown if the combination of key and algorithm is not supported.

Thrown if the type returned by Create(String, Object[]) is not assignable to SignatureProvider.

Remarks

Once done with the SignatureProvider, call ReleaseSignatureProvider(SignatureProvider).

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

Applies to

CreateForVerifying(SecurityKey, String, Boolean)

Creates a SignatureProvider for verifying signatures with the specified key and algorithm.

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

Parameters

key
SecurityKey

The SecurityKey to use for signature verification.

algorithm
String

The algorithm to use for verifying signatures.

cacheProvider
Boolean

Specifies whether the SignatureProvider should be cached for reuse.

Returns

A SignatureProvider instance that can be used to validate signatures using the SecurityKey and algorithm.

Exceptions

Thrown if algorithm is null or empty.

Thrown if KeySize is too small.

Thrown if the combination of key and algorithm is not supported.

Thrown if the type returned by Create(String, Object[]) is not assignable to SignatureProvider.

Remarks

Once done with the SignatureProvider, call ReleaseSignatureProvider(SignatureProvider).

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

Applies to