Closed alexis-via closed 2 years ago
Probably wouldn't be too difficult to add.
I'd like the ability to add a signature field to an existing PDF and be able to sign an existing PDF's signature field.
<<
/T (My Signature)
/Subtype /Widget
/FT /Sig
/F 4
/Q 1
/MK << /BC [] >>
>>
From How to attach a digital signature to my pdf created by xetex?
Other references:
12.7.4.5 Signature Fields
I'm trying to find a library with PAdES support. There is https://github.com/m32/endesive, which seems to be work in progress, but it's unclear to me wether it supports PAdES and in that case which profiles are supported.
pyHanko supports adding digital siguatures. I spoke a bit with the project members: https://github.com/MatthiasValvekens/pyHanko/discussions/127
I like the feature, but I also don't see the need to add it directly to PyPDF2. We have a couple of other topics/bugs in PyPDF2 which we should improve and pyHanko could be used in combination with PyPDF2.
For that reason, I would close this issue as "not in 2022". If anybody still feels we need it, we can open it in 2023 again. Are there any objections?
Yes, let's close it!
I'm trying to find a library with PAdES support. There is https://github.com/m32/endesive, which seems to be work in progress, but it's unclear to me wether it supports PAdES and in that case which profiles are supported.
For the record, pyHanko supports all PAdES baseline profiles out of the box :).
I'm closing this issue for the moment. It's important to get everything right when dealing with cryptography - partial solutions are likely doing more harm than good.
If we get more active developers / active contributors who feel very confident in that topic, we can discuss it again.
For the moment, please have a look at pyHanko :-)
AFAIK, there is still no opensource Python lib to generate a signed PDF. This is becoming more and more important with the adoption of electronic invoicing ; some countries or administration now require signed PDF to consider the invoice as valid.
There was an old bug report about it https://github.com/mstamy2/PyPDF2/issues/101 ; but it has been closed and the author of the bug developed a wrapper on the opensource Java lib that signs PDF called jPDFsign http://private.sit.fraunhofer.de/~stotz/software/jpdfsign/ His python wrapper is here: https://github.com/ovnicraft/signer
But I think we really need a pure-python lib to generate a signed PDF... and PyPDF2 would be the ideal place to have this feature.