---
title: "9. Verification"
description: "Section 9 of draft-laget-pdf-pqs-00."
---

> Documentation Index
> Fetch the complete documentation index at: https://pdf-pqs.org/llms.txt
> Use this file to discover all available pages before exploring further.

# 9. Verification

A verifier executes the procedure below, reporting the corresponding result codes defined
in [Appendix B](https://pdf-pqs.org/specification/codes). Processing for an individual PDF-PQS signature MUST terminate at the first
failing step; the verifier reports that single failure code for the signature and
suppresses all warnings for it.

The verification time is the wall-clock time at which verification is performed. Verifiers
MAY accept an explicit verification time as input (for example, when executing test
vectors or auditing historical validations).


## 9.1. For Each PDF-PQS Signature {#for-each-pdf-pqs-signature}

1. Locate signatures: extract every `id-aa-pdfpqsSignature` unsigned attribute from host
   signatures and every Place B embedded file attachment. If the input cannot be parsed
   as a valid PDF file, report `E_PARSE` as a file-level failure and halt.
2. Parse the payload: decode the `ContentInfo` structure. If it is not a DER-encoded
   `ContentInfo` containing `SignedData`, report `E_PARSE`. If `signatureAlgorithm` or
   the signer's public key is neither ML-DSA-65 nor ML-DSA-87, report
   `E_ALG_NOT_ALLOWED`. If any other profile constraint in [Section 4](https://pdf-pqs.org/specification/payload) is violated,
   report `E_PROFILE`.
3. Validate L: extract L from `pdf-byte-length`. If L exceeds the total byte length of
   the file, report `E_LENGTH_OUT_OF_RANGE`. If L does not identify a revision end,
   report `E_NOT_REVISION_END`.
4. Verify the content digest: compute SHA-512 over bytes `[0, L)` and compare the result
   with the `message-digest` signed attribute. If the digests do not match, report
   `E_DIGEST_MISMATCH`.
5. Verify the signature value: validate the ML-DSA signature over the DER encoding of
   `signedAttrs` [[RFC9882]](https://pdf-pqs.org/specification/references#rfc9882). If cryptographic verification fails, report
   `E_SIGNATURE_INVALID`.
6. Verify certificate binding: validate the `signing-certificate-v2` attribute against
   the signer's certificate. If it does not match, report `E_SIGNING_CERT_MISMATCH`.
7. Validate the certification path: construct and validate an X.509 certification path
   per [[RFC5280]](https://pdf-pqs.org/specification/references#rfc5280), including certificate policy processing. Missing intermediate
   certificates may be retrieved via the `authorityInfoAccess` extension, the PDF DSS, or
   the domain policy document. The validation time is the timestamp time from step 8 if a
   valid ML-DSA timestamp is present, or the verification time otherwise. If any
   certificate in the path is outside its validity interval at the validation time,
   report `E_CERT_EXPIRED`. If the path terminates at an issuer from the signer's domain
   policy document ([Section 7](https://pdf-pqs.org/specification/discovery)) rather than at a configured trust anchor, report
   `W_DOMAIN_ONLY`. If no valid certification path can be constructed, report
   `E_PATH_INVALID`. When the signer's domain policy document is Unavailable and no
   cached copy exists ([Section 7.2](https://pdf-pqs.org/specification/discovery#availability)), its issuers are not available as trust anchors;
   step 7 therefore reports `E_PATH_INVALID` unless a valid path ends at a configured
   trust anchor.
8. Verify the signature timestamp: if an `id-aa-signatureTimeStampToken` attribute is
   present, validate the token and its certification path. To be accepted, the token MUST
   be signed with ML-DSA-65 or ML-DSA-87 and MUST cover the `SignerInfo` signature value.
   A timestamp token signed with any other algorithm is ignored and treated as absent. If
   no qualifying ML-DSA timestamp token is present, report `W_NO_TIMESTAMP`. If an ML-DSA
   timestamp token is present but fails cryptographic or path validation, report
   `E_TIMESTAMP_INVALID`.
9. Check revocation: evaluate the revocation status of the certification path per
   [Section 8](https://pdf-pqs.org/specification/revocation). If any certificate in the path is revoked, report `E_REVOKED`. If the
   revocation status cannot be determined because no valid CRL is in force, report
   `E_REVOCATION_UNKNOWN`.
10. Verify placement boundary: for Place A, verify that L equals the byte offset at which
    the revision introducing the host signature begins; if not, report `E_HOST_BOUNDARY`.
    For Place B, step 12 inspects the revision starting at L.

Because step 7 requires the timestamp time determined in step 8, an implementation may
evaluate step 8 prior to step 7 while still reporting result codes in step order.


## 9.2. For the Whole File {#for-the-whole-file}

11. Enforce domain post-quantum policies: for each classical signature in the file and
    each signing domain D of its certificate:
    * If a valid PDF-PQS signature belonging to D covers the classical signature (as
      defined below), proceed to the next domain; no policy fetch is required.
    * Retrieve the policy document for D ([Section 7.2](https://pdf-pqs.org/specification/discovery#availability)). If the state is Not
      published, proceed to the next domain. If the state is Unavailable and no cached
      copy is available, report `E_POLICY_UNAVAILABLE` at the file level and proceed to
      the next domain.
    * If `pqcRequiredFrom` is present and the classical signature is not demonstrably
      older than `pqcRequiredFrom` (as defined below), report `E_PQC_REQUIRED_MISSING` at
      the file level.
12. Detect post-signature modifications: for each valid PDF-PQS signature, inspect the
    file after byte offset L in the manner [[ISO32000-2]](https://pdf-pqs.org/specification/references#iso32000-2) readers apply to classical
    signatures. Let R denote the revision starting at offset L. Report `W_CHANGES_AFTER_L`
    if any of the following conditions hold:
    * Another revision follows R in the file.
    * For Place B, R does not introduce the signature's embedded file attachment (meaning
      the attachment appears in a later revision and R is an uncovered modification).
    * R adds or modifies any PDF object outside the allowlist specified in [Section 5](https://pdf-pqs.org/specification/covered)
      for its placement.

For the purposes of step 11, a "PDF-PQS signature of D" is a valid PDF-PQS signature
whose signer certificate lists D as a signing domain and whose validated certification
path (step 7) terminates either at a configured trust anchor or at an issuer listed in
D's policy document. A PDF-PQS signature belonging to a different domain does not satisfy
D's policy.

In step 11, a PDF-PQS signature covers a classical signature if either of the following
holds:

* L is greater than or equal to the starting byte offset of the revision that introduces
  the classical signature (a Place A signature carried inside that classical signature
  satisfies this condition).
* The PDF-PQS signature uses Place B, the revision R beginning at L introduces the
  attachment with no disallowed objects under step 12, and the classical signature is
  introduced in the revision immediately following R.

In step 11, the creation time of a classical signature is established solely by an ML-DSA
timestamp token. A classical signature is considered older than `pqcRequiredFrom` only
when it carries a timestamp token that passes step 8 with a timestamp strictly earlier
than `pqcRequiredFrom`. Classically signed timestamps are disregarded because a quantum
adversary could backdate them. If no valid ML-DSA timestamp is present, the verifier
treats the classical signature as created at or after `pqcRequiredFrom`; because an
adversary can strip an unsigned timestamp attribute, an absent timestamp MUST NOT bypass
the policy check ([Section 10.2](https://pdf-pqs.org/specification/security-considerations#old-documents)).


## 9.3. Results {#results}

A verifier outputs a single overall result for the file, the per-signature result codes,
and any file-level result codes. The four normative result values and their symbolic
identifiers for test vectors and machine-readable reports are:

- **Valid, trusted (`valid`)**: Steps 1 through 11 succeed for every PDF-PQS signature, no file-level failures occur,
  and every certification path terminates at a locally configured trust anchor.

- **Valid, domain only (`valid-domain-only`)**: Steps 1 through 11 succeed for every PDF-PQS signature, no file-level failures occur,
  and at least one certification path terminates at an issuer obtained from a domain
  policy document rather than at a locally configured trust anchor (`W_DOMAIN_ONLY`).
  Verifiers MUST NOT display identity assurance derived from certificate policies for
  this result.

- **Invalid (`invalid`)**: One or more steps fail for any PDF-PQS signature or at the file level.

- **No signature (`no-signature`)**: The file contains no PDF-PQS signatures and step 11 succeeds without failure.

Warnings do not alter the overall result, but verifiers MUST surface them to callers or
users.

Source: https://pdf-pqs.org/specification/verification/index.mdx
