다음을 통해 공유


CryptoProviderFactory.CreateForVerifying Method

Definition

Overloads

CreateForVerifying(SecurityKey, String)

Creates a SignatureProvider that supports the SecurityKey and algorithm.

CreateForVerifying(SecurityKey, String, Boolean)

Creates a SignatureProvider that supports the SecurityKey and algorithm.

CreateForVerifying(SecurityKey, String)

Creates a SignatureProvider that supports the SecurityKey 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.

Returns

A SignatureProvider that can be used to validate a signature using the SecurityKey and algorithm.

Exceptions

thrown if algorithm is null or empty.

thrown if KeySize is too small.

thrown if the key / algorithm is not supported.

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

Remarks

When finished 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 that supports the SecurityKey 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.

cacheProvider
Boolean

should the SignatureProvider be cached.

Returns

A SignatureProvider that can be used to validate a signature using the SecurityKey and algorithm.

Exceptions

thrown if algorithm is null or empty.

thrown if KeySize is too small.

thrown if the key / algorithm is not supported.

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

Remarks

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