The SignerInfo.CheckSignature(System.Security.Cryptography.X509Certificates.X509Certificate2Collection, bool) method verifies the digital signature of the message by using the specified collection of certificates and, optionally, validates the certificate.
- extraStore
An System.Security.Cryptography.X509Certificates.X509Certificate2Collection object that can be used to validate the chain. If no additional certificates are to be used to validate the chain, use SignerInfo.CheckSignature(bool) instead of SignerInfo.CheckSignature(System.Security.Cryptography.X509Certificates.X509Certificate2Collection, bool).
- 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.
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.