[ https://issues.apache.org/jira/browse/PDFBOX-1751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Chojecki updated PDFBOX-1751: ------------------------------------ Attachment: contract_signed_Cryptolog.pdf Your PDF helps a lot. Please tell use next time exactly what you do to reproduce the error. I can see that the first signature is done with a tool or module called "Cryptolog" and only the second signature is done with the pdfbox. So you don't signed twice with pdfbox what would work in your case. Now I need to check what the so called "Cryptolog" does, that confuse the pdfbox. Your problem is similar to PDFBOX-1370. I think it has something to do with finding the right object while reading the document and maybe it is a parser issue, but this is only a guess. The error message "SignDict/Contents+illegal+data" is caused due to a subsequent error and is a bug in acrobat. The first signature wasn't touch at any time. The last incremental update overwrote some important objects and cause the acrobat reader stop correct parsing the document. Long store short answer. I'm trying to find out what cause this problem but it can take some time and I think it will not be fixed in the coming 1.8.3 release. Maybe the non sequential parser would solve the problem, but the parser isn't compatible with the incremental saving right now. I will link this issue as duplicated and attach the single signed document. > SignDict/Contents illegal data > ------------------------------ > > Key: PDFBOX-1751 > URL: https://issues.apache.org/jira/browse/PDFBOX-1751 > Project: PDFBox > Issue Type: Bug > Components: Signing > Affects Versions: 1.8.0 > Environment: Windows 8.1 > Reporter: David KELLER > Assignee: Thomas Chojecki > Labels: security, signature > Attachments: contract.pdf, contract.pdf_signedIText.pdf, > contract.pdf_signedPdfBox.pdf, contract_signed_Cryptolog.pdf, PADESSigner.java > > > 1/ I sign a file using this method > public static void signByPdfbox( > File inputPDF, > File outputPDF, > KeyStore ks, > String password) > throws IOException, UnrecoverableKeyException, KeyStoreException, > NoSuchAlgorithmException, COSVisitorException, SignatureException { > PDDocument inputDoc = PDDocument.load(inputPDF); > > > PADESSigner signer = new PADESSigner(ks, password); > > signer.setSignatureName("Hello1"); > signer.setSignatureReason("Why noy"); > signer.setSignatureLocation("Curacao"); > signer.setSignatureContactInfo("david.keller...@gmail.com"); > > signer.signPDF(inputDoc, outputPDF); > } > 2/ I resign the same file using the same method and in acrobat reader I have > this error : SignDict/Contents illegal data > I have googelized it, and I found only old topics for iText lib. > I have tried the same with iText 5.X, and double signatures works -- This message was sent by Atlassian JIRA (v6.1#6144)