DecryptAndVerifySignature Method
Decrypts and verifies the signature of the message.
Syntax
[VB.NET] Public Sub DecryptAndVerifySignature()
[C#] public void DecryptAndVerifySignature();
Remarks
This method attempts to both decrypt and verify the signature of the message. All of the properties affected by calling the Decrypt and VerifySignature methods are affected in the same manner.
This method may be used when the data is signed, encrypted, or signed and encrypted. For instance, if the data is encrypted but not signed you may still use this method and the component will perform the decryption without error.
The message will be decrypted using the keys specified in Keys. Before decryption begins the component will fire the RecipientInfo event with information about the encrypted message, including the key used to encrypt the message. Within this event you may use the available information to load the correct key into Keys.
The message will be verified using the keys specified in SignerKeys. Before verification begins the component will fire the SignatureInfo event with information about the signature including the key used to sign the message. Within this event you may use the information available to load the correct key into SignerKeys.
By default, if the signature is not valid the component throws an exception. The configuration setting RequireValidSignature may be set to False to disable this requirement. When RequireValidSignature is set to False, the Status parameter of the VerificationStatus event should be checked to determine the result of the operation.
NOTE: This method does not attempt to check the validity of the signing key itself.