1

I want to sign a PDF file with an eID card (essentially a smartcard), preferably in python.

I accomplished to have a signed hash of the file, but I can't find out how to embed this hash with the PDF file; and I presume the certificate will also need to be embedded?

Can you point me to some usable libraries or samples?

Maarten Ureel
  • 393
  • 4
  • 18
  • Possible duplicate of [How to digitally sign PDF documents using Python with an etoken (pen drive)?](https://stackoverflow.com/questions/45058556/how-to-digitally-sign-pdf-documents-using-python-with-an-etoken-pen-drive) – clubby789 Aug 08 '19 at 12:28
  • Not really, because in that example they provide the P12 certificate. I don't have those. I only have a SHA256 hash of the file that has been signed with the smartcard, and the public certificates (without private keys etc). – Maarten Ureel Aug 08 '19 at 12:51
  • What about https://stackoverflow.com/questions/29629410/sign-pdf-documents-digitally-with-python – clubby789 Aug 08 '19 at 12:51
  • That last one also doesn't apply, because you need to configure the signing information in a config file. However the signer is a visitor of our web application. Imagine it like this; you get a PDF offer in front of you, using some local eID library you can get a signed hash of the file. I want to send the signed hash back to my server side and add it to the PDF. – Maarten Ureel Aug 08 '19 at 12:59

0 Answers0