Share via


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

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

See Also

Reference

SymmetricSignatureProvider Class

System.IdentityModel.Tokens Namespace