hello everyone
I have a Cms in ANS1 Structure and a pdfpkcs7 object and i want to set this
cms to the Pdfpkcs7 obj now i extract signature data from my cms in the cod
of :
OrgBouncyCastleCmsallias.CmsSignedData attachedSignedData = new
OrgBouncyCastleCmsallias.CmsSignedData(Convert.FromBase64String(CMS));
OrgBouncyCastleCmsallias.SignerInformationStore str =
attachedSignedData.GetSignerInfos();
byte[] SigData = null;
foreach (OrgBouncyCastleCmsallias.SignerInformation s in
str.GetSigners())
SigData = s.GetSignature();
but i dont want to do this and i need to use all cms to set to the pdfpkcs7
object and my code to use pdfpkcs7 obj is here:
public byte[] Sign(Stream data)
{
byte[] hash = DigestAlgorithms.Digest(data, "SHA1");
PdfPKCS7 sgn = new PdfPKCS7(null, chain, "SHA1", false);
byte[] SigData2 = Convert.FromBase64String(SigData);
sgn.SetExternalDigest(SigData2, null, "RSA");
return sgn.GetEncodedPKCS7(hash, cal, null, null, null,
CryptoStandard.CMS);
}
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Pdfpkcs7-and-ans1-in-c-tp4659589.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php