Dokmatiq DOKMATIQ

CAdES

ETSI standard for electronic signatures on binary files — built on top of CMS/PKCS#7, it signs arbitrary payloads like ZIPs, XML containers or binary formats.

Also known as: CMS Advanced Electronic Signatures, ETSI EN 319 122, CAdES-BES, CAdES-LTA

Short definition

CAdES (CMS Advanced Electronic Signatures) is the ETSI standard for electronic signatures over arbitrary binary data, published as EN 319 122. CAdES builds on the older Cryptographic Message Syntax (CMS) from RFC 5652 — formerly known as PKCS#7 — and extends it with the requirements of the eIDAS regulation.

Unlike PAdES (signature inside the PDF) and XAdES (signature inside the XML), CAdES signs any file as a black box. The signature either sits separately as a .p7s file next to the original, or is embedded in a CMS container that contains the original.

Attached vs. detached

CAdES has two base variants:

  • Attached (enveloping) — the signed container holds both the original data and the signature
  • Detached — the signature lives as a separate file alongside the unchanged original

Detached is especially common for ZIP archives, XRechnung containers under the Peppol Business Interoperability Specifications approach, and in e-government settings where documents must be archived without modification.

Profiles as in PAdES

CAdES defines the same validation profiles as PAdES — with the same names and the same function:

ProfileContainsUse
CAdES-B-B (Basic)signature + certificateshort-lived signatures
CAdES-B-T+ timestampprovable signing time
CAdES-B-LT+ OCSP/CRLlong-term validation
CAdES-B-LTA+ archive timestampaudit-safe archiving

The baseline profiles from EN 319 122-1 therefore correspond structurally to PAdES-B-B through -LTA.

Where CAdES is typically used

  • ZIP/TAR archives with confidential or evidential content
  • EDI files in supply-chain communication
  • Peppol messages at the transport layer (alongside the UBL layer)
  • Code signing of software packages in certain regulated environments
  • Container formats like ASiC (Associated Signature Container) — a ZIP containing mimetype, data and .p7s signatures

ASiC — CAdES in container form

An important special case: ASiC (ETSI EN 319 162) bundles documents and signatures in a ZIP — internally with a CAdES detached signature format. Two variants:

  • ASiC-S — one file, one signature
  • ASiC-E — multiple files, multiple signatures (Extended)

ASiC is widely used in European e-government; some Peppol scenarios use it to deliver invoice attachments in an audit-safe way.

CAdES, PAdES, XAdES compared

ContainerSignature locationLegibility
CAdESarbitrary binary data.p7s or CMS envelopeoriginal unchanged
PAdESPDFin the PDF (increment)original readable with signature
XAdESXMLin the XML (XMLDSig)original readable with signature

All three share profile names (B-B, B-T, B-LT, B-LTA), trust anchors (EU Trusted List) and the integration into eIDAS — the choice follows the payload format.

Creating CAdES signatures with the Dokmatiq API

# Detached signature over any file
curl -X POST https://api.dokmatiq.com/v1/sign/cades \
  -H "Authorization: Bearer $DOKMATIQ_KEY" \
  -F "document=@archive.zip" \
  -F "certificate=@signing.p12" \
  -F "passphrase=..." \
  -F "profile=CAdES-B-LT" \
  -F "mode=detached" \
  -o signature.p7s

For ASiC containers the API handles the ZIP packaging automatically (mode=asice).

Verifying a signature

curl -X POST https://api.dokmatiq.com/v1/sign/cades/verify \
  -H "Authorization: Bearer $DOKMATIQ_KEY" \
  -F "document=@archive.zip" \
  -F "signature=@signature.p7s"

The response contains profile, certificate chain, trust anchor and — if timestamps are present — their status.

Common pitfalls

  1. Detached signature without original — a .p7s on its own is worthless; the original must accompany it
  2. Wrong hash algorithm — SHA-1 has been disallowed in CAdES for years; SHA-256 is the standard
  3. Profile mixing — a CAdES-B-B signature cannot be upgraded to LTA retroactively; it must be re-issued
  4. PKCS#7 confused with CAdES — every CAdES is PKCS#7, but not every PKCS#7 is CAdES (the ETSI attributes for long-term validity may be missing)

Ready to use it via API?

Get started for free. No credit card. 100 documents per month included.