This repository contains a Python CLI script that attaches an RFC 3161 document timestamp to a PDF using pyHanko.
A qualified timestamp depends on your TSA provider. To produce a qualified timestamp, use a qualified TSA endpoint with --tsa-url.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtSign one or more PDFs in-place:
python timestamp-pdf.py sign input.pdf another.pdf \
--tsa-url "https://your-qualified-tsa.example/rfc3161"Use a fixed signature field name when signing:
python timestamp-pdf.py sign input.pdf --field-name DocTimeStampDon't embed LTV validation info (DSS/VRI) after signing:
python timestamp-pdf.py sign input.pdf --no-ltvExtract RFC3161 timestamp values from one or more PDFs:
python timestamp-pdf.py extract input.pdf another.pdf--md-algorithmdefaults tosha256.- The script creates an incremental update in the PDF, preserving prior revisions.
- If your TSA requires custom auth headers or mTLS, extend the script's
HTTPTimeStamperconfiguration.