PDF-PQS defines two places inside a PDF file to store the post-quantum signature: Place A (inside an existing classical signature) and Place B (as an embedded file attachment).
In both cases, the cryptographic payload is identical (the exact same DER-encoded CMS signature), and every PDF-PQS verifier must support both. Which one you choose as a signer depends on whether you are already applying a classical PDF signature and whether the PDF restricts attachments.
Which one should you use?
- Choose Place A whenever you are already applying a classical PDF signature (RSA or ECDSA), or when the PDF forbids new file attachments (for example, certain certified PDFs or PDF/A-1 and PDF/A-2 archives).
- Choose Place B when you want to add a standalone post-quantum signature to a PDF without adding a new classical signature field (for example, sealing an existing document in a backend pipeline).
Place A: inside a classical host signature
In Place A, the PDF-PQS signature rides along inside a regular classical PDF signature (called the host signature). Technically, it is stored as an unsigned attribute inside the classical signature’s CMS SignerInfo, under OID id-aa-pdfpqsSignature (N.1.1).
Why does this work without breaking existing PDF viewers? In CMS (the standard signature container used by PDFs), unsigned attributes live outside the bytes that the classical signature signs. PDF viewers like Adobe Acrobat that do not know about PDF-PQS simply skip unrecognized unsigned attributes, so the classical signature still shows up as completely valid.
Key rules for developers implementing Place A:
- L points before the host signature.
Lmust equal the file length right before the incremental update that adds the host signature. That means the PDF-PQS signature protects the document content itself, not the classical signature bytes. - One attribute per host signature. The
id-aa-pdfpqsSignatureattribute must appear at most once per hostSignerInfoand carry a single value. - Insert before DSS or document timestamps. Add the PDF-PQS attribute before generating a Document Security Store (DSS) entry or document timestamp for the host signature, because both depend on the final
/Contentsbytes of the host signature. - Reserve enough placeholder space. When your PDF library allocates the
/Contentsbyte buffer for the classical signature, make sure it is large enough to hold both the classical signature and the ML-DSA payload. Reserving 32,768 bytes (32 KB) is plenty for a single ML-DSA-65 signature plus a post-quantum timestamp.
Place A is also the right choice when a document has a FieldMDP lock (which restricts editing form fields) or a DocMDP certification that allows new signatures but blocks new attachments. The fieldmdp-place-a test vector demonstrates this scenario.
Place B: as an attached file
In Place B, the signer appends a small incremental update starting at byte L that attaches the raw binary signature (ContentInfo) as an embedded file inside the PDF.
Key rules for developers implementing Place B:
- Predictable filenames. Set both
/Fand/UFin the file specification dictionary topdfpqs-<n>.p7s, starting atpdfpqs-1.p7sand incrementing by 1 for each additional Place B signature in the file. - Standard metadata. Set
/AFRelationshipto/Supplementand set the embedded file stream’s/Subtypeto/application#2Fpkcs7-signature. - Link from the catalog. Reference the file specification in both the PDF catalog’s
/AFarray and its/EmbeddedFilesname tree. Verifiers look in/EmbeddedFilesto find Place B signatures. - Do not bump the PDF version. Older PDF 1.7 readers safely ignore the PDF 2.0
/AFkeys while still understanding/EmbeddedFiles, so do not change the PDF header version just to add a Place B attachment.
When neither Place A nor Place B is allowed
Some PDFs are locked with a DocMDP certification signature at permission level 1, which means “no further changes of any kind are permitted.” Adding any incremental update, whether Place A or Place B, will break that certification seal. Signers must refuse to add a PDF-PQS signature to a level-1 certified document.
Similarly, if a document claims DocMDP level 2 or 3, or PDF/A-1 or PDF/A-2 archival conformance, Place B is not allowed because embedded non-PDF/A files are forbidden. Use Place A instead. (PDF/A-3 does allow Place B.)
For the formal specification of both placements and restrictions, see Section 6.