Validate S/MIME certificate
Prior to reading this article, we recommend you to get familiar with general principles of certificate validation described here.
When validating an integrity and authenticity of a secure E-mail message, it is important to establish the validity of the signer's certificate. This ensures that the message has been signed by the genuine author. We recommend using the TElX509CertificateValidator component to validate the S/MIME certificates.
The following code snippet illustrates validation of a secure mail certificate:
validator.ValidateForSMIME(cert, "firstname.lastname@example.org", // the address of the sender as reported by S/MIME components null, // no additional certificates true, // validation the complete chain DateTime.UtcNow, // now ref Validity, ref Reason ); bool Valid = (Validity == TSBCertificateValidity.cvOk);