Copyright © 1999 The Internet Society & W3C (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
This document includes updates from the 990902 draft. The goal is to get some version of this document out as an ietf-draft and W3C technical report as soon as possible.
; Reagle's updates include :
This document lists the core signature syntax.
...
This document describes the proposed syntax and processing rules for the XML Digital Signature specification. This specification provides a mechanism for applying digital signatures to XML documents and other Internet resources.
The structure allows for both embedded and detached signatures. An embedded signature can include the signature within the signed object or embed the signed object within the signature. A detached signature allows the signature to be independent of the object. The processing structure allows for switching between embedded and detached signatures without invalidating the signature.
In addition to the basic signature document type, this document also defines other useful types including a methods of referencing multiple resources and key management and algorithm definitions.
Editorial Comment: Presently most of this work is unspecified. The working group needs to define things like manifest and algorithm definitions more explicitly.
The namespace URI that must be used by experimental implementations of this dated specification is:
xmlns="http://www.w3.org/Signature/core-19990922"
This document uses the following abbreviations for long words. (The acryonyms are generated by wrapping the word_length-2 in the first and last letter):
This document also includes editorial comments (highlighted in a light tan wit a blue border) that point out open issues the WG has not yet closed. Readers unfamiliar with DTD syntax may wish to refer to Ron Bourret's "Declaring Elements and Attributes in an XML DTD."
The design philosophy and requirements of this specification are addressed in the XML-Signature Requirements document [XML-Signature-RD]. However, a few of the key philosphy axioms are repeated. This specification endeavors to rely upon the syntax -- and the underlying data model -- to represent the functionality and structure of a signature where ever possible. One way this is manifested is by the use URIs to define the relationships between a signature and its context (its constituent parts, the objects it signs, the algorithms it employs, etc.). This philosophy is best captured by the idea that of "if you make statements about statements, signature is merely one type of statement " This allows us to clearly (and perhaps formally) define the meaning of a signature and how that meaning interacts with the semantics of the content it signs. One way this is manifested is in the choice of the WG to avoid things like:
<attribute type="CDATA" and value="CDATA"/>
Instead, if applications need to associate external semantics for key exchange or trust processing they must introduce a set of qualified namespace [XML-namespace] application elements with clearly defined semantics, or they must make a statement about an existing resource within some data model.
Editorial Comment: The syntax defined in this document is not yet associated with a directed labeled graph data model. The WG has decided not to use the RDF serialization syntax. WG members have advocated usings a "striped" XML syntax whereby the structure and nesting of the XML can be read as {resource, predicate, value} tuples. Unfortunatley, this can result in superflous syntax. The WG is investigating the use of a schema definition to bind a formally specified data model to an XML syntax that is intuitive and compact.
The general structure of an XML signature includes the following elements:
SignedInfo
is the actual data over which the signature is calculated. It
contains control information (algorithm identifiers, pre-processing transformations) and
digest(s) over the object(s) being signed.SignatureValue
is an empty-element tag [XML] that contains the actual value of the digital signature. KeyInfo
is an optional element which enables the recipient(s) to obtain the
key(s) needed to validate the signature. Object
is an optional element wherein applications may place (embed)
content through use of the XML-namespace facility. [XML-namespace]<!ELEMENT Signature (SignedInfo, SignatureValue, KeyInfo?,
Object*)>
<!ATTLIST SignedInfo
Id ID
#IMPLIED>
SignatureValue
SignatureValue
is an empty-element tag [XML] that contains the actual value of the digital signature. The ability
to define a SignatureAlg
and SignatureValue
pair which includes
multiple distinct signatures is explicitly permitted (e.g. "rsawithsha-1 and
ecdsawithsha-1").
<!ELEMENT SignatureValue EMPTY)>
<!-- base64 encoded signature value -->
<!ATTLIST SignatureValue
Value
CDATA #REQUIRED >
; Why is the content captured in an attribute instead of the content of the element? Should make this a URN. Should we define our own URN scheme? - JR
SignedInfo
The structure of SignedInfo
includes a canonicalizatin (c14n) algorithm, a
signature algorithm, and one or more references to objects. The SignedInfo
element may contain an optional ID attribute that will allow it to be referenced by other
signatures and objects.
<!ELEMENT SignedInfo(c14nAlg?, SignatureAlg, ObjectReference+
)>
<!ATTLIST SignedInfo
Id ID
#IMPLIED>
SignedInfo
does not include explicit signature attributes (in the
traditional cryptographic sense). If an application needs to associate semantics (such as
signing time, signing device, etc.) with the signature, it may add an additional Object
that includes those semantics and reference that Object
via an ObjectReference
.
c14nAlg
(Canonicalization)c14nAlg
is an optional element which specifies the canonicalization (c14n)
algorithm applied to the SignedInfo
element prior to performing signature
calculations. This element uses the general structure here for algorithms in which an URI
is included as an attribute naming the algorithm and optional contents of the element
contain any parameter, value, or other information defined by the algorithm name. Possible
options may include a null algorithm (no changes), a simple identity algorithm (CRLF and
charset normalization), or more extensive operations such as [XML-C14N].
<!ELEMENT c14nAlg ANY>
<!ATTLIST c14nAlg
Algorithm CDATA
"null">
<!-- Where CDATA conforms to the
productions specified by [URI]
-->
SignatureAlg
SignatureAlg
is a required element which specifies the algorithm used for
signature generation and validation. This algorithm ID identifies all cryptographic
functions involved in the signature operation (e.g. hashing, public key algorithms, MACs,
etc.). This element uses the general structure here for algorithms in which a URI is
included as an attribute naming the algorithm and optional contents of the element contain
any parameter, value, or other information defined by the algorithm name. While there is a
single identifier, that identifier may specify a format containing multiple distinct
signature values.
<!ELEMENT SignatureAlg ANY>
<!ATTLIST SignatureAlg
Algorithm CDATA
#REQUIRED >
<!-- Where CDATA conforms to the
productions specified by [URI]
-->
ObjectReference
ObjectReference
is an element that may occur one or more times. It
includes a URI, the type of the object, specified transformations, a digest algorith and
digest value. Note, it is the content yielded after the URI is dereferenced, decoded, and
transformed that the digest algorithm is applied to.
<!ELEMENT ObjectReference (Location?, Type?, Transformations?, DigestAlg, DigestValue) >
; Why is location optional? -JR
Location
Location
identifies where to find the Object
. This element
may be omitted if the location is implicit in the application.
<!ELEMENT Location EMPTY >
<!ATTLIST Location
HREF
CDATA #IMPLIED >
<!-- Where CDATA conforms to the
productions specified by [URI]
-->
; I would prefer this wasn't implicit. -JR
Type
Type
is an optional element which contains information about the type of
object being signed (e.g. manifest, package, document, SignedInfo
, PDF file).
This may be represented as a name (e.g. MIME type), namespace qualified element name, or
URI.
<!ELEMENT Type EMPTY >
<!ATTLIST Type
Type
CDATA #REQUIRED >
; Not sure about the purpose behind this, and needs to be further specified. -JR
Transformations
Transformations
is an optional element that contains one or more
operations to be performed on the Object
prior to signature calculation.
Examples of Transformations
include encoding, c14n, XPointer, XSL, filtering,
encoding, etc. (These operations are different from those specified in the signature
;
those are are applied over signedinfo
.)
Each element within Transformations
uses the general structure here for
algorithms in which a URI is included as a value specifying the algorithm and optional
contents of the element contain any parameter, value, or other information defined by the
algorithm name. If the Transformations
element is omitted, the only operation
performed is the default object c14n algorithm (null or identity).
<!ELEMENT Transformations (ANY, c14nAlg?, Encoding?) >
<!ELEMENT c14nAlg EMPTY >
<!ATTLIST c14nAlg
Algorithm CDATA
#REQUIRED >
<!ELEMENT Encoding EMPTY >
<!ATTLIST Encoding
Algorithm CDATA
#REQUIRED >
<!-- Where CDATA conforms to the
productions specified by [URI] -->
; I think this is one of the very few places where we should definine an algorithm attribute and let others fill it in. Should allow transformations beyond c14nAl, Encoding and Exclusion. - JR
Implementation Comment: When transformations are applied the signer is not signing the native (original) document but the resulting (transformed) document that is not captured explicitly in the signature syntax. Where transformation processes are well known and widely implemented an application might include native content and specify transformations by reference. Otherwise, an application may perform transformations on the content itself and use the resulting content within the signature.
Security Comment: Applications are recommended to ensure signers understand the actual resulting content that is being signed after transformations are applied. Users should not be tricked into signing a native content that is transformed into something that the user would not have signed otherwise.
DigestAlg
DigestAlg
is a required element which identifies the digest algorithm to
be applied to the signed object. This element uses the general structure here for
algorithms in which a URI is included as an attribute naming the algorithm and optional
contents of the element contain any parameter, value, or other information defined by the
algorithm name.
<!ELEMENT DigestAlg ANY>
<!ATTLIST DigestAlg
Algorithm
CDATA #REQUIRED >
<!-- Where CDATA conforms to the
productions specified by [URI]
-->
digestvalue
digestvalue
is a required empty-element tag which
contains the base64 encoded value of the digest.
<!ELEMENT DigestValue EMPTY>
<!-- base64 encoded digest value -->
<!ATTLIST DigestValue
value
CDATA #REQUIRED >
Object
. When present this element may contain any item and specifies the encoding. It is important to note that the content of the Object itself is not part of the hash algorithm over the signature.
<!ELEMENT Object ANY>
<!ATTLIST Object
Id CDATA
#IMPLIED
Type CDATA
#IMPLIED
Encoding
CDATA #IMPLIED >
<!-- Where type and encoding CDATA conforms to the
productions specified by [URI]
-->
; Define what is meant by type. -JR
Object
is an optional element which may occur one or more times. The
purpose of Object
element is to wrap elements defined by any XML application
as introduced through the namespace [XML-namespace] facility.
For instance, the following Object
references a timestamp document that is
defined by some other specification.
<Object id="timestamp1"
type="signatureattributes" > ;who defined this type?
<timestamp xmlsn="http://www.ietf.org/rfc/1234">
<date>19990908</date>
<time>14:34:34:34</time>
</timestamp>
</Object>
The Object
's ID is referenced from the ObjectReference
in SignedInfo
.
This element is used for embedded signatures where the object being signed is to be
included in the signature document. The Object
element may include optional
type, ID, and encoding attributes. Note there is nothing that prevents these other XML
applications from referencing and making statements about signatures.
<!ELEMENT Object ANY>
<!ATTLIST Object
id CDATA
#IMPLIED
type CDATA
#IMPLIED
encoding
CDATA #IMPLIED >
KeyInfo
KeyInfo
may contain keys, names, certificates and other public key
management information (such as inband key distribution or agreement data or use any other
method.) This specification defines a few simple types but applications may place
(embed) their own key identification and exchange semantics within this element through
the XML-namespace facility. [XML-namespace]
<!ELEMENT KeyInfo (ANY | (KeyName | KeyValue |
SubjectName | RetrievalMethod |
x509Data |
PGPData | MgmtData)* )>
KeyInfo
is an optional element which enables the recipient(s) to obtain
the key(s) needed to validate the signature. If omitted, the recipient is expected to be
able to identify the key based on application context information. This element contains
one or more KeyInfo
data elements providing information for the recipient(s).
Applications may define and use any mechanism they choose through inclusion of elements
from a different namespace.
KeyName
contains an identifier for the key which may be useful to the
recipient. This may be a name, index, etc. KeyValue
contains the actual key(s) used to validate the signature. If the
key is sent in protected form, the MgmtData
element should be used. Specific
types must be defined for each algorithm type (see algorithms).SubjectName
contains one or more names for the sender. Forms to be
supported include a simple name string, encoded DN, email address, etc.RetrievalMethod
is a URI which may be used to obtain key and/or certificate
information. The URI should contain the complete string for retrieving the key needed for
this message (rather than a generic URI).X509Data
contains an identifier of the key/cert used for validation (either
an issuerserial value, a subject name, or a subjectkeyID) and an optional collection of
certificates and revocation/status information which may be used by the recipient.
issuerserial contains the encoded issuer name (RFCxxxx) along with the serial number.PGPData
data associated with a PGP key.MgmtData
contains in-band key distribution or agreement data. Examples may
include DH key exchange, RSA key encryption etc.<!ELEMENT KeyName (#PCDATA)>
<!ELEMENT KeyValue (#PCDATA)>
<!ELEMENT SubjectName (#PCDATA)>
<!ELEMENT RetrievalMethod (#PCDATA)>
<!ELEMENT X509Data (#PCDATA)>
<!ELEMENT MgmtData (#PCDATA)>
; This section requires more work. - JR
This sections identifies algorithms used with the XML digital signature standard. Entries contain the identifier to be used in signature documents, a reference to the formal specification, and definitions, where applicable, for the representation of keys and the results of cryptographic operations.
The specification defines the following URNs that are associated with algorithms we employ. Requirements are specified over implementation, not requirements for signature use.
Algorithm Type | Algorithm | Requirements | Algorithm URI |
Digest | |||
SHA1 | mandatory | urn:dsig:SHA1 | |
MD5 | recommended | ftp://ftp.isi.edu/in-notes/rfc1321.txt | |
AESH | (forthcoming) | urn:dsig:AESH | |
MAC | |||
HMAC-SHA1 | mandatory | urn:dsig:HMAC-SHA1 | |
HMAC-MD5 | optional | urn:dsig:HMAC-MD5 | |
Signature | |||
DSAwithSHA1 (DSS) | mandatory | urn:dsig:DSAwithSHA1 (DSS) | |
RSAwithSHA1 | recommended | urn:dsig:RSAwithSHA1 | |
RSAwithMD5 | optional | urn:dsig:RSAwithMD5 | |
ECDSA | (forthcoming) | urn:dsig:ECDSA | |
Canonicalization | |||
:null | mandatory | urn:dsig:null | |
:minimal | mandatory | urn:dsig:minimal | |
XML-c14n | recommended | http://www.w3.org/1999/07/WD-xml-c14n-19990729 | |
DOM-c14n | recommended | urn:dsig:DOM-c14n | |
Transformation | |||
XPointer | mandatory | http://www.w3.org/1999/07/WD-xptr-19990709 |
These sections describe the operations to be performed as part of signature generation and validation. The description is of a logical behavior and does not specify an order of execution, nor specify discrete steps.
Transformations
determined by application to object being signed. Object
reference element(s) including location of object, digest,
and transformation and digest algorithm elements, if required. SignedInfo
element with signaturealg
, c14nAlg
(for SignedInfo
), and Object
reference(s). SignedInfo
based on algorithms in
step d. f) construct signature document with SignedInfo
, Object
(s) (if desired, encoding may be different than that used for signing), KeyInfo
(if required), and SignatureValue
.Transformations
(e.g. c14n) to the signed object(s) based
on all Object
reference(s) in the SignedInfo
element. Object
reference(s). If the object is contained within the Object
element, only the
object itself is hashed (i.e. the <Object
> and </Object
> tags are excluded). SignedInfo
(if mismatch, validation
fails). SignedInfo
element based on the c14n algorithm ID in SignedInfo
(or
based on the default if absent). KeyInfo
or externally. SignatureValue
based on the SignatureAlg
in the SignedInfo
element,
the key obtained in step c, and the results of step d. - Digest calculation is performed
over the SignedInfo
element including start and end tags.Note that while a signature may validate (a key was properly applied to content to
yield the stated SignatureValue)
this does not mean applications will
necessarily trust or accept the signature. For instance, perhaps the assertions within the
content that was signed could not be confirmed or validated themselves.
Editorial Comment: Declarations are now in the body of the text.
<Signature xmlns="http://www.w3.org/Signature/core-19990922"> <SignedInfo Id="5"> <c14nAlg Algorithm="null"/> <SignatureAlg algorithm="dsig:rsaWithSHA-1"/> ; not a namespace but an http urn scheme. <ObjectReference> ;one might use the manifest or package container here <Location HREF="..."/> <!-- pointer to external signedobject --> <Type Type="http://..." /> ;don't really understand <Transformations> <C14NAlg Algorithm="http://..."/> <Encoding Algorithm="http://..."/> </Transformations> <DigestAlg Algorithm="sha-1"/> <DigestValue Value="a23bcd43" /> </ObjectReference> <ObjectReference> <Location HREF="#timestamp"/> <!-- points to Object below --> <Type type="signatureattributes" /> ;who defines this type? awkward <Transformations> <c14nAlg Algorithm="http://..."/> </Transformations> <DigestAlg Algorithm="sha-1"/> <DigestValue Value="a53uud43" /> </ObjectReference> </SignedInfo> <SignatureValue value="dd2323dd"/> <Object id="timestamp1" type="signatureattributes" > ;who defined this type? <timestamp about="#5" xmlsn="http://www.ietf.org/rfc/1234"> <date>19990908</date> <time>14:34:34:34</time> </timestamp> </Object> <KeyInfo> <keyname>Solo</keyname> ;changed to be elements </keyinfo> </Signature>
SignedInfo
and for objects. Other defaults.
Mandatory to implement cryptographic algorithms and KeyInfo
types.SignedInfo
to
the signed object, and what rules need to be defined for the ID attributes in SignedInfo
and
Object
?...
this is moot - JR
signatureattributes
signatureattributes
is an optional element which contains one or
more attributedata elements. Each attributedata element contains a type attribute naming
the attribute type with a URI or qualifed element name and has a value defined by the
type. signatureattributes
contains information associated with the signature
itself. signatureattributes
also contains an optional reference to the SignedInfo
element
with which it is associated.
manifest
manifest
is an element type which is used to collect a number of
instances of Object
reference and optionally Object
. manifest
is
one instance of a type that may be used as a Object
to create a signature
over multiple items.