0 votes
by (210 points)

Outlook can show signing time of signatures of .msg files.
Is it possible to retrieve that time, using your secure mail component?

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (144k points)
selected by
 
Best answer

It is possible, but it's quite complicated at the moment because you have to use MimeMessage to access this detailed information about signatures:

// load Outlook MSG message
var message = new MailMessage();
message.Load("signed.msg");

if (message.IsSigned)
{
  // convert the object to MimeMessage instance to be able
  // to access signature details
  MimeMessage mime = message.ToMimeMessage();

  // SignedContentInfo collection contains a list of signers
  foreach (SignerInfo info in mime.SignedContentInfo.SignerInfos)
  {
    // get signer e-mail address (make sure to check
    // the array length in production code)
    string address = info.Certificate.GetMailAddresses()[0];

    // show signer e-mail and signing time
    Console.WriteLine("{0} {1}", [0], info.SigningTime);
  }
}

Also, please note that S/MIME lacks mechanism to determine whether the signing date supplied by the signer is correct. It only ensures it's not modified by anyone else. (Time Stamp Authorities (TSA) solve this problem, but they are not yet widely used with S/MIME.)

...