+1 vote


We need to validate digitally signed email sender details. We got a certificate as ".p7s" attachment.
I followed the steps mentions in the link "https://www.limilabs.com/blog/validate-smime-emails" to verify the signature. my mail signature is verified by the "CheckSignature(true);" method and it is not throwing any exception. So I assume mail item signature is verified.
But I need to validate the sender details with Public Key certificate.
How can we validate with Public Key certificate?



1 Answer

0 votes

IMail.CheckSignature(true) checks if the signature is valid. No separate public key is needed. Signature already contains the certificate with the public key.

true means that certificate itself is not validated (its purposes and certificate chain are not validated).

You should either use CheckSignature(false) or additionally use IMail.GetSignedCms() and SignedCms.Certificates / SignedCms.SignerInfos and compare certificate thumbprint to what you have.

by (293k points)