SymmetricSignatureProvider Constructor
Creates an instance of a signature provider that uses an SymmetricSecurityKey to create and / or verify signatures over a array of bytes.
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Public Sub New ( _
key As SymmetricSecurityKey, _
algorithm As String _
)
public SymmetricSignatureProvider(
SymmetricSecurityKey key,
string algorithm
)
public:
SymmetricSignatureProvider(
SymmetricSecurityKey^ key,
String^ algorithm
)
new :
key:SymmetricSecurityKey *
algorithm:string -> SymmetricSignatureProvider
public function SymmetricSignatureProvider(
key : SymmetricSecurityKey,
algorithm : String
)
Parameters
key
Type: System.IdentityModel.Tokens.SymmetricSecurityKeyThe SymmetricSecurityKey used for signing.
algorithm
Type: System.StringThe signature algorithm to use.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | 'key' is null. -or- 'algorithm' is null. |
ArgumentException | 'algorithm' contains only whitespace. |
ArgumentOutOfRangeException | 'SymmetricSecurityKey.KeySize' is smaller than MinimumSymmetricKeySizeInBits. |
InvalidOperationException | GetKeyedHashAlgorithm throws. -or-GetKeyedHashAlgorithm returns null. -or-GetSymmetricKey throws. |
.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.