Test vectors make sure that every PDF-PQS signer and verifier agrees on the exact same behavior, down to edge cases like tampered bytes, stripped signatures, expired certificates, and linearized PDFs.
Each vector consists of a synthetic PDF file, the exact inputs to hand your verifier, and the expected result and codes. Everything lives in the pdf-pqs/spec repository alongside a dedicated test CA (whose private keys are intentionally public for testing only).
How to run the test vectors
To test your own verifier against vectors/manifest.json:
- Load the local PKI files. Read
trustAnchors,certificates, andcrlsfrom each vector’sinputsobject. All file paths are relative to the root ofpdf-pqs/spec. - Mock domain discovery. Use
inputs.policyDocumentsas the policy document for each listed domain. Treat any domain not listed there as publishing no policy document. - Stay offline. Resolve any HTTPS URLs from
inputs.resourcesinstead of making live network calls. - Pin the clock. Pass
inputs.validationTimeas the verification time instead of reading your system clock, so certificate expiration and CRL checks stay deterministic. - Compare outputs. Check that your verifier’s
result, per-signaturecodes, andfileCodesmatchexpected. The order of codes inside a list does not matter.
Note that signatures in expected.signatures are ordered by ascending L (with Place A before Place B when L is equal). The TypeScript signer generates all vector PDFs, and the File column below displays the first 12 hex characters of each file’s SHA-256 hash (hover to see the full hash).
Vectors
Manifest version 1, draft draft-laget-pdf-pqs-00, from pdf-pqs/spec 0015f07816f474377c007e56f1157289a15b9de0.45 vectors, 45 with a generated file.
| Id | Description | Result | Signatures and codes | File codes | File |
|---|---|---|---|---|---|
plain | A synthetic one-page PDF with no signature. | no-signature | none | none | 00567104b0ab |
place-b | The plain document plus a place B attachment pdfpqs-1.p7s, signed by signer (ML-DSA-65). | valid | B, L = 1044: W_NO_TIMESTAMP | none | a861615d0180 |
place-b-timestamped | As place-b, with an ML-DSA timestamp (genTime 2026-12-10T00:00:00Z). | valid | B, L = 1044: no code | none | 8df47c579d32 |
place-a | The plain document plus an RSA host signature by classical-seal. Its SignerInfo carries a PDF-PQS signature by signer in place A. The example.com policy requires PQC; place A covers the seal. | valid | A, L = 1044: W_NO_TIMESTAMP | none | 5c137dbd7b8f |
two-signatures | place-b plus a second place B attachment pdfpqs-2.p7s that covers the first one. | valid | B, L = 1044: W_NO_TIMESTAMP, W_CHANGES_AFTER_LB, L = 12719: W_NO_TIMESTAMP | none | 7d0527d66553 |
mldsa-87 | As place-b, signed by signer-87 (ML-DSA-87). | valid | B, L = 1044: W_NO_TIMESTAMP | none | c96770568b30 |
stripped | place-a with the PDF-PQS attribute removed from the RSA seal. The example.com policy requires PQC from 2026-12-01, and the seal has no timestamp. | invalid | none | E_PQC_REQUIRED_MISSING | 1403cd195168 |
legacy-classical | The plain document plus an RSA seal with a classical timestamp at 2026-11-15T00:00:00Z, before pqcRequiredFrom. No PDF-PQS signature. Step 11 ignores the classical timestamp, so the seal has no known time. | invalid | none | E_PQC_REQUIRED_MISSING | 92f8b01131f6 |
changed-after-l | place-b plus an incremental update that adds text to the page. | valid | B, L = 1044: W_NO_TIMESTAMP, W_CHANGES_AFTER_L | none | 3f23f82f2b3a |
tampered-byte | place-b with one byte changed inside a page content stream in [0, L). | invalid | B, L = 1044: E_DIGEST_MISMATCH | none | c26d1e31cd4b |
not-revision-end | A place B signature whose L is 10 bytes before the end of the first revision. The digest covers that [0, L). | invalid | B, L = 1034: E_NOT_REVISION_END | none | 6509607aec63 |
length-beyond-file | A place B signature whose L is 1000 bytes larger than the file. | invalid | B, L = 13719: E_LENGTH_OUT_OF_RANGE | none | 001571dcf930 |
wrong-digest | A place B signature whose message-digest is the SHA-512 of other bytes. The ML-DSA signature over the signed attributes is valid. | invalid | B, L = 1044: E_DIGEST_MISMATCH | none | ba6e0b55090f |
bad-signature | place-b with one bit of the ML-DSA signature value changed. | invalid | B, L = 1044: E_SIGNATURE_INVALID | none | 9eec58a175cc |
mldsa-44 | A place B signature by signer-44 (ML-DSA-44, forbidden). | invalid | B, L = 1044: E_ALG_NOT_ALLOWED | none | b439cd273a9f |
missing-byte-length | A place B signature with no pdf-byte-length signed attribute. | invalid | B: E_PROFILE | none | 937353bc51b4 |
extra-signer | A place B SignedData with two SignerInfos (signer and signer-87). | invalid | B, L = 1044: E_PROFILE | none | 2a3f06ca348f |
corrupt-payload | A place B attachment pdfpqs-1.p7s whose bytes are not DER. | invalid | B: E_PARSE | none | 857eaa2034b6 |
not-a-pdf | A file that is not a PDF. | invalid | none | E_PARSE | ac0b6c8ab3c6 |
signing-cert-mismatch | A place B signature whose signing-certificate-v2 identifies signer-87, not the signer certificate. | invalid | B, L = 1044: E_SIGNING_CERT_MISMATCH | none | ef361115b2cb |
revoked | A place B signature by revoked (revoked 2026-11-20, superseded), with no timestamp. | invalid | B, L = 1044: E_REVOKED | none | dcdc63259bfc |
revoked-after-timestamp | A place B signature by revoked, with an ML-DSA timestamp at 2026-11-10T00:00:00Z, before the revocation. The reason is not keyCompromise. | valid | B, L = 1044: no code | none | 48dab84a2856 |
revoked-before-timestamp | A place B signature by revoked, with an ML-DSA timestamp at 2026-11-25T00:00:00Z, after the revocation. | invalid | B, L = 1044: E_REVOKED | none | a7bc8482cbb1 |
revoked-key-compromise | A place B signature by revoked-kc (revoked 2026-11-20, keyCompromise), with an ML-DSA timestamp at 2026-11-10T00:00:00Z. | invalid | B, L = 1044: E_REVOKED | none | 43349e62ee3d |
expired | A place B signature by expired (notAfter 2026-06-30), with no timestamp. | invalid | B, L = 1044: E_CERT_EXPIRED | none | 1b4599e2806a |
expired-timestamped | A place B signature by expired, with an ML-DSA timestamp at 2026-03-01T00:00:00Z, inside its validity. | valid | B, L = 1044: no code | none | dd551ea6e1d5 |
domain-only | A place B signature by domain-signer (signer@example.net). Its CA is not a trust anchor. The example.net policy document lists it. | valid-domain-only | B, L = 1044: W_DOMAIN_ONLY, W_NO_TIMESTAMP | none | baf24bd342c7 |
untrusted-chain | As domain-only, but example.net publishes no policy document. | invalid | B, L = 1044: E_PATH_INVALID | none | de63ead5c1af |
classical-timestamp | As place-b, with a timestamp by classical-tsa (RSA). The verifier ignores it. | valid | B, L = 1044: W_NO_TIMESTAMP | none | 8034ccfb048f |
timestamp-invalid | As place-b-timestamped, but the message imprint of the ML-DSA timestamp is the hash of other bytes. | invalid | B, L = 1044: E_TIMESTAMP_INVALID | none | e1a3d95c8618 |
crl-missing | As place-b, but the inputs have no CRL of client-example. | invalid | B, L = 1044: E_REVOCATION_UNKNOWN | none | e756c10e880a |
place-a-wrong-l | A document with two revisions, then an RSA seal in a third revision. Its place A signature has L at the end of the first revision. | invalid | A, L = 1044: E_HOST_BOUNDARY | none | 95a5e513251d |
fieldmdp-place-a | A synthetic form with an RSA approval signature by classical-approver and a FieldMDP lock, then an RSA seal by classical-seal with a place A signature. The example.com policy requires PQC. | valid | A, L = 35505: W_NO_TIMESTAMP | none | ad94ab191cb5 |
pqc-other-domain | The plain document plus an RSA seal by classical-seal (seal@example.com). Its place A signature is by domain-signer (signer@example.net), a valid signature of another domain. The example.com policy requires PQC. | invalid | A, L = 1044: W_DOMAIN_ONLY, W_NO_TIMESTAMP | E_PQC_REQUIRED_MISSING | 73732284a650 |
eof-in-stream | The plain document plus a revision that attaches an uncompressed copy of it, then a place B signature whose L is directly after the %%EOF LF inside that attachment stream. | invalid | B, L = 2321: E_NOT_REVISION_END | none | e2ee55112227 |
embedded-pdf | As eof-in-stream, but L is the end of the revision that attaches the PDF. A verifier must not take the %%EOF in the stream as a revision end. | valid | B, L = 2825: W_NO_TIMESTAMP | none | 2e6d827593d0 |
xref-stream | The plain document rewritten with a cross-reference stream and object streams (qpdf), plus a place B signature in an update with a cross-reference stream. | valid | B, L = 912: W_NO_TIMESTAMP | none | a966bde0a97a |
linearized | The plain document linearized (qpdf), plus a place B signature. The linearized first revision has two %%EOF markers and ends after the main section. | valid | B, L = 1515: W_NO_TIMESTAMP | none | 3354eabd1d0a |
linearized-first-page | The linearized document plus a place B signature whose L is directly after the %%EOF of the first-page section. | invalid | B, L = 492: E_NOT_REVISION_END | none | d2ec0e5d1daa |
place-b-shadow | place-b with [0, L) kept and the signature revision rewritten: it adds the same pdfpqs-1.p7s and also draws new text on the page. | valid | B, L = 1044: W_NO_TIMESTAMP, W_CHANGES_AFTER_L | none | 11e964334613 |
place-b-late-attachment | The plain document plus a revision that draws text, then a revision that attaches a place B signature over the plain document. No signature covers the middle revision. | valid | B, L = 1044: W_NO_TIMESTAMP, W_CHANGES_AFTER_L | none | c1bba1d6fa45 |
policy-unavailable | The stripped file. The example.com policy document is unavailable and the verifier has no copy. | invalid | none | E_POLICY_UNAVAILABLE | 1403cd195168 |
place-a-policy-unavailable | The place-a file. The example.com policy document is unavailable, but the place A signature covers the seal, so step 11 needs no policy document. | valid | A, L = 1044: W_NO_TIMESTAMP | none | 5c137dbd7b8f |
place-a-host-change | As place-a, but the host revision also draws new text on the page. The page content is not a change that a signature revision needs. | valid | A, L = 1044: W_NO_TIMESTAMP, W_CHANGES_AFTER_L | none | 2547fe196d49 |
subdomain-signer | A place B signature by sub-signer (signer@sub.example.net), from the example.net CA. Only the parent domain example.net publishes a policy document, and a verifier does not use it for the subdomain. | invalid | B, L = 1044: E_PATH_INVALID | none | 416439b1d452 |
The JSON Schema for the manifest is in vectors/manifest.schema.json, and vectors/README.md documents how each vector file is generated.