Home All Groups Group Topic Archive Search About

Re: How to - PKCS#7 in c#

Author
30 Jun 2006 4:54 PM
kplkumar
Thanks for the reply. But can you tell me if PKCS #7 is used only for
signing the message or is it also used to encrypt the message before
signing it?

Can you point me to some examples where the above is done?

Thanks in adavance.

Author
30 Jun 2006 5:43 PM
Joe Kaplan (MVP - ADSI)
You can create all sorts of different types of CMS (PKCS#7) messages with
these functions, including signed, enveloped (encrypted), etc.

If you aren't really familiar with how CMS works in general, you might want
to read up on it a little more.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"kplkumar" <kplku***@gmail.com> wrote in message
news:1151686484.912974.234580@y41g2000cwy.googlegroups.com...
> Thanks for the reply. But can you tell me if PKCS #7 is used only for
> signing the message or is it also used to encrypt the message before
> signing it?
>
> Can you point me to some examples where the above is done?
>
> Thanks in adavance.
>
Author
2 Jul 2006 7:32 AM
Dominick Baier [DevelopMentor]
hi,

a sample that signs and encrypts files:

http://www.leastprivilege.com/CrypterPKRTMVersion.aspx

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Show quoteHide quote
> You can create all sorts of different types of CMS (PKCS#7) messages
> with these functions, including signed, enveloped (encrypted), etc.
>
> If you aren't really familiar with how CMS works in general, you might
> want to read up on it a little more.
>
> Joe K.
>
Author
11 Jul 2006 4:50 PM
kplkumar
Thanks Dominic.

At this time, we don't want to use certificates. I want to use
public/private key.
All I want is to encrypt the string message using RSA+PKCS#7 and then
add a another layer of digital signing to the encrupted messahe using
the same and send it out.

I am not able to get this going using the
System.Security.Cryptography.Pkcs namespace. I poked around quite a bit
in vain.

Can someone help me here? Some code would be really helpful. Thanks in
advance.
Author
14 Jul 2006 7:02 AM
Joe Kaplan (MVP - ADSI)
I think enveloped CMS is intended for use without certificates.  All of the
recipient and signer classes seem to expect certificates here.

You might be better off finding a different library that does support this
(assuming that CMS actually supports this use case; I'm not sure), or
perhaps rolling your own format that encrypts, then signs.

Why the reluctance to use certificates though?

Best of luck,

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"kplkumar" <kplku***@gmail.com> wrote in message
news:1152636653.070488.248800@75g2000cwc.googlegroups.com...
> Thanks Dominic.
>
> At this time, we don't want to use certificates. I want to use
> public/private key.
> All I want is to encrypt the string message using RSA+PKCS#7 and then
> add a another layer of digital signing to the encrupted messahe using
> the same and send it out.
>
> I am not able to get this going using the
> System.Security.Cryptography.Pkcs namespace. I poked around quite a bit
> in vain.
>
> Can someone help me here? Some code would be really helpful. Thanks in
> advance.
>