3.2 XML Signature (XMLdsig)
XML Signature [10] is the format designed to support digital signatures encoded via
XML. No other security service is supported. This format is an XML application, de-
fined by using the Document Type Definition (DTD) syntax and the XML Schema
language [11].
XMLdsig has been designed to support any document format: a document in a
generic format is considered as a single blob while special procedures are used when
signing XML documents. In fact several forms of an XML document with the same
semantics may exist. These forms have a different binary representation but the same
logical representation, such as the DOM [12] node tree generated by a parser. Different
binary representations lead to different digests and consequently to different signature
values. Therefore, before being signed, an XML document must be transformed into a
canonical representation by using a proper algorithm, such as C14n [13]. Moreover a
generic transformation - such as an XSLT [14] one - could have been applied over the
document before being signed. XMLdsig takes into account these issues: the canonical-
isation algorithms and pre-signature transformations are specified within the signature
structure and are signed together with the document.
XMLdsig is an indirect signature: it is implemented by calculating an overall digest
over the set of the digests computed on each document being signed. Complex schemes
with more than two levels of digest calculation are also supported. This core structure,
the intrinsic nature of XML and the extensive use of URIs to refer to the data covered
by the digital signature make XMLdsig capable to sign multiple documents, parts of
documents, or documents stored elsewhere and accessed through a reference (URI), as
well as to flexibly control how a signature has to be validated.
The main elements of XMLdsig are:
– <SignedInfo> references the documents being signed and their digests;
– <SignatureValue> is the signature computed by applying a digital signature al-
gorithm to the digest of the canonicalised <SignedInfo> element;
– <Object> is an optional element that can appear in multiple instances to include
any data type; it is generally used to:
• carry the document being signed in the case of enveloping signatures
• carry some signature properties or assertions as <SignatureProperties> to
be optionally signed together with the documents
• carry one or many <Manifest> objects
– <Manifest> is an optional element very similar to <SignedInfo> (it can include
references to the documents being signed and their digests) but has a different se-
mantics in the signature validation process, described later.
The basic structure of an XML signature is given in Fig. 5 including the digest cal-
culation while the various transformations and the structure carrying the signer’s key
data are omitted. The validation of an XML signature containing only the mandatory
<SignedInfo> must be performed as follows:
1. check that every reference within <SignedInfo> is valid
2. re-calculate the digests over every referenced document and verify that they match
with the ones stored within <SignedInfo>
89