Comments on: Decrypt S/MIME emails https://www.limilabs.com/blog/decrypt-smime-emails Fri, 11 Sep 2015 07:58:29 +0000 hourly 1 https://wordpress.org/?v=6.3.4 By: Limilabs support https://www.limilabs.com/blog/decrypt-smime-emails#comment-539621 Mon, 13 May 2013 21:47:17 +0000 http://www.limilabs.com/blog/?p=1785#comment-539621 In reply to Adam Corum.

@Adam,

Mail.dll recognizes encrypted emails by content-type headers: application/pkcs7-mime or application/x-pkcs7-mime with smime-type set to enveloped-data or enveloped data found inside the actual asn.1 content. IsEncrypted does not actually check for content type as email parsing occurs much earlier.

Please also note that Mail.dll email component decrypts email messages automatically. For such decrypted messages IsEncrypted will be set to true (NeedsDecryption is false) although decrypted message does not contain application/pkcs7-mime content type any longer.

email.HasContentType method is most likely an extension method and was not developed by us.

]]>
By: Adam Corum https://www.limilabs.com/blog/decrypt-smime-emails#comment-539608 Mon, 13 May 2013 17:33:34 +0000 http://www.limilabs.com/blog/?p=1785#comment-539608 Hello again,

Today I’m trying to ascertain what set of things the .IsEncrypted property takes into account. Specifically, does it contain a check for the content type call email.HasContentType(“application/pkcs7-mime”, “smime-type”, “enveloped-data”) ?

]]>
By: Limilabs support https://www.limilabs.com/blog/decrypt-smime-emails#comment-533579 Sat, 20 Apr 2013 10:29:34 +0000 http://www.limilabs.com/blog/?p=1785#comment-533579 In reply to Adam Corum.

@Adam,

Now I get it. Your solution is correct. IMail.GetEnvelopedCms() is the way to go. I think that it’s also possible for the certificate itself to enforce some of those policies.

]]>
By: Adam Corum https://www.limilabs.com/blog/decrypt-smime-emails#comment-532654 Fri, 19 Apr 2013 17:34:58 +0000 http://www.limilabs.com/blog/?p=1785#comment-532654 Thanks for the response. By “chewing on it”, I meant that that it would decrypt. I found IMail.GetEnvelopedCms() and IMail.GetSignedCms() methods and am now able to implement the restrictions on unsupported ciphers and signature algorithms to protect my .Decrypt call.

]]>
By: Limilabs support https://www.limilabs.com/blog/decrypt-smime-emails#comment-530307 Thu, 18 Apr 2013 07:50:33 +0000 http://www.limilabs.com/blog/?p=1785#comment-530307 In reply to Adam Corum.

@Adam,

You need to be more specific than “it seems to chew on whatever I give it”.
What are you trying to do? Send encrypted email or decrypt the one you have received? Are you getting any exception? Error? From Mail.dll or from your email program?
Please read this article, if you need to specify SMIME encryption algorithm explicitly.

]]>
By: Adam Corum https://www.limilabs.com/blog/decrypt-smime-emails#comment-529467 Wed, 17 Apr 2013 14:44:47 +0000 http://www.limilabs.com/blog/?p=1785#comment-529467 How does it make use of the encryption algorithm. I’ve been trying many different signing and encrypt algorithms and it seems to chew on whatever I give it. I have a requirement to restrict to a specific set of ciphers but I don’t see how I can tell mail dll that.

]]>
By: Send signed email receive encrypted https://www.limilabs.com/blog/decrypt-smime-emails#comment-1556 Tue, 24 May 2011 09:25:02 +0000 http://www.limilabs.com/blog/?p=1785#comment-1556 […]   « Decrypt S/MIME emails INotifyPropertyChanged with custom targets […]

]]>