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
- key
Type: System.IdentityModel.Tokens.SecurityKey
- algorithm
Type: System.String
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.