0

The same problem is in this question: Verify signed PDF Document in PHP , but the answer is not complete.

I have a public key file and a private key file. I have a signed PDF document, it was signed by using TCPDF.

How to verify if PDF is signed with this key? How to get $data and $signature for compare?

Vitalicus
  • 1,188
  • 13
  • 15
  • 1
    TCPDF has no support for actually reading or parsing the PDF files. Have been looking around, from what I can see, this is the nearest example: https://newbedev.com/how-to-retrieve-digital-signature-information-from-pdf-with-php. This explains how to get `$signature` but I am not sure how to get `$data` since the signature is part of the PDF it can't possibly be part of the data. Your best bet seems to be to reverse engineer this part of the PDF generation: https://github.com/tecnickcom/TCPDF/blob/456b794f1fae9aee5c151a1ee515aae2aaa619a3/tcpdf.php#L7591 – Dylan Reimerink Nov 15 '21 at 17:59
  • 1
    Best option is to use PDF Tool set (read pdf component or library) that provides complete functionality. If PHP don't have better toolset for pdf, you may use pdf components in other platform (even free are available) and integrate through Rest API or similar to PHP application. One such example is https://cors.signer.digital/ which uses Rest API provided by https://webserver.signer.digital/swagger/index.html – Bharat Vasant Nov 16 '21 at 05:07

0 Answers0