Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add digital signature support #302

Closed
alexis-via opened this issue Nov 8, 2016 · 6 comments
Closed

Add digital signature support #302

alexis-via opened this issue Nov 8, 2016 · 6 comments
Labels
is-feature A feature request PdfWriter The PdfWriter component is affected

Comments

@alexis-via
Copy link

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 #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.

@nitrocode
Copy link

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:

@joelricci
Copy link

joelricci commented May 29, 2020

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.

@MartinThoma
Copy link
Member

pyHanko supports adding digital siguatures. I spoke a bit with the project members: MatthiasValvekens/pyHanko#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?

@MartinThoma MartinThoma added the PdfWriter The PdfWriter component is affected label Jul 9, 2022
@alexis-via
Copy link
Author

Yes, let's close it!

@MatthiasValvekens
Copy link

MatthiasValvekens commented Jul 10, 2022

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 :).

@MartinThoma
Copy link
Member

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-feature A feature request PdfWriter The PdfWriter component is affected
Projects
None yet
Development

No branches or pull requests

5 participants