Having trouble validating programmatically Digital Signature in a PDF
- April 14, 2021
- 2 replies
- 3477 views
Hello,
So as the title suggests, I'm trying to write Python code to validate digital signatures in PDF 1.6 files.
I read all the documentation I could find on the subject, but the truth is I can't understand how Adobe comes up with its signature.
Indeed, the signature part of the file looks like this :
397 0 obj
<</ByteRange[ 0 93895 98647 2347558] /Contents<3082......0a000000...000>/Filter .....
When I manually decode the signature in the PKCS7 data I obtain a hash :
1446...78f2
But, when I hash the following data :
%PDF-1.6.....<</ByteRange[ 0 93895 98647 2347558] /Contents/Filter....%EOF[0x0d0a]
I can't get the same hash (d2c9...02af)
Same goes for : %PDF-1.6.....<</ByteRange[ 0 93895 98647 2347558] /Contents<>/Filter....%EOF[0x0d0a] with hash 96d0...3fb2
Can somebody help me figure this out ?
