Kang Ku, Lee,

Kang Ku, Lee wrote
> I will test verify the signed PDF file
> http://korea.blogsite.org/MyHome/download/modified_signed.pdf.
> This file is modified by hex editor.
> 
> The acrobat PDF reader is invalid signature. This is OK!!!.
> 
> But, when I try same file with iText PdfPKCS7 class, The signature is
> valid!!! Why????

Please provide the versions of iText and of BouncyCastle you use.

Testing your code with the current iText trunk and BC 1.47, I get the
*java.lang.ClassCastException: org.bouncycastle.asn1.BERTaggedObject cannot
be cast to org.bouncycastle.asn1.ASN1Set* already  reported by Alfonso Maria
Massa last October
<http://itext-general.2136553.n4.nabble.com/iText-questions-failure-in-verify-signature-using-SignWithBC-tt4656565.html>
 
. (Actually this is a bug in BouncyCastle --- BC expects certain data to be
DER encoded where any BER encoding is allowed; in your signature that data
is not DER encoded; it, therefore, triggers the BC bug.)

Testing it with a patched PdfPKCS7.java (inspired by Alfonso's patch which
circumvents the BC bug, but with a fix), I get "Revision modified: true"
which is the expected result.

So I never get a false "Revision modified: false".

Regards,   Michael



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/iText-PdfPKCS7-verify-somethig-wrong-tp4657188p4657239.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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