views:

706

answers:

5

I need to create S/MIME messages using C# (as specified in RFC 2633, "S/MIME Version 3 message specification", and RFC 3335). The only S/MIME library I can find is a commercial library (http://www.example-code.com/csharp/smime.asp), which is no good for us.

Are there any existing libraries to accomplish creating S/MIME messages, and in particular, .p7s files?

I have all the encrypted and signed elements that need to go into this file, but I'd like to create the .p7s file without handrolling my own library with the aid of the RFC document...


EDIT: I've found another commercial S/MIME library, which is still no good for our requirements. It's looking more and more like I'm going to have to hand roll a S/MIME library, which is sad. Is everyone in .net who needs S/MIME using commercial, closed source libraries to do it?

+1  A: 

I haven't used this S/MIME library, but my application uses another library from the same vendor and it works fine:

http://www.chilkatsoft.com/mime-dotnet.asp

Their library to do the p7s signatures is separate, which might be an issue depending on your budget:

http://www.chilkatsoft.com/crypt-dotnet.asp

jeffm
Even if the cost weren't an issue (which I'm sure it would be), another issue is how chilkatsoft provides the libraries.I'll bet he simply provides some dlls, which you can happily use with visual studio? My boss is too cheap to spring for vs.net, we use http://www.microsoft.com/express/vwd/
Gabriel
Like I said, we use visual web dev, which has rather limited DLL capabilites. Specifically, no compiling to DLLs, and I think it has very limited interoperability with foreign DLLs in general, although I could be wrong. Oh, how I long for visual studio!
Gabriel
A: 

Yup, I know of that library, but the cost and closed source nature of it are a definite problem for me.

Are there no other libraries on this? Furthermore, is S/MIME significantly different to MIME? I mean, is it possible to extend MIME libraries to cover S/MIME, or not really?

Gabriel
A: 

It's quite hard to implement complete s/mime as it requires lots of extra work. You can use SMIME components in SecureBlackbox for your task.

Eugene Mayevski 'EldoS Corp
+2  A: 

Have a look at Rebex Secure Mail. This is a very stable library I use for many years now. It's 100% managed code and the source code is also available.

Stefan Schultze
+1  A: 

There's a pretty good S/MIME class available on CodeProject.

http://www.codeproject.com/KB/security/CPI%5FNET%5FSecureMail.aspx

Troy Howard