fix(validate-signature): detect and verify document timestamps

PDFs whose only signature is an RFC 3161 document timestamp
(/Type /DocTimeStamp, /SubFilter /ETSI.RFC3161) were reported as having
no signatures, because timestamp dictionaries were skipped on purpose.
node-forge also cannot parse a timestamp token directly, since it only
accepts SignedData that wraps plain data.

Timestamps are now extracted and flagged as such. The TSTInfo is read
from the token, and verification checks that its messageImprint matches
the signed byte range and that the TSA signature covers the TSTInfo.
The timestamp's genTime is shown as the date, and the result card uses
timestamp wording.

Fixes #952
This commit is contained in:
Atharva Bedekar committed 2026-10-26 17:33:16 +05:30
1 parent 7abb219565
commit 2daa7e2ad0
6 files changed
+363 -29

No files matched your search

+48
View File
@@ -2155,6 +2155,12 @@
],
"fileCount": 1
},
"Could not read the timestamp token": {
"files": [
"logic/validate-signature-pdf.ts"
],
"fileCount": 1
},
"Could not reduce file size further. Original: {{originalSize}}, New: {{compressedSize}}.": {
"files": [
"logic/compress-pdf-page.ts"
@@ -2580,12 +2586,24 @@
],
"fileCount": 1
},
"Document Timestamp {{n}}": {
"files": [
"logic/validate-signature-pdf-page.ts"
],
"fileCount": 1
},
"Document Type": {
"files": [
"logic/page-dimensions-page.ts"
],
"fileCount": 1
},
"Document hash does not match the timestamp: PDF was modified after timestamping": {
"files": [
"logic/validate-signature-pdf.ts"
],
"fileCount": 1
},
"Document properties": {
"files": [
"logic/edit-pdf-text-dock.ts"
@@ -5246,6 +5264,12 @@
],
"fileCount": 1
},
"Modified After Timestamping (timestamped part intact)": {
"files": [
"logic/validate-signature-pdf-page.ts"
],
"fileCount": 1
},
"More": {
"files": [
"logic/edit-pdf-text-dock.ts"
@@ -8977,6 +9001,24 @@
],
"fileCount": 1
},
"Timestamp Intact: Timestamp Authority Not Verified": {
"files": [
"logic/validate-signature-pdf-page.ts"
],
"fileCount": 1
},
"Timestamped By": {
"files": [
"logic/validate-signature-pdf-page.ts"
],
"fileCount": 1
},
"Timestamped On": {
"files": [
"logic/validate-signature-pdf-page.ts"
],
"fileCount": 1
},
"Tint": {
"files": [
"workflow/nodes/adjust-colors-node.ts"
@@ -9514,6 +9556,12 @@
],
"fileCount": 1
},
"Valid Timestamp": {
"files": [
"logic/validate-signature-pdf-page.ts"
],
"fileCount": 1
},
"Valid Until": {
"files": [
"logic/validate-signature-pdf-page.ts"