0
votes

I have two files. one is doc and another is pdf. Now, what I want to do:

  1. try to extract the information of digital certificate(if exists) from the doc/pdf.
  2. Verify the information.

I tried to get the information of digital certificate from doc/pdf using OPENSSL, CERTUTIL, JAVA, PHP, iTEXT, TCPDF etc etc. There are tons of way to sign a file or get information from cert/pem etc. but how to get the file which contains the information of that specific word/pdf file.

Now, I even do not know, where the digital certificate stored in the MS word and PDF. Has anyone any idea on this ?

Thank you for taking your time. ANY OPINION will be a bug help for this newbie.

1
As Eugene said in his answer, special PDF and doc solutions are required, and you calling yourself a newbie had better not try and build such a solution from scratch. In addition to his answer you should also be aware that depending on what you verify the data for, additional legal requirements may have to be taken into account on top of what the existing solutions do for you.mkl

1 Answers

-1
votes

Both DOC/DOCX formats and PDF formats define digital signatures in format specifications. You can't use OpenSSL or other similar general-purpose stuff for verifying signatures of documents in these formats. Maybe iText can validate the PDF signature, but I have yet to see a library to handle DOCs.

The SecureBlackbox component suite (namely its OfficeBlackbox and PDFBlackbox packages), which we maintain, can do exactly what you need - validate digital signatures, extract and validate certificates used to sign documents in Office (MS Office, OpenOffice/LibreOffice) and PDF documents.