I want to develope an application to send emails which are signed using digital certificate while the email content (+attachements) is encrypted. I am using PKI.
I appreciate anwsers that do not offer me to use another system or security solution.
Thank you for help. I used your links and also I found other information about x509certificate classes. finally I have something like this:
_SignedCms.ComputeSignature(_CmsSigner);
In run time, After certificate selection, normally, their should be a dialog box to ask me my PIN as signer's private key. Unfortunately the dialog does not open.
X509Store store = new X509Store("MY",StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;
X509Certificate2Collection fcollection = (X509Certificate2Collection)collection.Find(X509FindType.FindByTimeValid,DateTime.Now,false);
X509Certificate2Collection scollection = X509Certificate2UI.SelectFromCollection(fcollection, "Test Certificate Select","Select a certificate from the following list to get information on that certificate",X509SelectionFlag.MultiSelection);
return scollection[0];
And at last I have this error message: "NO PIN was presented to the smart card"
I don't know how to pass signer's PIN or open PIN dialog box before firing ComputeSignature method.
hamid.darabi
Member
76 Points
17 Posts
sending secure email using digital certificate
Feb 26, 2012 07:19 AM|LINK
Hello
I want to develope an application to send emails which are signed using digital certificate while the email content (+attachements) is encrypted. I am using PKI.
I appreciate anwsers that do not offer me to use another system or security solution.
waelouf
Member
250 Points
41 Posts
Re: sending secure email using digital certificate
Feb 26, 2012 09:09 AM|LINK
Check out these two articles with examples:
C# - Sign Email - S/MIME
and
C# - Encrypt Email - S/MIME
waelouf
Member
250 Points
41 Posts
Re: sending secure email using digital certificate
Feb 26, 2012 09:16 AM|LINK
OR another simple way:
http://www.diaryofaninja.com/blog/2009/10/02/sending-encrypted-email-with-c
hamid.darabi
Member
76 Points
17 Posts
Re: sending secure email using digital certificate
Mar 06, 2012 11:56 AM|LINK
Thank you for help. I used your links and also I found other information about x509certificate classes. finally I have something like this:
In run time, After certificate selection, normally, their should be a dialog box to ask me my PIN as signer's private key. Unfortunately the dialog does not open.
X509Store store = new X509Store("MY",StoreLocation.CurrentUser); store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly); X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates; X509Certificate2Collection fcollection = (X509Certificate2Collection)collection.Find(X509FindType.FindByTimeValid,DateTime.Now,false); X509Certificate2Collection scollection = X509Certificate2UI.SelectFromCollection(fcollection, "Test Certificate Select","Select a certificate from the following list to get information on that certificate",X509SelectionFlag.MultiSelection); return scollection[0];And at last I have this error message: "NO PIN was presented to the smart card"
I don't know how to pass signer's PIN or open PIN dialog box before firing ComputeSignature method.
hamid.darabi
Member
76 Points
17 Posts
Re: sending secure email using digital certificate
Mar 11, 2012 08:09 AM|LINK
Free open source component for .net developers with many features:
http://mailsystem.codeplex.com