SymmetricSignatureProvider.Verify Method
Verifies that a signature created over the 'input' matches the signature. Using SymmetricSecurityKey and 'algorithm' passed to SymmetricSignatureProvider.
Namespace: System.IdentityModel.Tokens
Assembly: System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)
Syntax
'Declaration
Public Overrides Function Verify ( _
input As Byte(), _
signature As Byte() _
) As Boolean
public override bool Verify(
byte[] input,
byte[] signature
)
public:
virtual bool Verify(
array<unsigned char>^ input,
array<unsigned char>^ signature
) override
abstract Verify :
input:byte[] *
signature:byte[] -> bool
override Verify :
input:byte[] *
signature:byte[] -> bool
public override function Verify(
input : byte[],
signature : byte[]
) : boolean
Parameters
input
Type: System.Byte[]bytes to verify.
signature
Type: System.Byte[]signature to compare against.
Return Value
Type: System.Boolean
true if computed signature matches the signature parameter, false otherwise.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | 'input' is null. -or- 'signature' is null. |
ArgumentException | 'input.Length' == 0. -or- 'signature.Length' == 0. |
ObjectDisposedException | Dispose has been called. |
InvalidOperationException | if the internal KeyedHashAlgorithm is null. This can occur if a derived type deletes it or does not create it. |
.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.