[Mono-list] PKCS7 Mail
sebastien.pouliot at gmail.com
Tue Oct 9 13:26:03 EDT 2007
On Tue, 2007-10-09 at 09:52 -0700, Trimble, Nathan G wrote:
> I need some advice for programmatically creating smime email. I have
> been trying to use MailMessage, EnvelopedCms, and X509Certificate2 under
> .Net 2.0 to create an encrypted mail message. I have a certificate from
> my organization's pki in .p7c pkcs7 format. When I try to create an
> X509Certificate2 object using it I get an exception.
hmm... I'm surprised since 2.0 supports many formats
> It would appear
> that format is not supported using this class.
IIRC Windows uses p7c files as a structure than contains a collection of
certificates (and CRL). This is similar to the SPC format(*) used for
Authenticode (which is supported by mono).
(*) well SPC is a (very) small subset of PKCS#7
> I'm now looking at the
> Mono.Security.X509 namespace. Does anyone know if there is something in
> Mono I could use to get a .p7c certificate imported into my program for
> this purpose? Thanks.
Quick answer: yes
It depends. Mono.Security provides low-level API, down to ASN.1
decoding, so you can, in theory, decode anything (as long as you write
the source to do so).
Mono.Security contains some classes that can be useful (e.g. the SPC
decoding) and other PKCS#7 related code (mostly for Authenticode).
However it's not clear it they will work, as is, on you .p7c file.
> N8 Trimble
> nathan.trimble at pnl.gov
> Mono-list maillist - Mono-list at lists.ximian.com
More information about the Mono-list