System.Security.Cryptography.Pkcs.SignerInfo.CheckSignature Method

The SignerInfo.CheckSignature(bool) method verifies the digital signature of the message and, optionally, validates the certificate.

Syntax

public void CheckSignature (bool verifySignatureOnly)

Parameters

verifySignatureOnly
A bool value that specifies whether only the digital signature is verified. If verifySignatureOnly is true, only the signature is verified. If verifySignatureOnly is false, the digital signature is verified, the certificate chain is validated, and the purposes of the certificates are validated. The purposes of the certificate are considered valid if the certificate has no key usage or if the key usage supports digital signature or nonrepudiation.

Remarks

This method throws an exception if the verification of the digital signature fails or any validation requirements are not met.

If more complex validation is required, the caller can specify that only the signature is verified and then use an System.Security.Cryptography.X509Certificates.X509Chain object to perform custom validation.

Requirements

Namespace: System.Security.Cryptography.Pkcs
Assembly: System.Security (in System.Security.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0