Closed rcx986635 closed 7 months ago
@JorjMcKie thank u for any suggestions
Thank you for your post. Creating signature annotations and signing a document are supported in the base library MuPDF, but not yet in PyMuPDF. I am marking this as enhancement request.
@JorjMcKie Thanks for your reply. But I just want to find a way to ensure the signature in the pdf is not fake , some way like that using SubFilter-adbe.x509.rsa_sha1 we can transfer a to b ,then we can verify the signature.
Once you know / have identified the xref (as you did), you can extract the /ByteRange
and /Contents
values. These are doc.xref_get_key(xref, "ByteRange")[1]
, resp. doc.xref_get_key(xref, "Contents")[1]
. The ByteRange array shows which parts of the file have been used to compute the Contents string using the Filter/Subfilter algorithms.
So if you know how to invoke those filters, you can create a bytes string of the PDF file according to the rule in ByteRange and verify that the result equals the Contents string.
Once you know / have identified the xref (as you did), you can extract the
/ByteRange
and/Contents
values. These aredoc.xref_get_key(xref, "ByteRange")[1]
, resp.doc.xref_get_key(xref, "Contents")[1]
. The ByteRange array shows which parts of the file have been used to compute the Contents string using the Filter/Subfilter algorithms. So if you know how to invoke those filters, you can create a bytes string of the PDF file according to the rule in ByteRange and verify that the result equals the Contents string.
Thank you very very very much, I got it.
This open for some time now. Properly dealing with request is possible only once we implement full signature support. Currently there are no plans to do this in the foreseeable future.
then , how to verify the signature, or how to know the signature is valid but modified by someone ,thank you