Short answer. XAdES (XML Advanced Electronic Signatures) is the standard for signing XML documents — the counterpart of CAdES for structured data. In DSTUcrypt, XAdES works with Ukrainian DSTU 4145 keys and the DSTU GOST 34.311-95 (default) and DSTU 7564:2014 Kupyna-256 hashes, with levels ranging from basic BES to long-term B-LTA. Signing XML is a single call — sign(xmlBytes, { format: 'XAdES-B-T' }) — and all cryptography runs in the user's browser.
Where signing XML specifically is needed
PDFs get signed when a document is read by a human. But a huge share of document workflow is structured data read not by people but by systems: reporting, service-to-service exchange, electronic documents with machine-readable fields. Such data naturally lives in XML, and it is most convenient to sign it "inside the XML" too — so that the signature and the structure remain a single whole. That is exactly what XAdES exists for.
Typical scenarios: reporting systems, B2B exchange of structured documents between accounting systems, electronic documents with fields processed automatically by the receiving side.
What XAdES is
XAdES is an XML signature from the European ETSI standards family — an extension of the basic XML Signature with additional attributes (signing time, certificate data, and so on). In essence it is the same approach as CAdES, but embedded into the XML structure rather than into a CMS container. Like CAdES/PAdES, XAdES has maturity levels — from a simple signature to a long-term one.
XAdES levels
| Level | What it adds | Needs internet |
|---|---|---|
| XAdES-BES | basic signature with the key | no |
| XAdES-B-T | a TSP timestamp — proves the moment of signing | yes (TSP server) |
| XAdES-B-LT | certificate-status data for long-term verification | yes |
| XAdES-B-LTA | an archival timestamp — the most durable level | yes |
Levels above BES require online access to a timestamp server. In DSTUcrypt this request goes through a built-in proxy, so the integrator configures nothing extra.
The key feature: DSTU 4145 + Kupyna in XML
Most web tools for XML signing only know international algorithms and cannot work with Ukrainian keys. DSTUcrypt is the exception: here XAdES is signed with DSTU 4145 keys (the same ones as your QES) using the DSTU GOST 34.311-95 hash by default or Kupyna-256 (DSTU 7564:2014) as an option. What Kupyna is and when to choose it — in the article "Kupyna (DSTU 7564:2014): what this hash function is and why it is replacing GOST 34.311-95".
A rare capability among web solutions. XAdES with Ukrainian DSTU 4145 keys and the GOST 34.311 and Kupyna-256 hashes, with the full range of levels up to B-LTA — all right in the browser. The crypto core is a battle-tested native C/C++ library compiled to WebAssembly that has served Ukrainian PKI for years. The key and password never leave the user's device, and the same widget also signs CAdES, PAdES, and ASiC.
Code: signing XML in DSTUcrypt
The integration is no different from signing any other format — only the format value changes. No cryptographic code ends up on your page: the user picks their key and enters the password in an isolated iframe on our origin.
signing XML under the XAdES standard
import { embed } from 'https://dstucrypt.io/embed/dstucrypt-embed.mjs';
const signer = await embed('sign', { mount: 'modal' });
// xmlBytes — File | Blob | ArrayBuffer | Uint8Array | string with your XML
const { signature } = await signer.sign(xmlBytes, {
format: 'XAdES-B-T', // XML signature + timestamp (needs an online TSP)
fileName: 'report.xml',
// digest: 'kupyna-256', // optional: the Kupyna hash instead of GOST 34.311
});
signature.download('report-signed.xml'); // or .bytes / .base64 to your backend
The accepted values for XML are XAdES-BES, XAdES-B-T, XAdES-B-LT, XAdES-B-LTA. For long-term storage choose -B-LT or -B-LTA — more in the article "Long-term electronic signatures: CAdES-XL and PAdES-LTA".
How to verify an XML signature
The verify widget detects the format automatically from the file's content (for XML that is XAdES) and returns the status, the signer, and the accreditation flag (whether it is genuinely a QES). For one-off checks there is the free tool dstucrypt.com.ua/verify. A full overview of the formats is in the article "Electronic signature formats: CAdES, PAdES, XAdES, ASiC — which to choose".
Frequently asked questions
How does XAdES differ from CAdES?
CAdES signs arbitrary data as a CMS container (.p7s), while XAdES is a signature specifically for XML documents under its own standards family. Both share the same maturity levels (basic, timestamped, long-term), but XAdES embeds naturally into the XML structure, which is convenient for reporting and machine-to-machine exchange.
Does XAdES work with Ukrainian DSTU 4145 keys?
Yes. XAdES in DSTUcrypt supports Ukrainian DSTU 4145 keys with the DSTU GOST 34.311-95 (default) and DSTU 7564:2014 Kupyna-256 hashes. This is a rare capability among web solutions — most XML signers only know international algorithms.
Why does XAdES need internet access?
The basic XAdES-BES level works offline. The levels above it (B-T, B-LT, B-LTA) add a timestamp from a TSP server, so they need online access to it. In DSTUcrypt the TSP request goes through a built-in proxy — the integrator configures nothing.
Which XAdES level should I choose for long-term storage?
For documents that must remain verifiable for years, choose XAdES-B-LT or XAdES-B-LTA — they embed certificate-status data and an archival timestamp into the signature, so it stays verifiable even after the certificate expires.
Read also
- Electronic signature formats: CAdES, PAdES, XAdES, ASiC — which to choose
- Kupyna (DSTU 7564:2014): what this hash function is and why it is replacing GOST 34.311-95
- Long-term electronic signatures: CAdES-XL and PAdES-LTA
XML signing under DSTU — on your website
A ready-made XAdES signing widget with Ukrainian DSTU 4145 keys and the GOST 34.311 and Kupyna-256 hashes. The key never leaves the browser. Every new domain gets 7 days free.
Live demoHow to connect