---
title: "4. The PDF-PQS Signature"
description: "Section 4 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.

# 4. The PDF-PQS Signature

A PDF-PQS signature is a DER-encoded `ContentInfo` [[RFC5652]](https://pdf-pqs.org/specification/references#rfc5652) whose `contentType` is
`id-signedData`. The encapsulated `SignedData` structure MUST satisfy all of the
following constraints:

* `encapContentInfo.eContentType` MUST be `id-data`, and `eContent` MUST be absent
  (detached signature).
* `signerInfos` MUST contain exactly one `SignerInfo`.
* `digestAlgorithm` MUST specify SHA-512 [[FIPS180-4]](https://pdf-pqs.org/specification/references#fips180-4).
* `signatureAlgorithm` MUST be `id-ml-dsa-65` or `id-ml-dsa-87` [[RFC9882]](https://pdf-pqs.org/specification/references#rfc9882). The
  signature MUST be generated using pure ML-DSA [[FIPS204]](https://pdf-pqs.org/specification/references#fips204) with an empty context string.
* The signer's certificate public key algorithm MUST match `signatureAlgorithm`.
* `certificates` MUST include the signer's end-entity certificate and MAY include
  additional certificates from the certification path.
* `crls` SHOULD be omitted; revocation data is conveyed externally or in the PDF Document
  Security Store (see [Section 8](https://pdf-pqs.org/specification/revocation)).

ML-DSA-44 MUST NOT be used. Pre-hash ML-DSA (HashML-DSA) MUST NOT be used. Signers SHOULD
use ML-DSA-65 for end-entity signing keys.


## 4.1. Signed Attributes {#signed-attributes}

The `signedAttrs` field of `SignerInfo` MUST contain each of the following attributes
exactly once, and each attribute MUST carry a single attribute value:

- **content-type**: `id-data`.

- **message-digest**: The SHA-512 digest computed over the covered bytes `[0, L)`.

- **signing-certificate-v2**: An `ESSCertIDv2` structure identifying the signer's certificate [[RFC5035]](https://pdf-pqs.org/specification/references#rfc5035), computed
  with SHA-512. Because SHA-512 is not the default hash algorithm for `ESSCertIDv2`, the
  `hashAlgorithm` field MUST be explicitly encoded.

- **pdf-byte-length**: The integer value L ([Section 5](https://pdf-pqs.org/specification/covered)), encoded as follows:

```asn1
id-aa-pdfByteLength OBJECT IDENTIFIER ::= { id-pdfpqs 3 }

PdfByteLength ::= INTEGER (1..MAX)
```

The `SignerInfo` MAY include the `signing-time` signed attribute. However, a verifier
MUST NOT rely on `signing-time` as trustworthy evidence of when the signature was
created.

In accordance with [[RFC5652]](https://pdf-pqs.org/specification/references#rfc5652), `signedAttrs` is DER-encoded as a `SET OF Attribute`.
Signers MUST sort the encoded `Attribute` elements in ascending lexicographical order of
their DER encodings prior to signing. Because verifying implementations such as OpenSSL
re-encode `signedAttrs` in canonical DER order before signature verification, an unsorted
set fails verification.


## 4.2. Unsigned Attributes {#unsigned-attributes}

The `SignerInfo` SHOULD include an `id-aa-signatureTimeStampToken` unsigned attribute
[[RFC3161]](https://pdf-pqs.org/specification/references#rfc3161) covering the `signature` field of `SignerInfo`. To provide post-quantum
temporal assurance, the timestamp token MUST be signed with ML-DSA. A timestamp token
signed with a classical algorithm offers no protection against a quantum adversary, and
verifiers MUST ignore it.


## 4.3. Size {#size}

An ML-DSA-65 PDF-PQS signature containing only the signer's certificate occupies
approximately 11 KB. Including an ML-DSA signature timestamp token along with its TSA
certificate adds approximately 10 KB.

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