MatthiasValvekens / pyHanko

pyHanko: sign and stamp PDF files
MIT License
483 stars 71 forks source link

Validating signature with embedded timestamp fails on 0.19.0 #292

Closed ofcaah closed 1 year ago

ofcaah commented 1 year ago

Hi, while validating a document with signature containing an embedded timestamp:

File "/home/user/.local/lib/python3.11/site-packages/pyhanko/pdf_utils/generic.py", line 2164, in parse_pdf_date raise PdfReadError(f"{date_str} does not appear to be a date string.") pyhanko.pdf_utils.misc.PdfReadError: 20230719131933+02'00' does not appear to be a date string.

Adobe Reader doesn't have any complaints and verifies signature as valid and trusted.

MatthiasValvekens commented 1 year ago

Hi @ofcaah,

Sorry about the delay. The issue is that your date entry is missing the mandatory D: prefix for date strings in PDF. I'll see what I can do to overlook that in nonstrict mode.