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.
Asked
Active
Viewed 2,292 times
2

DotNetStudent
- 889
- 9
- 24
1 Answers
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
which involves
- Loading a cert from PFX file
- Signing the message
- 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
-
2Yes 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