Adding attributes to pkcs7/cms signature
From: Jayant Sane (JayantSane_at_discussions.microsoft.com)
Date: 01/27/05
- Next message: Nicole Calinoiu: "Re: CLR security error"
- Previous message: John P: "CLR security error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 27 Jan 2005 11:13:03 -0800
I am using .Net 2.0 (v2.0.41115) to create a signature where I would like to
add some attributes (either signed or unsigned) to it.
However in all of the relevant classes under
System.Security.Cryptography.Pkcs namespace, they only allow you to retrieve
attributes from a signed object. Meaning I cant see a way to add them to a
signature while creating it. I have following code snippet to illustrate what
I am trying to do:
X509Store certStore = new X509Store();
certStore.Open(OpenFlags.ReadOnly);
X509CertificateEx signerCert = null;
// find the signer cert and set the above var to it..
CmsSigner signer = new CmsSigner(signerCert);
SignedCms signedCMS = new SignedCms(content, false);
// what do i do to add either signed or unsigned attribute
// to my signature???
signedCMS.ComputeSignature(signer);
byte[] signedData = signedCMS.Encode();
...
I know how to add attributes to signature using CryptoAPI .
TIA.
Jay
- Next message: Nicole Calinoiu: "Re: CLR security error"
- Previous message: John P: "CLR security error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|