esig / dss-demonstrations

Examples of DSS integration
GNU Lesser General Public License v2.1
92 stars 70 forks source link

Error when validating PDF file #37

Closed pzsette closed 1 year ago

pzsette commented 1 year ago

When i try to validate the signatures on a PDF file inside the function SignedDocumentValidator.fromDocument(signedDocument) i got the following error Document format not recognized/handled. More precisely the program fails with the byte check in getAsn1Encodable(). My file first tagByte is 37 and the desired value is 48. How can i solve this problem ?

bsanchezb commented 1 year ago

Hello @pzsette ,

Did you add one of the PAdES implementations to your project? See 17.1.3. DSS PAdES for information about available implementations. For PdfBox, you should add the following dependency to pom.xml of your project:

<dependency>
    <groupId>eu.europa.ec.joinup.sd-dss</groupId>
    <artifactId>dss-pades-pdfbox</artifactId>
</dependency>

I hope this will help you.

Best regards, Aleksandr.

pzsette commented 1 year ago

It works, thanks a lot