2

One of the requirements of the project I am working at involves digitally signing e-mail messages. I can, of course, build the messages and send them through a SMTPClient, but I really can't figure out how to digitally sign them. I have some .pfx files whose path and password I must provide to the constructor of the X509Certificate2 class, but from this point onwards I am completely clueless.

DotNetStudent
  • 889
  • 9
  • 24

1 Answers1

1

Just before sending the message you could sign it with your algorithm depending on what is the method for that

//Pseudo Code

message.Sign(SignerAlgo)

Smtp.Send(message);

Here is an example using pfx file

http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/74e4711e-1f66-43a7-9e3b-bc9cfbcd1b73/

which involves

  1. Loading a cert from PFX file
  2. Signing the message
  3. Generating signed envelope
user182630
  • 574
  • 3
  • 10
  • Are you really sure this works? There is no `Sign` method in the `MailMessage` class. – DotNetStudent Nov 17 '11 at 16:07
  • 2
    Yes that is just a pseudo code to tell you how this could work, but try the example in the link provided and you should be able to work this out. – user182630 Nov 17 '11 at 16:13