PAdES signatures
Prepare PDF/BES signing inputs, assemble PAdES levels and retain the time and validation evidence needed for renewal.
PAdES embeds a signature and its validation evidence in a PDF. The support service keeps the original, prepares the exact signing input and assembles the final PDF. Signing Server performs the authorized private operation over that input; document preparation, augmentation and complete-level verification belong to the support service.
Select the binding and level
Section titled “Select the binding and level”Use the standard DSS root profile with implementation profile 1.7 and extension 1.6. Select all three task properties together:
| Property | Value |
|---|---|
SigType |
PDF |
AdESType |
BES |
ProcessingRules |
urn:se:idombud:signing:pades:baseline-b-sha256-rsa:v1 |
This is a separate binding from generic PDF signing, where AdESType is omitted or None and ProcessingRules is absent. The legacy DSS binding does not accept this PAdES selection.
The request has no separate B-B/B-T/B-LT/B-LTA field. The support service chooses the complete level its receiving process requires and performs the corresponding augmentation and verification. See Signature levels and dependencies for the meaning, use cases and external requirements of each level. A named timestamp profile belongs to the separate timestamp API; it selects an allowed administrator-configured TSA service, policy and trust.
Certificate and preparation
Section titled “Certificate and preparation”Obtain the actual configured signing-leaf certificate before preparing inputs and consent. Supplied and statically activated credentials use that exact leaf and selected credential version. A certificate fingerprint does not select a private key. Fresh per-transaction issuance after identification is excluded from this binding because its future certificate cannot replace the already approved certificate-bound bytes. Generic PDF dynamic signing retains its own scope.
- Keep the exact original PDF and validate its syntax as described below. Prepare a signature dictionary with
SubFilter=ETSI.CAdES.detached, the claimed UTC signing time in PDFM, and sufficient reservedContentsspace. - Make
ByteRangecover the complete prepared PDF except itsContentshex string. Compute SHA-256 over those exact covered bytes. - DER-encode a universal
SET(0x31) with exactly onecontentType=id-data, one 32-bytemessageDigestand oneSigningCertificateV2. Include oneESSCertIDv2containing SHA-256 of the complete actual leaf DER. Omit the DEFAULT SHA-256 algorithm identifier and include noissuerSerialor policies. - Send the attributes as Base64
ToBeSignedBytesin the signed DSS request.signingTime,cmsAlgorithmProtect, duplicate or unknown attributes and BER are rejected by this binding. Keep the original PDF outside the request. - Verify the signed response, signer, credential and ordered task IDs. Match PDF/BES, the exact processing rule, unchanged attributes and actual signing leaf. Verify the RSA-SHA256 signature, then assemble detached CMS inside the reserved PDF space without changing a covered byte.
- Verify the complete PDF against the retained original, configured certificate trust and requested PAdES level. HTTP 200, a valid response envelope or a valid raw RSA signature alone is insufficient.
The historical task fragment and public preparation metadata illustrate the selection and DER attributes. They are synthetic, consumed historical preparation data, not a complete signed request or a replayable operation. Generate fresh inputs and sign the complete envelope for a new operation.
Check PDF structure
Section titled “Check PDF structure”Validate PDF syntax before preparing a signature and before accepting an assembled or renewed PDF. Reject duplicate decoded dictionary keys even when their values match: /Type and /T#79pe are the same key. Apply this check to nested dictionaries, compressed object streams and the exact earlier signed revisions, including signature, timestamp and validation-material dictionaries. Dictionary-looking text in strings, comments and ordinary content streams remains document data.
Check structural numbers before conversion. Stream lengths, object-stream counts/offsets and each of the four ByteRange entries require exact bounded integers. Fractional values and integer overflow cannot become an accepted byte range. Valid indirect stream-length objects remain supported. Check classic cross-reference counts before allocating their maps, as well as compressed cross-reference output and object-stream headers.
Use the same bounded byte snapshot for structural checks and full-profile validation. This prevents a changed file path from supplying different PDF bytes between checks. Structural checks supplement verification of the exact original, signature and complete PAdES level.
Add trusted time: B-T
Section titled “Add trusted time: B-T”Obtain a validated RFC 3161 timestamp with RFC 5816 certificate binding over the raw document-signature value and embed it as the CMS signature timestamp. Match its imprint, configured TSA chain, policy, nonce and generation time. PDF M is a requester claim and does not provide trusted time.
An unavailable, altered, untrusted or mismatched timestamp cannot produce a successful B-T result. Keep the existing valid B-B file and reconcile the failed or unknown operation; it does not authorize another private document-signing attempt.
Retain validation material: B-LT
Section titled “Retain validation material: B-LT”Include the relevant signer, issuer and TSA chains and signed certificate-status evidence in the PDF Document Security Store (DSS). The provided consumer workflow uses bounded complete SHA256-RSA CRLs from fixed administrator-controlled HTTPS sources. It does not fetch OCSP responses or process delta or indirect CRLs. Validate issuer signatures, coverage, status and freshness before use, including when a previously validated material object is consumed later.
Embedded certificates never establish trust by themselves. Use independently configured CA roots and verify the completed LT file with network retrieval disabled. The recipient still needs the exact signed PDF, an accepted trust policy and a compatible verifier.
Maintain archival evidence: B-LTA
Section titled “Maintain archival evidence: B-LTA”Validate the existing LT/LTA history before requesting an archival timestamp. Preserve the original signed bytes and every earlier protected revision. Add current evidence for the renewing TSA and a document timestamp that protects the relevant revision and validation material, then verify the completed LTA file before reporting success.
Historical signer and TSA evidence is evaluated with its proof of existence and applicable validation policy. Keep retired certificates and their protected status evidence; they do not all have to remain current forever. Separately validate the current renewing TSA. TSA replacement requires an explicit trust decision, never automatic trust in certificates supplied by a document.
Assign a preservation owner to monitor evidence validity, algorithm suitability, provider changes and storage integrity. Renew before the last protection becomes insufficient. A later timestamp cannot repair missing evidence or a broken revision history. Renewal uses public evidence and the external TSA, so the original signer and private document key are not needed. The integration does not provide a hosted archive.
A timeout or process loss can mean the TSA already issued a token. Consumed request IDs remain consumed across restart. Do not report a partial or unvalidated token as a completed level, automatically retry with a new ID or repeat private document signing.
Consumer bounds
Section titled “Consumer bounds”| Item | Bound |
|---|---|
| Unsigned, unencrypted original PDF | 16 MiB |
| Complete or renewed PDF | 32 MiB |
| Prepared DER signed attributes | 8,192 bytes; shared request-envelope limits also apply |
| Reserved CMS or timestamp Contents | 65,536 bytes |
| Certificate chain | 2–4 certificates for validation material |
| Independently configured CA roots | 1–4 |
| Complete CRLs per validation-material input | 1–8; at most 262,144 bytes each |
| Archival document timestamps | At most 64 in this consumer workflow |
| Declared cross-reference entries across the complete load | 100,000, including free/superseded entries and repeated historical-prefix checks |
| Dictionary keys | 100,000 per dictionary |
| Syntax steps | 1,000,000 across the complete load |
| Object/dictionary/string nesting | 100 each |
| Decoded structural-stream output | 32 MiB per intermediate stage; 64 MiB across all stages, streams and historical prefixes |
| Structural-stream filters | At most 16; Flate, LZW, ASCIIHex, ASCII85 or RunLength, using standard full or abbreviated names |
| Predictor row | At most 1 MiB; colors 1–32 and bits per component 1/2/4/8/16 |
| Classic cross-reference line | At most 64 characters before its line ending |
A reservation or bound failure does not permit rewriting approved bytes or silently returning a lower level. The original PDF, prepared state, final file and preservation schedule remain support-service responsibilities.
Standards
Section titled “Standards”PAdES levels and representation are defined in ETSI EN 319 142-1 V1.2.1. The timestamp protocol is RFC 3161, updated by RFC 5816 to allow ESSCertIDv2 certificate binding with hash functions other than SHA-1. Signing Server uses SHA-256 for that binding.