We are doing the RPA project and extract the data PDF to excel using python. Now we need verify the digital_signature in PDF.

- 18,030
- 8
- 52
- 77

- 27
- 1
- 6
-
If by `digital_signatures`, you mean "hashes", you can use [`hashlib`](https://docs.python.org/3/library/hashlib.html) library. – Rahul Goswami Nov 28 '19 at 12:40
-
I am talking about digital signature which is added by API's. – Anuj Pratap Singh Nov 28 '19 at 12:48
2 Answers
According to PDF 1.7 spec a document may contain:
- one or more approval signatures
- at most one certification signature
- at most two usage rights signatures
There are also 2 defined digest computing techniques. So there is no short answer and checking digital signatures might be tricky.
See PDF 1.7 section 12.8 Digital Signatures
As far as I know there is no ready-to-run python library to check all possible PDF signatures. You may try to use pdfreader to browse PDF document structure and to compute and check the signatures. See few examples

- 18,030
- 8
- 52
- 77
You can check out https://cbrunet.net/python-poppler/usage.html#working-with-documents
which allows to load all PDF metadata as a Python dict.
If you need a dedicated function for signature validation, I think you need to ask specifically for the devs to implement it: https://github.com/cbrunet/python-poppler/issues

- 698
- 4
- 15