AsymmetricSignatureProvider Constructor
Creates an instance of a signature provider that uses a AsymmetricSecurityKey for creating and verifying signatures.
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Public Sub New ( _
key As AsymmetricSecurityKey, _
algorithm As String, _
willCreateSignatures As Boolean _
)
public AsymmetricSignatureProvider(
AsymmetricSecurityKey key,
string algorithm,
bool willCreateSignatures
)
public:
AsymmetricSignatureProvider(
AsymmetricSecurityKey^ key,
String^ algorithm,
bool willCreateSignatures
)
new :
key:AsymmetricSecurityKey *
algorithm:string *
willCreateSignatures:bool -> AsymmetricSignatureProvider
public function AsymmetricSignatureProvider(
key : AsymmetricSecurityKey,
algorithm : String,
willCreateSignatures : boolean
)
Parameters
key
Type: System.IdentityModel.Tokens.AsymmetricSecurityKeyThe AsymmetricSecurityKey that will be used for cryptographic operations.
algorithm
Type: System.StringThe signature algorithm to apply.
willCreateSignatures
Type: System.BooleanIf a AsymmetricSignatureProvider is required to create signatures, this parameter should be set to true. Creating signatures requires that the AsymmetricSecurityKey has access to a private key. Verifying signatures (the default behavior), does not require access to the private key.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | key is null or algorithm is null. |
ArgumentException | algorithm contains only whitespace. |
ArgumentOutOfRangeException |
|
InvalidOperationException |
|
.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.