Share via


AsymmetricSignatureProvider.Verify Method

Verifies that a signature of input matches the signature.

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[]

    The bytes to generate the signature over.

  • signature
    Type: System.Byte[]

    The value to verify against.

Return Value

Type: System.Boolean
true if signature matches, false otherwise.

Exceptions

Exception Condition
ArgumentNullException
  • input is null.

  • signature is null.

ArgumentException
  • The length of input is zero.

  • The length of signature is zero.

ObjectDisposedException

If Dispose has been called.

InvalidOperationException
  • If the internal AsymmetricSignatureDeformatter is null. This can occur if a derived type does not call the base constructor.

  • If the internal HashAlgorithm is null. This can occur if a derived type deletes it or does not create it.

.NET Framework Security

See Also

Reference

AsymmetricSignatureProvider Class

System.IdentityModel.Tokens Namespace