SignerInfo.CheckSignature Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Verifies the digital signature of the message.
Overloads
CheckSignature(Boolean) |
The CheckSignature(Boolean) method verifies the digital signature of the message and, optionally, validates the certificate. |
CheckSignature(X509Certificate2Collection, Boolean) |
The CheckSignature(X509Certificate2Collection, Boolean) method verifies the digital signature of the message by using the specified collection of certificates and, optionally, validates the certificate. |
CheckSignature(Boolean)
- Source:
- SignerInfo.cs
- Source:
- SignerInfo.cs
- Source:
- SignerInfo.cs
The CheckSignature(Boolean) method verifies the digital signature of the message and, optionally, validates the certificate.
public:
void CheckSignature(bool verifySignatureOnly);
public void CheckSignature (bool verifySignatureOnly);
member this.CheckSignature : bool -> unit
Public Sub CheckSignature (verifySignatureOnly As Boolean)
Parameters
- verifySignatureOnly
- Boolean
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.
Exceptions
A null reference was passed to a method that does not accept it as a valid argument.
A cryptographic operation could not be completed.
A method call was invalid for the object's current state.
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 X509Chain object to perform custom validation.
Applies to
CheckSignature(X509Certificate2Collection, Boolean)
- Source:
- SignerInfo.cs
- Source:
- SignerInfo.cs
- Source:
- SignerInfo.cs
The CheckSignature(X509Certificate2Collection, Boolean) method verifies the digital signature of the message by using the specified collection of certificates and, optionally, validates the certificate.
public:
void CheckSignature(System::Security::Cryptography::X509Certificates::X509Certificate2Collection ^ extraStore, bool verifySignatureOnly);
public void CheckSignature (System.Security.Cryptography.X509Certificates.X509Certificate2Collection extraStore, bool verifySignatureOnly);
member this.CheckSignature : System.Security.Cryptography.X509Certificates.X509Certificate2Collection * bool -> unit
Public Sub CheckSignature (extraStore As X509Certificate2Collection, verifySignatureOnly As Boolean)
Parameters
- extraStore
- X509Certificate2Collection
An X509Certificate2Collection object that can be used to validate the chain. If no additional certificates are to be used to validate the chain, use CheckSignature(Boolean) instead of CheckSignature(X509Certificate2Collection, Boolean).
- verifySignatureOnly
- Boolean
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.
Exceptions
A null reference was passed to a method that does not accept it as a valid argument.
A cryptographic operation could not be completed.
A method call was invalid for the object's current state.
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 X509Chain object to perform custom validation.