Skip to content

Test vectors

Standard test PDFs and expected verification results that every PDF-PQS implementation must pass.

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:

  1. Load the local PKI files. Read trustAnchors, certificates, and crls from each vector’s inputs object. All file paths are relative to the root of pdf-pqs/spec.
  2. Mock domain discovery. Use inputs.policyDocuments as the policy document for each listed domain. Treat any domain not listed there as publishing no policy document.
  3. Stay offline. Resolve any HTTPS URLs from inputs.resources instead of making live network calls.
  4. Pin the clock. Pass inputs.validationTime as the verification time instead of reading your system clock, so certificate expiration and CRL checks stay deterministic.
  5. Compare outputs. Check that your verifier’s result, per-signature codes, and fileCodes match expected. 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.

IdDescriptionResultSignatures and codesFile codesFile
plainA synthetic one-page PDF with no signature.no-signaturenonenone00567104b0ab
place-bThe plain document plus a place B attachment pdfpqs-1.p7s, signed by signer (ML-DSA-65).valid
B, L = 1044: W_NO_TIMESTAMP
nonea861615d0180
place-b-timestampedAs place-b, with an ML-DSA timestamp (genTime 2026-12-10T00:00:00Z).valid
B, L = 1044: no code
none8df47c579d32
place-aThe 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
none5c137dbd7b8f
two-signaturesplace-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_L
B, L = 12719: W_NO_TIMESTAMP
none7d0527d66553
mldsa-87As place-b, signed by signer-87 (ML-DSA-87).valid
B, L = 1044: W_NO_TIMESTAMP
nonec96770568b30
strippedplace-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.invalidnoneE_PQC_REQUIRED_MISSING1403cd195168
legacy-classicalThe 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.invalidnoneE_PQC_REQUIRED_MISSING92f8b01131f6
changed-after-lplace-b plus an incremental update that adds text to the page.valid
B, L = 1044: W_NO_TIMESTAMP, W_CHANGES_AFTER_L
none3f23f82f2b3a
tampered-byteplace-b with one byte changed inside a page content stream in [0, L).invalid
B, L = 1044: E_DIGEST_MISMATCH
nonec26d1e31cd4b
not-revision-endA 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
none6509607aec63
length-beyond-fileA place B signature whose L is 1000 bytes larger than the file.invalid
B, L = 13719: E_LENGTH_OUT_OF_RANGE
none001571dcf930
wrong-digestA 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
noneba6e0b55090f
bad-signatureplace-b with one bit of the ML-DSA signature value changed.invalid
B, L = 1044: E_SIGNATURE_INVALID
none9eec58a175cc
mldsa-44A place B signature by signer-44 (ML-DSA-44, forbidden).invalid
B, L = 1044: E_ALG_NOT_ALLOWED
noneb439cd273a9f
missing-byte-lengthA place B signature with no pdf-byte-length signed attribute.invalid
B: E_PROFILE
none937353bc51b4
extra-signerA place B SignedData with two SignerInfos (signer and signer-87).invalid
B, L = 1044: E_PROFILE
none2a3f06ca348f
corrupt-payloadA place B attachment pdfpqs-1.p7s whose bytes are not DER.invalid
B: E_PARSE
none857eaa2034b6
not-a-pdfA file that is not a PDF.invalidnoneE_PARSEac0b6c8ab3c6
signing-cert-mismatchA place B signature whose signing-certificate-v2 identifies signer-87, not the signer certificate.invalid
B, L = 1044: E_SIGNING_CERT_MISMATCH
noneef361115b2cb
revokedA place B signature by revoked (revoked 2026-11-20, superseded), with no timestamp.invalid
B, L = 1044: E_REVOKED
nonedcdc63259bfc
revoked-after-timestampA 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
none48dab84a2856
revoked-before-timestampA 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
nonea7bc8482cbb1
revoked-key-compromiseA 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
none43349e62ee3d
expiredA place B signature by expired (notAfter 2026-06-30), with no timestamp.invalid
B, L = 1044: E_CERT_EXPIRED
none1b4599e2806a
expired-timestampedA 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
nonedd551ea6e1d5
domain-onlyA 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
nonebaf24bd342c7
untrusted-chainAs domain-only, but example.net publishes no policy document.invalid
B, L = 1044: E_PATH_INVALID
nonede63ead5c1af
classical-timestampAs place-b, with a timestamp by classical-tsa (RSA). The verifier ignores it.valid
B, L = 1044: W_NO_TIMESTAMP
none8034ccfb048f
timestamp-invalidAs 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
nonee1a3d95c8618
crl-missingAs place-b, but the inputs have no CRL of client-example.invalid
B, L = 1044: E_REVOCATION_UNKNOWN
nonee756c10e880a
place-a-wrong-lA 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
none95a5e513251d
fieldmdp-place-aA 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
nonead94ab191cb5
pqc-other-domainThe 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_MISSING73732284a650
eof-in-streamThe 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
nonee2ee55112227
embedded-pdfAs 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
none2e6d827593d0
xref-streamThe 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
nonea966bde0a97a
linearizedThe 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
none3354eabd1d0a
linearized-first-pageThe 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
noned2ec0e5d1daa
place-b-shadowplace-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
none11e964334613
place-b-late-attachmentThe 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
nonec1bba1d6fa45
policy-unavailableThe stripped file. The example.com policy document is unavailable and the verifier has no copy.invalidnoneE_POLICY_UNAVAILABLE1403cd195168
place-a-policy-unavailableThe 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
none5c137dbd7b8f
place-a-host-changeAs 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
none2547fe196d49
subdomain-signerA 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
none416439b1d452

The JSON Schema for the manifest is in vectors/manifest.schema.json, and vectors/README.md documents how each vector file is generated.

Type to search…

↑↓ navigate↵ selectEsc close