Rocco David,

Rocco David wrote
> But when i try to sign a pdf file with HashAlgorithm Sha256 and  so i
> change
> 
> HashAlgorithm sha = new SHA1CryptoServiceProvider();
> PdfSignature dic = new PdfSignature(PdfName.ADOBE_PPKMS,
> PdfName.ADBE_PKCS7_SHA1);
> 
> in
> 
> PdfSignature dic = new PdfSignature(PdfName.ADOBE_PPKLITE,
> PdfName.ADBE_PKCS7_DETACHED);
> HashAlgorithm sha = new SHA256Managed();

Switching from ADBE_PKCS7_SHA1 to ADBE_PKCS7_DETACHED implies more
differences than the hashing algorithm alone. Especially the document hash
is inserted at a different position in the signature container.

Therefore, you had better have a look at the ADBE_PKCS7_DETACHED samples on
the web page you refered to in your original mail and replace your signature
container creation code accordingly.

Regards,   Michael

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Problem-to-sign-using-Sha256-tp4471288p4471306.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
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

Reply via email to