SignatureProviderFactory.CreateForVerifying Method

Returns a SignatureProvider instance supports the SecurityKey and algorithm.

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)

Syntax

'Declaration
Public Overridable Function CreateForVerifying ( _
    key As SecurityKey, _
    algorithm As String _
) As SignatureProvider
public virtual SignatureProvider CreateForVerifying(
    SecurityKey key,
    string algorithm
)
public:
virtual SignatureProvider^ CreateForVerifying(
    SecurityKey^ key, 
    String^ algorithm
)
abstract CreateForVerifying : 
        key:SecurityKey * 
        algorithm:string -> SignatureProvider  
override CreateForVerifying : 
        key:SecurityKey * 
        algorithm:string -> SignatureProvider
public function CreateForVerifying(
    key : SecurityKey, 
    algorithm : String
) : SignatureProvider

Parameters

Return Value

Type: System.IdentityModel.Tokens.SignatureProvider
Returns SignatureProvider.

Exceptions

Exception Condition
ArgumentNullException

'key' is null.

-or-

'algorithm' is null.

ArgumentException

'algorithm' contains only whitespace.

-or-

'SecurityKey' is not a AsymmetricSecurityKey or a SymmetricSecurityKey.

ArgumentOutOfRangeException

'AsymmetricSecurityKey' is smaller than MinimumAsymmetricKeySizeInBitsForVerifying.

-or-

'SymmetricSecurityKey' is smaller than MinimumSymmetricKeySizeInBits.

.NET Framework Security

See Also

Reference

SignatureProviderFactory Class

System.IdentityModel.Tokens Namespace