-
Notifications
You must be signed in to change notification settings - Fork 1.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
ENH: Support detection of digital signatures #2655
Comments
You are of course invited to propose a corresponding PR with tests and being compatible with Python 3.7 as well. |
Thanks for the invitation. But I don't have the necessary know-how for this PR and am not currently available to learn by doing ;-) For a personal application, which I use several times a day in production, I have on the other hand carried out tests (signed and unsigned files) of very reasonable reliability, but cannot communicate these files as private. Do all the test files in the pypdf project contain signed files? |
Encryption is not signauture. Also signature is a complex process for both signature and validation. |
Currently we have not signed document |
@pubpub-zz Your are right. Preliminary statement: in PDF format, I'm just an unfortunate self-taught man with his limits... Sharing these limitations often allows us to go further together ;-) So can you suggest a realistic scenario (or better still show a file) where such a field would be present without the PDF containing a valid signature, or one that was or will be valid? This proposal simply concerns the detection of digital signatures and not, of course, their validation. The naming can lead to confusion: Furthermore, the proposed algorithm, here adapted to the This heuristic is undoubtedly not perfect, but better (at this time) than others on the web. |
The lack of test files (valid/invalid digital signature) will not help testing or short-term development. So below 4 different signed documents (3 only with a valid signature) as test files: |
I vaguely remember that we decided against adding signature support as we wanted to focus on other parts + pyHanko exists: https://pypi.org/project/pyHanko/ |
Since we closed those issues, quite a lot of improvements were done. I would be open to discuss this topic again. We would need to clarify:
|
is_signed
PdfReader/PdfWrite
I personally do not think that we should really start with the signature stuff. We already have the pyHanko project which does this completely fine (although on an older copy of pypdf) - why should we re-implement this here while just increasing the maintenance load? |
As said earlier, signing is quite tough : In order to be efficient the solution needs to apply work with PKCS / PKI. I have not used yet |
According to MatthiasValvekens/pyHanko#127 and MatthiasValvekens/pyHanko#335 (comment), there are quite some changes which make it hard to update pypdf to the latest version on pyHanko. pyHanko itself embeds an own, heavily modified copy of some older PyPDF2 version. Upgrading will most likely be a large and tedious task, while there are more important aspects to work on in my opinion. |
#2655 (comment) These PDFs have been produced especially for the test base of this project, which I appreciate both for its didactic contribution and as a user of the functions developed. Thank you to all those who are helping to bring it to life. |
based on exchanges I convert this thread into a discussion |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Explanation
IMHO
pypdf
deserves that theis_encrypted
property be completed byis_signed
(Digitally signed).Code Example
How would your feature be used? (Remove this if it is not applicable.)
The text was updated successfully, but these errors were encountered: