Extract digital signature in pdf using python

Viewed 2389

I need to get the digitally signed signature content like name of signature and signed date and coordinate of the whole signature part.

I tried using different modules like pypdf2, pdfminer and endesive modules, Out of these endesive modules is giving whether the digital signature is there in that pdf document or not.

This is the code base to get whether signature is there or not by using endesive module.

   fname = 'filename'
   data = open(fname, 'rb').read()
   pdf.verify(data)

   The above code gives the following output.
   cert.issuer: OrderedDict([('common_name', 'Srikanth'), ('organization_name', ''), ('organizational_unit_name', ''), ('email_address', 'srikanth@yahoo.com'), ('country_name', 'India')])
cert.subject: OrderedDict([('common_name', 'Srikanth'), ('organization_name', ''), ('organizational_unit_name', ''), ('email_address', 'srikanth@yahoo.com'), ('country_name', 'India')])
Out[13]: (True, True, False)

Please see the below reference link to get the sample digital signature: https://www.globalsign.com/en-in/blog/certifying-vs-approval-signatures-in-adobe/

I need to get the digital signature values like: Person name: Daniel Farrel Signed Date: 2017.10.05 08.44.11 -04'00'

1 Answers
Related