| 1 |
<pre>Network Working Group D. Eastlake 3rd |
| 2 |
Request for Comments: 3275 Motorola |
| 3 |
Obsoletes: <a href="./rfc3075">3075</a> J. Reagle |
| 4 |
Category: Standards Track W3C |
| 5 |
D. Solo |
| 6 |
Citigroup |
| 7 |
March 2002 |
| 8 |
|
| 9 |
|
| 10 |
(Extensible Markup Language) XML-Signature Syntax and Processing |
| 11 |
|
| 12 |
Status of this Memo |
| 13 |
|
| 14 |
This document specifies an Internet standards track protocol for the |
| 15 |
Internet community, and requests discussion and suggestions for |
| 16 |
improvements. Please refer to the current edition of the "Internet |
| 17 |
Official Protocol Standards" (STD 1) for the standardization state |
| 18 |
and status of this protocol. Distribution of this memo is unlimited. |
| 19 |
|
| 20 |
Copyright Notice |
| 21 |
|
| 22 |
Copyright (c) 2002 The Internet Society & W3C (MIT, INRIA, Keio), All |
| 23 |
Rights Reserved. |
| 24 |
|
| 25 |
Abstract |
| 26 |
|
| 27 |
This document specifies XML (Extensible Markup Language) digital |
| 28 |
signature processing rules and syntax. XML Signatures provide |
| 29 |
integrity, message authentication, and/or signer authentication |
| 30 |
services for data of any type, whether located within the XML that |
| 31 |
includes the signature or elsewhere. |
| 32 |
|
| 33 |
Table of Contents |
| 34 |
|
| 35 |
<a href="#section-1">1</a>. Introduction................................................... <a href="#page-3">3</a> |
| 36 |
<a href="#section-1.1">1.1</a> Editorial and Conformance Conventions......................... <a href="#page-4">4</a> |
| 37 |
<a href="#section-1.2">1.2</a> Design Philosophy............................................. <a href="#page-4">4</a> |
| 38 |
<a href="#section-1.3">1.3</a> Versions, Namespaces and Identifiers.......................... <a href="#page-4">4</a> |
| 39 |
<a href="#section-1.4">1.4</a> Acknowledgements.............................................. <a href="#page-6">6</a> |
| 40 |
<a href="#section-1.5">1.5</a> W3C Status.................................................... <a href="#page-6">6</a> |
| 41 |
<a href="#section-2">2</a>. Signature Overview and Examples................................ <a href="#page-7">7</a> |
| 42 |
2.1 Simple Example (Signature, SignedInfo, Methods, and References) 8 |
| 43 |
<a href="#section-2.1.1">2.1.1</a> More on Reference........................................... <a href="#page-9">9</a> |
| 44 |
<a href="#section-2.2">2.2</a> Extended Example (Object and SignatureProperty)............... <a href="#page-10">10</a> |
| 45 |
<a href="#section-2.3">2.3</a> Extended Example (Object and Manifest)........................ <a href="#page-12">12</a> |
| 46 |
<a href="#section-3.0">3.0</a> Processing Rules.............................................. <a href="#page-13">13</a> |
| 47 |
<a href="#section-3.1">3.1</a> Core Generation............................................... <a href="#page-13">13</a> |
| 48 |
<a href="#section-3.1.1">3.1.1</a> Reference Generation........................................ <a href="#page-13">13</a> |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
<span class="grey">Eastlake, et al. Standards Track [Page 1]</span></pre> |
| 53 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span> |
| 54 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 55 |
|
| 56 |
|
| 57 |
<a href="#section-3.1.2">3.1.2</a> Signature Generation........................................ <a href="#page-13">13</a> |
| 58 |
<a href="#section-3.2">3.2</a> Core Validation............................................... <a href="#page-14">14</a> |
| 59 |
<a href="#section-3.2.1">3.2.1</a> Reference Validation........................................ <a href="#page-14">14</a> |
| 60 |
<a href="#section-3.2.2">3.2.2</a> Signature Validation........................................ <a href="#page-15">15</a> |
| 61 |
<a href="#section-4.0">4.0</a> Core Signature Syntax......................................... <a href="#page-15">15</a> |
| 62 |
<a href="#section-4.0.1">4.0.1</a> The ds:CryptoBinary Simple Type............................. <a href="#page-17">17</a> |
| 63 |
<a href="#section-4.1">4.1</a> The Signature element......................................... <a href="#page-17">17</a> |
| 64 |
<a href="#section-4.2">4.2</a> The SignatureValue Element.................................... <a href="#page-18">18</a> |
| 65 |
<a href="#section-4.3">4.3</a> The SignedInfo Element........................................ <a href="#page-18">18</a> |
| 66 |
<a href="#section-4.3.1">4.3.1</a> The CanonicalizationMethod Element.......................... <a href="#page-19">19</a> |
| 67 |
<a href="#section-4.3.2">4.3.2</a> The SignatureMethod Element................................. <a href="#page-21">21</a> |
| 68 |
<a href="#section-4.3.3">4.3.3</a> The Reference Element....................................... <a href="#page-21">21</a> |
| 69 |
<a href="#section-4.3.3.1">4.3.3.1</a> The URI Attribute......................................... <a href="#page-22">22</a> |
| 70 |
<a href="#section-4.3.3.2">4.3.3.2</a> The Reference Processing Model............................ <a href="#page-23">23</a> |
| 71 |
<a href="#section-4.3.3.3">4.3.3.3</a> Same-Document URI-References.............................. <a href="#page-25">25</a> |
| 72 |
<a href="#section-4.3.3.4">4.3.3.4</a> The Transforms Element.................................... <a href="#page-26">26</a> |
| 73 |
<a href="#section-4.3.3.5">4.3.3.5</a> The DigestMethod Element.................................. <a href="#page-28">28</a> |
| 74 |
<a href="#section-4.3.3.6">4.3.3.6</a> The DigestValue Element................................... <a href="#page-28">28</a> |
| 75 |
<a href="#section-4.4">4.4</a> The KeyInfo Element........................................... <a href="#page-29">29</a> |
| 76 |
<a href="#section-4.4.1">4.4.1</a> The KeyName Element......................................... <a href="#page-31">31</a> |
| 77 |
<a href="#section-4.4.2">4.4.2</a> The KeyValue Element........................................ <a href="#page-31">31</a> |
| 78 |
<a href="#section-4.4.2.1">4.4.2.1</a> The DSAKeyValue Element................................... <a href="#page-32">32</a> |
| 79 |
<a href="#section-4.4.2.2">4.4.2.2</a> The RSAKeyValue Element................................... <a href="#page-33">33</a> |
| 80 |
<a href="#section-4.4.3">4.4.3</a> The RetrievalMethod Element................................. <a href="#page-34">34</a> |
| 81 |
<a href="#section-4.4.4">4.4.4</a> The X509Data Element........................................ <a href="#page-35">35</a> |
| 82 |
<a href="#section-4.4.5">4.4.5</a> The PGPData Element......................................... <a href="#page-38">38</a> |
| 83 |
<a href="#section-4.4.6">4.4.6</a> The SPKIData Element........................................ <a href="#page-39">39</a> |
| 84 |
<a href="#section-4.4.7">4.4.7</a> The MgmtData Element........................................ <a href="#page-40">40</a> |
| 85 |
<a href="#section-4.5">4.5</a> The Object Element............................................ <a href="#page-40">40</a> |
| 86 |
<a href="#section-5.0">5.0</a> Additional Signature Syntax................................... <a href="#page-42">42</a> |
| 87 |
<a href="#section-5.1">5.1</a> The Manifest Element.......................................... <a href="#page-42">42</a> |
| 88 |
<a href="#section-5.2">5.2</a> The SignatureProperties Element............................... <a href="#page-43">43</a> |
| 89 |
<a href="#section-5.3">5.3</a> Processing Instructions in Signature Elements................. <a href="#page-44">44</a> |
| 90 |
<a href="#section-5.4">5.4</a> Comments in Signature Elements................................ <a href="#page-44">44</a> |
| 91 |
<a href="#section-6.0">6.0</a> Algorithms.................................................... <a href="#page-44">44</a> |
| 92 |
<a href="#section-6.1">6.1</a> Algorithm Identifiers and Implementation Requirements......... <a href="#page-44">44</a> |
| 93 |
<a href="#section-6.2">6.2</a> Message Digests............................................... <a href="#page-46">46</a> |
| 94 |
<a href="#section-6.2.1">6.2.1</a> SHA-1....................................................... <a href="#page-46">46</a> |
| 95 |
<a href="#section-6.3">6.3</a> Message Authentication Codes.................................. <a href="#page-46">46</a> |
| 96 |
<a href="#section-6.3.1">6.3.1</a> HMAC........................................................ <a href="#page-46">46</a> |
| 97 |
<a href="#section-6.4">6.4</a> Signature Algorithms.......................................... <a href="#page-47">47</a> |
| 98 |
<a href="#section-6.4.1">6.4.1</a> DSA......................................................... <a href="#page-47">47</a> |
| 99 |
<a href="#section-6.4.2">6.4.2</a> PKCS1 (RSA-SHA1)............................................ <a href="#page-48">48</a> |
| 100 |
<a href="#section-6.5">6.5</a> Canonicalization Algorithms................................... <a href="#page-49">49</a> |
| 101 |
<a href="#section-6.5.1">6.5.1</a> Canonical XML............................................... <a href="#page-49">49</a> |
| 102 |
<a href="#section-6.6">6.6</a> Transform Algorithms.......................................... <a href="#page-50">50</a> |
| 103 |
<a href="#section-6.6.1">6.6.1</a> Canonicalization............................................ <a href="#page-50">50</a> |
| 104 |
<a href="#section-6.6.2">6.6.2</a> Base64...................................................... <a href="#page-50">50</a> |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
<span class="grey">Eastlake, et al. Standards Track [Page 2]</span></pre> |
| 109 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span> |
| 110 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 111 |
|
| 112 |
|
| 113 |
<a href="#section-6.6.3">6.6.3</a> XPath Filtering............................................. <a href="#page-51">51</a> |
| 114 |
<a href="#section-6.6.4">6.6.4</a> Enveloped Signature Transform............................... <a href="#page-54">54</a> |
| 115 |
<a href="#section-6.6.5">6.6.5</a> XSLT Transform.............................................. <a href="#page-54">54</a> |
| 116 |
<a href="#section-7">7</a>. XML Canonicalization and Syntax Constraint Considerations...... <a href="#page-55">55</a> |
| 117 |
<a href="#section-7.1">7.1</a> XML 1.0, Syntax Constraints, and Canonicalization............. <a href="#page-56">56</a> |
| 118 |
<a href="#section-7.2">7.2</a> DOM/SAX Processing and Canonicalization....................... <a href="#page-57">57</a> |
| 119 |
<a href="#section-7.3">7.3</a> Namespace Context and Portable Signatures..................... <a href="#page-58">58</a> |
| 120 |
<a href="#section-8.0">8.0</a> Security Considerations....................................... <a href="#page-59">59</a> |
| 121 |
<a href="#section-8.1">8.1</a> Transforms.................................................... <a href="#page-59">59</a> |
| 122 |
<a href="#section-8.1.1">8.1.1</a> Only What is Signed is Secure............................... <a href="#page-60">60</a> |
| 123 |
<a href="#section-8.1.2">8.1.2</a> Only What is 'Seen' Should be Signed........................ <a href="#page-60">60</a> |
| 124 |
<a href="#section-8.1.3">8.1.3</a> 'See' What is Signed........................................ <a href="#page-61">61</a> |
| 125 |
<a href="#section-8.2">8.2</a> Check the Security Model...................................... <a href="#page-62">62</a> |
| 126 |
<a href="#section-8.3">8.3</a> Algorithms, Key Lengths, Certificates, Etc.................... <a href="#page-62">62</a> |
| 127 |
<a href="#section-9">9</a>. Schema, DTD, Data Model, and Valid Examples.................... <a href="#page-63">63</a> |
| 128 |
<a href="#section-10">10</a>. Definitions................................................... <a href="#page-63">63</a> |
| 129 |
Appendix: Changes from <a href="./rfc3075">RFC 3075</a>................................... <a href="#page-67">67</a> |
| 130 |
References........................................................ <a href="#page-67">67</a> |
| 131 |
Authors' Addresses................................................ <a href="#page-72">72</a> |
| 132 |
Full Copyright Statement.......................................... <a href="#page-73">73</a> |
| 133 |
|
| 134 |
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span> |
| 135 |
|
| 136 |
This document specifies XML syntax and processing rules for creating |
| 137 |
and representing digital signatures. XML Signatures can be applied |
| 138 |
to any digital content (data object), including XML. An XML |
| 139 |
Signature may be applied to the content of one or more resources. |
| 140 |
Enveloped or enveloping signatures are over data within the same XML |
| 141 |
document as the signature; detached signatures are over data external |
| 142 |
to the signature element. More specifically, this specification |
| 143 |
defines an XML signature element type and an XML signature |
| 144 |
application; conformance requirements for each are specified by way |
| 145 |
of schema definitions and prose respectively. This specification |
| 146 |
also includes other useful types that identify methods for |
| 147 |
referencing collections of resources, algorithms, and keying and |
| 148 |
management information. |
| 149 |
|
| 150 |
The XML Signature is a method of associating a key with referenced |
| 151 |
data (octets); it does not normatively specify how keys are |
| 152 |
associated with persons or institutions, nor the meaning of the data |
| 153 |
being referenced and signed. Consequently, while this specification |
| 154 |
is an important component of secure XML applications, it itself is |
| 155 |
not sufficient to address all application security/trust concerns, |
| 156 |
particularly with respect to using signed XML (or other data formats) |
| 157 |
as a basis of human-to-human communication and agreement. Such an |
| 158 |
application must specify additional key, algorithm, processing and |
| 159 |
rendering requirements. For further information, please see Security |
| 160 |
Considerations (<a href="#section-8">section 8</a>). |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
<span class="grey">Eastlake, et al. Standards Track [Page 3]</span></pre> |
| 165 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span> |
| 166 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 167 |
|
| 168 |
|
| 169 |
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a> Editorial and Conformance Conventions</span> |
| 170 |
|
| 171 |
For readability, brevity, and historic reasons this document uses the |
| 172 |
term "signature" to generally refer to digital authentication values |
| 173 |
of all types. Obviously, the term is also strictly used to refer to |
| 174 |
authentication values that are based on public keys and that provide |
| 175 |
signer authentication. When specifically discussing authentication |
| 176 |
values based on symmetric secret key codes we use the terms |
| 177 |
authenticators or authentication codes. (See Check the Security |
| 178 |
Model, <a href="#section-8.3">section 8.3</a>.) |
| 179 |
|
| 180 |
This specification provides an XML Schema [<a href="#ref-XML-schema" title="N. Mendelsohn">XML-schema</a>] and DTD [<a href="#ref-XML" title=" J. Paoli">XML</a>]. |
| 181 |
The schema definition is normative. |
| 182 |
|
| 183 |
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
| 184 |
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
| 185 |
specification are to be interpreted as described in <a href="./rfc2119">RFC2119</a> |
| 186 |
[<a href="#ref-KEYWORDS" title=""Key words for use in RFCs to Indicate Requirement Levels"">KEYWORDS</a>]: |
| 187 |
|
| 188 |
"they MUST only be used where it is actually required for |
| 189 |
interoperation or to limit behavior which has potential for |
| 190 |
causing harm (e.g., limiting retransmissions)" |
| 191 |
|
| 192 |
Consequently, we use these capitalized key words to unambiguously |
| 193 |
specify requirements over protocol and application features and |
| 194 |
behavior that affect the interoperability and security of |
| 195 |
implementations. These key words are not used (capitalized) to |
| 196 |
describe XML grammar; schema definitions unambiguously describe such |
| 197 |
requirements and we wish to reserve the prominence of these terms for |
| 198 |
the natural language descriptions of protocols and features. For |
| 199 |
instance, an XML attribute might be described as being "optional." |
| 200 |
Compliance with the Namespaces in XML specification [<a href="#ref-XML-ns" title="D. Hollander">XML-ns</a>] is |
| 201 |
described as "REQUIRED." |
| 202 |
|
| 203 |
<span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a> Design Philosophy</span> |
| 204 |
|
| 205 |
The design philosophy and requirements of this specification are |
| 206 |
addressed in the XML-Signature Requirements document [XML-Signature- |
| 207 |
RD]. |
| 208 |
|
| 209 |
<span class="h3"><a class="selflink" id="section-1.3" href="#section-1.3">1.3</a> Versions, Namespaces and Identifiers</span> |
| 210 |
|
| 211 |
No provision is made for an explicit version number in this syntax. |
| 212 |
If a future version is needed, it will use a different namespace. |
| 213 |
The XML namespace [<a href="#ref-XML-ns" title="D. Hollander">XML-ns</a>] URI that MUST be used by implementations |
| 214 |
of this (dated) specification is: |
| 215 |
|
| 216 |
xmlns="http://www.w3.org/2000/09/xmldsig#" |
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
<span class="grey">Eastlake, et al. Standards Track [Page 4]</span></pre> |
| 221 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span> |
| 222 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 223 |
|
| 224 |
|
| 225 |
This namespace is also used as the prefix for algorithm identifiers |
| 226 |
used by this specification. While applications MUST support XML and |
| 227 |
XML namespaces, the use of internal entities [<a href="#ref-XML" title=" J. Paoli">XML</a>] or our "dsig" XML |
| 228 |
namespace prefix and defaulting/scoping conventions are OPTIONAL; we |
| 229 |
use these facilities to provide compact and readable examples. |
| 230 |
|
| 231 |
This specification uses Uniform Resource Identifiers [<a href="#ref-URI" title=""Uniform Resource Identifiers (URI): Generic Syntax"">URI</a>] to |
| 232 |
identify resources, algorithms, and semantics. The URI in the |
| 233 |
namespace declaration above is also used as a prefix for URIs under |
| 234 |
the control of this specification. For resources not under the |
| 235 |
control of this specification, we use the designated Uniform Resource |
| 236 |
Names [<a href="#ref-URN" title=""URN Syntax"">URN</a>] or Uniform Resource Locators [<a href="#ref-URL" title=""Uniform Resource Locators (URL)"">URL</a>] defined by its |
| 237 |
normative external specification. If an external specification has |
| 238 |
not allocated itself a Uniform Resource Identifier we allocate an |
| 239 |
identifier under our own namespace. For instance: |
| 240 |
|
| 241 |
SignatureProperties is identified and defined by this specification's |
| 242 |
namespace: |
| 243 |
<a href="http://www.w3.org/2000/09/xmldsig#SignatureProperties">http://www.w3.org/2000/09/xmldsig#SignatureProperties</a> |
| 244 |
|
| 245 |
XSLT is identified and defined by an external URI |
| 246 |
<a href="http://www.w3.org/TR/1999/REC-xslt-19991116">http://www.w3.org/TR/1999/REC-xslt-19991116</a> |
| 247 |
|
| 248 |
SHA1 is identified via this specification's namespace and defined via |
| 249 |
a normative reference |
| 250 |
<a href="http://www.w3.org/2000/09/xmldsig#sha1">http://www.w3.org/2000/09/xmldsig#sha1</a> |
| 251 |
FIPS PUB 180-1. Secure Hash Standard. U.S. Department of |
| 252 |
Commerce/National Institute of Standards and Technology. |
| 253 |
|
| 254 |
Finally, in order to provide for terse namespace declarations we |
| 255 |
sometimes use XML internal entities [<a href="#ref-XML" title=" J. Paoli">XML</a>] within URIs. For instance: |
| 256 |
|
| 257 |
<?xml version='1.0'?> |
| 258 |
<!DOCTYPE Signature SYSTEM |
| 259 |
"xmldsig-core-schema.dtd" [ <!ENTITY dsig |
| 260 |
"<a href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>"> ]> |
| 261 |
<Signature xmlns="&dsig;" Id="MyFirstSignature"> |
| 262 |
<SignedInfo> |
| 263 |
... |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
<span class="grey">Eastlake, et al. Standards Track [Page 5]</span></pre> |
| 277 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span> |
| 278 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 279 |
|
| 280 |
|
| 281 |
<span class="h3"><a class="selflink" id="section-1.4" href="#section-1.4">1.4</a> Acknowledgements</span> |
| 282 |
|
| 283 |
The contributions of the following Working Group members to this |
| 284 |
specification are gratefully acknowledged: |
| 285 |
|
| 286 |
* Mark Bartel, Accelio (Author) |
| 287 |
* John Boyer, PureEdge (Author) |
| 288 |
* Mariano P. Consens, University of Waterloo |
| 289 |
* John Cowan, Reuters Health |
| 290 |
* Donald Eastlake 3rd, Motorola (Chair, Author/Editor) |
| 291 |
* Barb Fox, Microsoft (Author) |
| 292 |
* Christian Geuer-Pollmann, University Siegen |
| 293 |
* Tom Gindin, IBM |
| 294 |
* Phillip Hallam-Baker, VeriSign Inc |
| 295 |
* Richard Himes, US Courts |
| 296 |
* Merlin Hughes, Baltimore |
| 297 |
* Gregor Karlinger, IAIK TU Graz |
| 298 |
* Brian LaMacchia, Microsoft (Author) |
| 299 |
* Peter Lipp, IAIK TU Graz |
| 300 |
* Joseph Reagle, W3C (Chair, Author/Editor) |
| 301 |
* Ed Simon, XMLsec (Author) |
| 302 |
* David Solo, Citigroup (Author/Editor) |
| 303 |
* Petteri Stenius, DONE Information, Ltd |
| 304 |
* Raghavan Srinivas, Sun |
| 305 |
* Kent Tamura, IBM |
| 306 |
* Winchel Todd Vincent III, GSU |
| 307 |
* Carl Wallace, Corsec Security, Inc. |
| 308 |
* Greg Whitehead, Signio Inc. |
| 309 |
|
| 310 |
As are the Last Call comments from the following: |
| 311 |
|
| 312 |
* Dan Connolly, W3C |
| 313 |
* Paul Biron, Kaiser Permanente, on behalf of the XML Schema WG. |
| 314 |
* Martin J. Duerst, W3C; and Masahiro Sekiguchi, Fujitsu; on |
| 315 |
behalf of the Internationalization WG/IG. |
| 316 |
* Jonathan Marsh, Microsoft, on behalf of the Extensible |
| 317 |
Stylesheet Language WG. |
| 318 |
|
| 319 |
<span class="h3"><a class="selflink" id="section-1.5" href="#section-1.5">1.5</a> W3C Status</span> |
| 320 |
|
| 321 |
The World Wide Web Consortium Recommendation corresponding to |
| 322 |
this RFC is at: |
| 323 |
|
| 324 |
<a href="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/">http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/</a> |
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
<span class="grey">Eastlake, et al. Standards Track [Page 6]</span></pre> |
| 333 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span> |
| 334 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 335 |
|
| 336 |
|
| 337 |
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Signature Overview and Examples</span> |
| 338 |
|
| 339 |
This section provides an overview and examples of XML digital |
| 340 |
signature syntax. The specific processing is given in Processing |
| 341 |
Rules (<a href="#section-3">section 3</a>). The formal syntax is found in Core Signature |
| 342 |
Syntax (<a href="#section-4">section 4</a>) and Additional Signature Syntax (<a href="#section-5">section 5</a>). |
| 343 |
|
| 344 |
In this section, an informal representation and examples are used to |
| 345 |
describe the structure of the XML signature syntax. This |
| 346 |
representation and examples may omit attributes, details and |
| 347 |
potential features that are fully explained later. |
| 348 |
|
| 349 |
XML Signatures are applied to arbitrary digital content (data |
| 350 |
objects) via an indirection. Data objects are digested, the |
| 351 |
resulting value is placed in an element (with other information) and |
| 352 |
that element is then digested and cryptographically signed. XML |
| 353 |
digital signatures are represented by the Signature element which has |
| 354 |
the following structure (where "?" denotes zero or one occurrence; |
| 355 |
"+" denotes one or more occurrences; and "*" denotes zero or more |
| 356 |
occurrences): |
| 357 |
|
| 358 |
<Signature ID?> |
| 359 |
<SignedInfo> |
| 360 |
<CanonicalizationMethod/> |
| 361 |
<SignatureMethod/> |
| 362 |
(<Reference URI? > |
| 363 |
(<Transforms>)? |
| 364 |
<DigestMethod> |
| 365 |
<DigestValue> |
| 366 |
</Reference>)+ |
| 367 |
</SignedInfo> |
| 368 |
<SignatureValue> |
| 369 |
(<KeyInfo>)? |
| 370 |
(<Object ID?>)* |
| 371 |
</Signature> |
| 372 |
|
| 373 |
Signatures are related to data objects via URIs [<a href="#ref-URI" title=""Uniform Resource Identifiers (URI): Generic Syntax"">URI</a>]. Within an XML |
| 374 |
document, signatures are related to local data objects via fragment |
| 375 |
identifiers. Such local data can be included within an enveloping |
| 376 |
signature or can enclose an enveloped signature. Detached signatures |
| 377 |
are over external network resources or local data objects that reside |
| 378 |
within the same XML document as sibling elements; in this case, the |
| 379 |
signature is neither enveloping (signature is parent) nor enveloped |
| 380 |
attribute (signature is child). Since a Signature element (and its |
| 381 |
Id value/name) may co-exist or be combined with other elements (and |
| 382 |
their IDs) within a single XML document, care should be taken in |
| 383 |
choosing names such that there are no subsequent collisions that |
| 384 |
violate the ID uniqueness validity constraint [<a href="#ref-XML" title=" J. Paoli">XML</a>]. |
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
<span class="grey">Eastlake, et al. Standards Track [Page 7]</span></pre> |
| 389 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span> |
| 390 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 391 |
|
| 392 |
|
| 393 |
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a> Simple Example (Signature, SignedInfo, Methods, and References)</span> |
| 394 |
|
| 395 |
The following example is a detached signature of the content of the |
| 396 |
HTML4 in XML specification. |
| 397 |
|
| 398 |
[<a id="ref-s01">s01</a>] <Signature Id="MyFirstSignature" |
| 399 |
xmlns="http://www.w3.org/2000/09/xmldsig#"> |
| 400 |
[s02] <SignedInfo> |
| 401 |
[<a href="#ref-s03">s03</a>] <CanonicalizationMethod |
| 402 |
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> |
| 403 |
[<a href="#ref-s04">s04</a>] <SignatureMethod |
| 404 |
Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/> |
| 405 |
[<a href="#ref-s05">s05</a>] <Reference |
| 406 |
URI="http://www.w3.org/TR/2000/REC-xhtml1-20000126/"> |
| 407 |
[s06] <Transforms> |
| 408 |
[s07] <Transform |
| 409 |
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> |
| 410 |
[s08] </Transforms> |
| 411 |
[s09] <DigestMethod |
| 412 |
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> |
| 413 |
[s10] <DigestValue>j6lwx3rvEPO0vKtMup4NbeVu8nk=</DigestValue> |
| 414 |
[s11] </Reference> |
| 415 |
[s12] </SignedInfo> |
| 416 |
[s13] <SignatureValue>MC0CFFrVLtRlk=...</SignatureValue> |
| 417 |
[s14] <KeyInfo> |
| 418 |
[s15a] <KeyValue> |
| 419 |
[s15b] <DSAKeyValue> |
| 420 |
[s15c] <P>...</P><Q>...</Q><G>...</G><Y>...</Y> |
| 421 |
[s15d] </DSAKeyValue> |
| 422 |
[s15e] </KeyValue> |
| 423 |
[s16] </KeyInfo> |
| 424 |
[s17] </Signature> |
| 425 |
|
| 426 |
[<a id="ref-s02-12">s02-12</a>] The required SignedInfo element is the information that is |
| 427 |
actually signed. Core validation of SignedInfo consists of two |
| 428 |
mandatory processes: validation of the signature over SignedInfo and |
| 429 |
validation of each Reference digest within SignedInfo. Note that the |
| 430 |
algorithms used in calculating the SignatureValue are also included |
| 431 |
in the signed information while the SignatureValue element is outside |
| 432 |
SignedInfo. |
| 433 |
|
| 434 |
[<a id="ref-s03">s03</a>] The CanonicalizationMethod is the algorithm that is used to |
| 435 |
canonicalize the SignedInfo element before it is digested as part of |
| 436 |
the signature operation. Note that this example, and all examples in |
| 437 |
this specification, are not in canonical form. |
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
<span class="grey">Eastlake, et al. Standards Track [Page 8]</span></pre> |
| 445 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span> |
| 446 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 447 |
|
| 448 |
|
| 449 |
[<a id="ref-s04">s04</a>] The SignatureMethod is the algorithm that is used to convert |
| 450 |
the canonicalized SignedInfo into the SignatureValue. It is a |
| 451 |
combination of a digest algorithm and a key dependent algorithm and |
| 452 |
possibly other algorithms such as padding, for example RSA-SHA1. The |
| 453 |
algorithm names are signed to resist attacks based on substituting a |
| 454 |
weaker algorithm. To promote application interoperability we specify |
| 455 |
a set of signature algorithms that MUST be implemented, though their |
| 456 |
use is at the discretion of the signature creator. We specify |
| 457 |
additional algorithms as RECOMMENDED or OPTIONAL for implementation; |
| 458 |
the design also permits arbitrary user specified algorithms. |
| 459 |
|
| 460 |
[<a id="ref-s05-11">s05-11</a>] Each Reference element includes the digest method and |
| 461 |
resulting digest value calculated over the identified data object. |
| 462 |
It may also include transformations that produced the input to the |
| 463 |
digest operation. A data object is signed by computing its digest |
| 464 |
value and a signature over that value. The signature is later |
| 465 |
checked via reference and signature validation. |
| 466 |
|
| 467 |
[<a id="ref-s14-16">s14-16</a>] KeyInfo indicates the key to be used to validate the |
| 468 |
signature. Possible forms for identification include certificates, |
| 469 |
key names, and key agreement algorithms and information -- we define |
| 470 |
only a few. KeyInfo is optional for two reasons. First, the signer |
| 471 |
may not wish to reveal key information to all document processing |
| 472 |
parties. Second, the information may be known within the |
| 473 |
application's context and need not be represented explicitly. Since |
| 474 |
KeyInfo is outside of SignedInfo, if the signer wishes to bind the |
| 475 |
keying information to the signature, a Reference can easily identify |
| 476 |
and include the KeyInfo as part of the signature. |
| 477 |
|
| 478 |
<span class="h4"><a class="selflink" id="section-2.1.1" href="#section-2.1.1">2.1.1</a> More on Reference</span> |
| 479 |
|
| 480 |
[<a id="ref-s05">s05</a>] <Reference |
| 481 |
URI="http://www.w3.org/TR/2000/REC-xhtml1-20000126/"> |
| 482 |
[s06] <Transforms> |
| 483 |
[s07] <Transform |
| 484 |
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> |
| 485 |
[s08] </Transforms> |
| 486 |
[s09] <DigestMethod |
| 487 |
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> |
| 488 |
[s10] <DigestValue>j6lwx3rvEPO0vKtMup4NbeVu8nk=</DigestValue> |
| 489 |
[s11] </Reference> |
| 490 |
|
| 491 |
[<a id="ref-s05">s05</a>] The optional URI attribute of Reference identifies the data |
| 492 |
object to be signed. This attribute may be omitted on at most one |
| 493 |
Reference in a Signature. (This limitation is imposed in order to |
| 494 |
ensure that references and objects may be matched unambiguously.) |
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
<span class="grey">Eastlake, et al. Standards Track [Page 9]</span></pre> |
| 501 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span> |
| 502 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 503 |
|
| 504 |
|
| 505 |
[<a id="ref-s05-08">s05-08</a>] This identification, along with the transforms, is a |
| 506 |
description provided by the signer on how they obtained the signed |
| 507 |
data object in the form it was digested (i.e., the digested content). |
| 508 |
The verifier may obtain the digested content in another method so |
| 509 |
long as the digest verifies. In particular, the verifier may obtain |
| 510 |
the content from a different location such as a local store, as |
| 511 |
opposed to that specified in the URI. |
| 512 |
|
| 513 |
[<a id="ref-s06-08">s06-08</a>] Transforms is an optional ordered list of processing steps |
| 514 |
that were applied to the resource's content before it was digested. |
| 515 |
Transforms can include operations such as canonicalization, |
| 516 |
encoding/decoding (including compression/inflation), XSLT, XPath, XML |
| 517 |
schema validation, or XInclude. XPath transforms permit the signer |
| 518 |
to derive an XML document that omits portions of the source document. |
| 519 |
Consequently those excluded portions can change without affecting |
| 520 |
signature validity. For example, if the resource being signed |
| 521 |
encloses the signature itself, such a transform must be used to |
| 522 |
exclude the signature value from its own computation. If no |
| 523 |
Transforms element is present, the resource's content is digested |
| 524 |
directly. While the Working Group has specified mandatory (and |
| 525 |
optional) canonicalization and decoding algorithms, user specified |
| 526 |
transforms are permitted. |
| 527 |
|
| 528 |
[<a id="ref-s09-10">s09-10</a>] DigestMethod is the algorithm applied to the data after |
| 529 |
Transforms is applied (if specified) to yield the DigestValue. The |
| 530 |
signing of the DigestValue is what binds a resources content to the |
| 531 |
signer's key. |
| 532 |
|
| 533 |
<span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a> Extended Example (Object and SignatureProperty)</span> |
| 534 |
|
| 535 |
This specification does not address mechanisms for making statements |
| 536 |
or assertions. Instead, this document defines what it means for |
| 537 |
something to be signed by an XML Signature (integrity, message |
| 538 |
authentication, and/or signer authentication). Applications that |
| 539 |
wish to represent other semantics must rely upon other technologies, |
| 540 |
such as [<a href="#ref-XML" title=" J. Paoli">XML</a>, <a href="#ref-RDF" title="R.V. Guha. March 2000. http://www.w3.org/TR/2000/CR-rdf-schema-20000327/ Resource Description Framework (RDF) Model and Syntax Specification. W3C Recommendation. O. Lassila">RDF</a>]. For instance, an application might use a |
| 541 |
foo:assuredby attribute within its own markup to reference a |
| 542 |
Signature element. Consequently, it's the application that must |
| 543 |
understand and know how to make trust decisions given the validity of |
| 544 |
the signature and the meaning of assuredby syntax. We also define a |
| 545 |
SignatureProperties element type for the inclusion of assertions |
| 546 |
about the signature itself (e.g., signature semantics, the time of |
| 547 |
signing or the serial number of hardware used in cryptographic |
| 548 |
processes). Such assertions may be signed by including a Reference |
| 549 |
for the SignatureProperties in SignedInfo. While the signing |
| 550 |
application should be very careful about what it signs (it should |
| 551 |
understand what is in the SignatureProperty) a receiving application |
| 552 |
has no obligation to understand that semantic (though its parent |
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
<span class="grey">Eastlake, et al. Standards Track [Page 10]</span></pre> |
| 557 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span> |
| 558 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 559 |
|
| 560 |
|
| 561 |
trust engine may wish to). Any content about the signature |
| 562 |
generation may be located within the SignatureProperty element. The |
| 563 |
mandatory Target attribute references the Signature element to which |
| 564 |
the property applies. |
| 565 |
|
| 566 |
Consider the preceding example with an additional reference to a |
| 567 |
local Object that includes a SignatureProperty element. (Such a |
| 568 |
signature would not only be detached [p02] but enveloping [p03].) |
| 569 |
|
| 570 |
[ ] <Signature Id="MySecondSignature" ...> |
| 571 |
[p01] <SignedInfo> |
| 572 |
[ ] ... |
| 573 |
[p02] <Reference URI="http://www.w3.org/TR/xml-stylesheet/"> |
| 574 |
[ ] ... |
| 575 |
[p03] <Reference URI="#AMadeUpTimeStamp" |
| 576 |
[<a href="#ref-p04">p04</a>] |
| 577 |
Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties"> |
| 578 |
[p05] <DigestMethod |
| 579 |
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> |
| 580 |
[p06] <DigestValue>k3453rvEPO0vKtMup4NbeVu8nk=</DigestValue> |
| 581 |
[p07] </Reference> |
| 582 |
[p08] </SignedInfo> |
| 583 |
[p09] ... |
| 584 |
[<a href="#ref-p10">p10</a>] <Object> |
| 585 |
[p11] <SignatureProperties> |
| 586 |
[p12] <SignatureProperty Id="AMadeUpTimeStamp" |
| 587 |
Target="#MySecondSignature"> |
| 588 |
[p13] <timestamp xmlns="http://www.ietf.org/rfcXXXX.txt"> |
| 589 |
[p14] <date>19990908</date> |
| 590 |
[p15] <time>14:34:34:34</time> |
| 591 |
[p16] </timestamp> |
| 592 |
[p17] </SignatureProperty> |
| 593 |
[p18] </SignatureProperties> |
| 594 |
[p19] </Object> |
| 595 |
[p20]</Signature> |
| 596 |
|
| 597 |
[<a id="ref-p04">p04</a>] The optional Type attribute of Reference provides information |
| 598 |
about the resource identified by the URI. In particular, it can |
| 599 |
indicate that it is an Object, SignatureProperty, or Manifest |
| 600 |
element. This can be used by applications to initiate special |
| 601 |
processing of some Reference elements. References to an XML data |
| 602 |
element within an Object element SHOULD identify the actual element |
| 603 |
pointed to. Where the element content is not XML (perhaps it is |
| 604 |
binary or encoded data) the reference should identify the Object and |
| 605 |
the Reference Type, if given, SHOULD indicate Object. Note that Type |
| 606 |
is advisory and no action based on it or checking of its correctness |
| 607 |
is required by core behavior. |
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
<span class="grey">Eastlake, et al. Standards Track [Page 11]</span></pre> |
| 613 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span> |
| 614 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 615 |
|
| 616 |
|
| 617 |
[<a id="ref-p10">p10</a>] Object is an optional element for including data objects within |
| 618 |
the signature element or elsewhere. The Object can be optionally |
| 619 |
typed and/or encoded. |
| 620 |
|
| 621 |
[<a id="ref-p11-18">p11-18</a>] Signature properties, such as time of signing, can be |
| 622 |
optionally signed by identifying them from within a Reference. |
| 623 |
(These properties are traditionally called signature "attributes" |
| 624 |
although that term has no relationship to the XML term "attribute".) |
| 625 |
|
| 626 |
<span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a> Extended Example (Object and Manifest)</span> |
| 627 |
|
| 628 |
The Manifest element is provided to meet additional requirements not |
| 629 |
directly addressed by the mandatory parts of this specification. Two |
| 630 |
requirements and the way the Manifest satisfies them follow. |
| 631 |
|
| 632 |
First, applications frequently need to efficiently sign multiple data |
| 633 |
objects even where the signature operation itself is an expensive |
| 634 |
public key signature. This requirement can be met by including |
| 635 |
multiple Reference elements within SignedInfo since the inclusion of |
| 636 |
each digest secures the data digested. However, some applications |
| 637 |
may not want the core validation behavior associated with this |
| 638 |
approach because it requires every Reference within SignedInfo to |
| 639 |
undergo reference validation -- the DigestValue elements are checked. |
| 640 |
These applications may wish to reserve reference validation decision |
| 641 |
logic to themselves. For example, an application might receive a |
| 642 |
signature valid SignedInfo element that includes three Reference |
| 643 |
elements. If a single Reference fails (the identified data object |
| 644 |
when digested does not yield the specified DigestValue) the signature |
| 645 |
would fail core validation. However, the application may wish to |
| 646 |
treat the signature over the two valid Reference elements as valid or |
| 647 |
take different actions depending on which fails. To accomplish this, |
| 648 |
SignedInfo would reference a Manifest element that contains one or |
| 649 |
more Reference elements (with the same structure as those in |
| 650 |
SignedInfo). Then, reference validation of the Manifest is under |
| 651 |
application control. |
| 652 |
|
| 653 |
Second, consider an application where many signatures (using |
| 654 |
different keys) are applied to a large number of documents. An |
| 655 |
inefficient solution is to have a separate signature (per key) |
| 656 |
repeatedly applied to a large SignedInfo element (with many |
| 657 |
References); this is wasteful and redundant. A more efficient |
| 658 |
solution is to include many references in a single Manifest that is |
| 659 |
then referenced from multiple Signature elements. |
| 660 |
|
| 661 |
The example below includes a Reference that signs a Manifest found |
| 662 |
within the Object element. |
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
<span class="grey">Eastlake, et al. Standards Track [Page 12]</span></pre> |
| 669 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span> |
| 670 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 671 |
|
| 672 |
|
| 673 |
[ ] ... |
| 674 |
[m01] <Reference URI="#MyFirstManifest" |
| 675 |
[m02] Type="http://www.w3.org/2000/09/xmldsig#Manifest"> |
| 676 |
[m03] <DigestMethod |
| 677 |
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> |
| 678 |
[m04] <DigestValue>345x3rvEPO0vKtMup4NbeVu8nk=</DigestValue> |
| 679 |
[m05] </Reference> |
| 680 |
[ ] ... |
| 681 |
[m06] <Object> |
| 682 |
[m07] <Manifest Id="MyFirstManifest"> |
| 683 |
[m08] <Reference> |
| 684 |
[m09] ... |
| 685 |
[m10] </Reference> |
| 686 |
[m11] <Reference> |
| 687 |
[m12] ... |
| 688 |
[m13] </Reference> |
| 689 |
[m14] </Manifest> |
| 690 |
[m15] </Object> |
| 691 |
|
| 692 |
<span class="h3"><a class="selflink" id="section-3.0" href="#section-3.0">3.0</a> Processing Rules</span> |
| 693 |
|
| 694 |
The sections below describe the operations to be performed as part of |
| 695 |
signature generation and validation. |
| 696 |
|
| 697 |
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a> Core Generation</span> |
| 698 |
|
| 699 |
The REQUIRED steps include the generation of Reference elements and |
| 700 |
the SignatureValue over SignedInfo. |
| 701 |
|
| 702 |
<span class="h4"><a class="selflink" id="section-3.1.1" href="#section-3.1.1">3.1.1</a> Reference Generation</span> |
| 703 |
|
| 704 |
For each data object being signed: |
| 705 |
|
| 706 |
1. Apply the Transforms, as determined by the application, to the |
| 707 |
data object. |
| 708 |
2. Calculate the digest value over the resulting data object. |
| 709 |
3. Create a Reference element, including the (optional) |
| 710 |
identification of the data object, any (optional) transform |
| 711 |
elements, the digest algorithm and the DigestValue. (Note, it is |
| 712 |
the canonical form of these references that are signed in 3.1.2 |
| 713 |
and validated in 3.2.1.) |
| 714 |
|
| 715 |
<span class="h4"><a class="selflink" id="section-3.1.2" href="#section-3.1.2">3.1.2</a> Signature Generation</span> |
| 716 |
|
| 717 |
1. Create SignedInfo element with SignatureMethod, |
| 718 |
CanonicalizationMethod and Reference(s). |
| 719 |
2. Canonicalize and then calculate the SignatureValue over SignedInfo |
| 720 |
based on algorithms specified in SignedInfo. |
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
<span class="grey">Eastlake, et al. Standards Track [Page 13]</span></pre> |
| 725 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span> |
| 726 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 727 |
|
| 728 |
|
| 729 |
3. Construct the Signature element that includes SignedInfo, |
| 730 |
Object(s) (if desired, encoding may be different than that used |
| 731 |
for signing), KeyInfo (if required), and SignatureValue. |
| 732 |
|
| 733 |
Note, if the Signature includes same-document references, [<a href="#ref-XML" title=" J. Paoli">XML</a>] or |
| 734 |
[<a href="#ref-XML-schema" title="N. Mendelsohn">XML-schema</a>] validation of the document might introduce changes that |
| 735 |
break the signature. Consequently, applications should be careful to |
| 736 |
consistently process the document or refrain from using external |
| 737 |
contributions (e.g., defaults and entities). |
| 738 |
|
| 739 |
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a> Core Validation</span> |
| 740 |
|
| 741 |
The REQUIRED steps of core validation include (1) reference |
| 742 |
validation, the verification of the digest contained in each |
| 743 |
Reference in SignedInfo, and (2) the cryptographic signature |
| 744 |
validation of the signature calculated over SignedInfo. |
| 745 |
|
| 746 |
Note, there may be valid signatures that some signature applications |
| 747 |
are unable to validate. Reasons for this include failure to |
| 748 |
implement optional parts of this specification, inability or |
| 749 |
unwillingness to execute specified algorithms, or inability or |
| 750 |
unwillingness to dereference specified URIs (some URI schemes may |
| 751 |
cause undesirable side effects), etc. |
| 752 |
|
| 753 |
Comparison of values in reference and signature validation are over |
| 754 |
the numeric (e.g., integer) or decoded octet sequence of the value. |
| 755 |
Different implementations may produce different encoded digest and |
| 756 |
signature values when processing the same resources because of |
| 757 |
variances in their encoding, such as accidental white space. But if |
| 758 |
one uses numeric or octet comparison (choose one) on both the stated |
| 759 |
and computed values these problems are eliminated. |
| 760 |
|
| 761 |
<span class="h4"><a class="selflink" id="section-3.2.1" href="#section-3.2.1">3.2.1</a> Reference Validation</span> |
| 762 |
|
| 763 |
1. Canonicalize the SignedInfo element based on the |
| 764 |
CanonicalizationMethod in SignedInfo. |
| 765 |
2. For each Reference in SignedInfo: |
| 766 |
2.1 Obtain the data object to be digested. (For example, the |
| 767 |
signature application may dereference the URI and execute |
| 768 |
Transforms provided by the signer in the Reference element, or |
| 769 |
it may obtain the content through other means such as a local |
| 770 |
cache.) |
| 771 |
2.2 Digest the resulting data object using the DigestMethod |
| 772 |
specified in its Reference specification. |
| 773 |
2.3 Compare the generated digest value against DigestValue in the |
| 774 |
SignedInfo Reference; if there is any mismatch, validation |
| 775 |
fails. |
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
<span class="grey">Eastlake, et al. Standards Track [Page 14]</span></pre> |
| 781 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span> |
| 782 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 783 |
|
| 784 |
|
| 785 |
Note, SignedInfo is canonicalized in step 1. The application must |
| 786 |
ensure that the CanonicalizationMethod has no dangerous side affects, |
| 787 |
such as rewriting URIs, (see CanonicalizationMethod (<a href="#section-4.3">section 4.3</a>)) |
| 788 |
and that it Sees What is Signed, which is the canonical form. |
| 789 |
|
| 790 |
<span class="h4"><a class="selflink" id="section-3.2.2" href="#section-3.2.2">3.2.2</a> Signature Validation</span> |
| 791 |
|
| 792 |
1. Obtain the keying information from KeyInfo or from an external |
| 793 |
source. |
| 794 |
2. Obtain the canonical form of the SignatureMethod using the |
| 795 |
CanonicalizationMethod and use the result (and previously obtained |
| 796 |
KeyInfo) to confirm the SignatureValue over the SignedInfo |
| 797 |
element. |
| 798 |
|
| 799 |
Note, KeyInfo (or some transformed version thereof) may be signed via |
| 800 |
a Reference element. Transformation and validation of this reference |
| 801 |
(3.2.1) is orthogonal to Signature Validation which uses the KeyInfo |
| 802 |
as parsed. |
| 803 |
|
| 804 |
Additionally, the SignatureMethod URI may have been altered by the |
| 805 |
canonicalization of SignedInfo (e.g., absolutization of relative |
| 806 |
URIs) and it is the canonical form that MUST be used. However, the |
| 807 |
required canonicalization [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>] of this specification does not |
| 808 |
change URIs. |
| 809 |
|
| 810 |
<span class="h3"><a class="selflink" id="section-4.0" href="#section-4.0">4.0</a> Core Signature Syntax</span> |
| 811 |
|
| 812 |
The general structure of an XML signature is described in Signature |
| 813 |
Overview (<a href="#section-2">section 2</a>). This section provides detailed syntax of the |
| 814 |
core signature features. Features described in this section are |
| 815 |
mandatory to implement unless otherwise indicated. The syntax is |
| 816 |
defined via DTDs and [XML-Schema] with the following XML preamble, |
| 817 |
declaration, and internal entity. |
| 818 |
|
| 819 |
|
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
|
| 824 |
|
| 825 |
|
| 826 |
|
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
|
| 833 |
|
| 834 |
|
| 835 |
|
| 836 |
<span class="grey">Eastlake, et al. Standards Track [Page 15]</span></pre> |
| 837 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span> |
| 838 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 839 |
|
| 840 |
|
| 841 |
Schema Definition: |
| 842 |
|
| 843 |
<?xml version="1.0" encoding="utf-8"?> |
| 844 |
<!DOCTYPE schema |
| 845 |
PUBLIC "-//W3C//DTD XMLSchema 200102//EN" |
| 846 |
"<a href="http://www.w3.org/2001/XMLSchema.dtd">http://www.w3.org/2001/XMLSchema.dtd</a>" |
| 847 |
[ |
| 848 |
<!ATTLIST schema |
| 849 |
xmlns:ds CDATA #FIXED "<a href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>"> |
| 850 |
<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'> |
| 851 |
<!ENTITY % p ''> |
| 852 |
<!ENTITY % s ''> |
| 853 |
]> |
| 854 |
|
| 855 |
<schema xmlns="http://www.w3.org/2001/XMLSchema" |
| 856 |
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" |
| 857 |
targetNamespace="http://www.w3.org/2000/09/xmldsig#" |
| 858 |
version="0.1" elementFormDefault="qualified"> |
| 859 |
|
| 860 |
DTD: |
| 861 |
|
| 862 |
<!-- |
| 863 |
|
| 864 |
The following entity declarations enable external/flexible content |
| 865 |
in the Signature content model. |
| 866 |
|
| 867 |
#PCDATA emulates schema:string; when combined with element types |
| 868 |
it emulates schema mixed="true". |
| 869 |
|
| 870 |
%foo.ANY permits the user to include their own element types from |
| 871 |
other namespaces, for example: |
| 872 |
<!ENTITY % KeyValue.ANY '| ecds:ECDSAKeyValue'> |
| 873 |
... |
| 874 |
<!ELEMENT ecds:ECDSAKeyValue (#PCDATA) > |
| 875 |
|
| 876 |
--> |
| 877 |
|
| 878 |
<!ENTITY % Object.ANY ''> |
| 879 |
<!ENTITY % Method.ANY ''> |
| 880 |
<!ENTITY % Transform.ANY ''> |
| 881 |
<!ENTITY % SignatureProperty.ANY ''> |
| 882 |
<!ENTITY % KeyInfo.ANY ''> |
| 883 |
<!ENTITY % KeyValue.ANY ''> |
| 884 |
<!ENTITY % PGPData.ANY ''> |
| 885 |
<!ENTITY % X509Data.ANY ''> |
| 886 |
<!ENTITY % SPKIData.ANY ''> |
| 887 |
|
| 888 |
|
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
<span class="grey">Eastlake, et al. Standards Track [Page 16]</span></pre> |
| 893 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span> |
| 894 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 895 |
|
| 896 |
|
| 897 |
<span class="h4"><a class="selflink" id="section-4.0.1" href="#section-4.0.1">4.0.1</a> The ds:CryptoBinary Simple Type</span> |
| 898 |
|
| 899 |
This specification defines the ds:CryptoBinary simple type for |
| 900 |
representing arbitrary-length integers (e.g., "bignums") in XML as |
| 901 |
octet strings. The integer value is first converted to a "big |
| 902 |
endian" bitstring. The bitstring is then padded with leading zero |
| 903 |
bits so that the total number of bits == 0 mod 8 (so that there are |
| 904 |
an integral number of octets). If the bitstring contains entire |
| 905 |
leading octets that are zero, these are removed (so the high-order |
| 906 |
octet is always non-zero). This octet string is then base64 [<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>] |
| 907 |
encoded. (The conversion from integer to octet string is equivalent |
| 908 |
to IEEE 1363's I2OSP [<a href="#ref-1363">1363</a>] with minimal length). |
| 909 |
|
| 910 |
This type is used by "bignum" values such as RSAKeyValue and |
| 911 |
DSAKeyValue. If a value can be of type base64Binary or |
| 912 |
ds:CryptoBinary they are defined as base64Binary. For example, if |
| 913 |
the signature algorithm is RSA or DSA then SignatureValue represents |
| 914 |
a bignum and could be ds:CryptoBinary. However, if HMAC-SHA1 is the |
| 915 |
signature algorithm then SignatureValue could have leading zero |
| 916 |
octets that must be preserved. Thus SignatureValue is generically |
| 917 |
defined as of type base64Binary. |
| 918 |
|
| 919 |
Schema Definition: |
| 920 |
|
| 921 |
<simpleType name="CryptoBinary"> |
| 922 |
<restriction base="base64Binary"> |
| 923 |
</restriction> |
| 924 |
</simpleType> |
| 925 |
|
| 926 |
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a> The Signature element</span> |
| 927 |
|
| 928 |
The Signature element is the root element of an XML Signature. |
| 929 |
Implementation MUST generate laxly schema valid [<a href="#ref-XML-schema" title="N. Mendelsohn">XML-schema</a>] |
| 930 |
Signature elements as specified by the following schema: |
| 931 |
|
| 932 |
Schema Definition: |
| 933 |
|
| 934 |
<element name="Signature" type="ds:SignatureType"/> |
| 935 |
<complexType name="SignatureType"> |
| 936 |
<sequence> |
| 937 |
<element ref="ds:SignedInfo"/> |
| 938 |
<element ref="ds:SignatureValue"/> |
| 939 |
<element ref="ds:KeyInfo" minOccurs="0"/> |
| 940 |
<element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/> |
| 941 |
</sequence> |
| 942 |
<attribute name="Id" type="ID" use="optional"/> |
| 943 |
</complexType> |
| 944 |
|
| 945 |
|
| 946 |
|
| 947 |
|
| 948 |
<span class="grey">Eastlake, et al. Standards Track [Page 17]</span></pre> |
| 949 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span> |
| 950 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 951 |
|
| 952 |
|
| 953 |
DTD: |
| 954 |
|
| 955 |
<!ELEMENT Signature (SignedInfo, SignatureValue, KeyInfo?, |
| 956 |
Object*) > |
| 957 |
<!ATTLIST Signature |
| 958 |
xmlns CDATA #FIXED 'http://www.w3.org/2000/09/xmldsig#' |
| 959 |
Id ID #IMPLIED > |
| 960 |
|
| 961 |
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a> The SignatureValue Element</span> |
| 962 |
|
| 963 |
The SignatureValue element contains the actual value of the digital |
| 964 |
signature; it is always encoded using base64 [<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>]. While we |
| 965 |
identify two SignatureMethod algorithms, one mandatory and one |
| 966 |
optional to implement, user specified algorithms may be used as well. |
| 967 |
|
| 968 |
Schema Definition: |
| 969 |
|
| 970 |
<element name="SignatureValue" type="ds:SignatureValueType"/> |
| 971 |
<complexType name="SignatureValueType"> |
| 972 |
<simpleContent> |
| 973 |
<extension base="base64Binary"> |
| 974 |
<attribute name="Id" type="ID" use="optional"/> |
| 975 |
</extension> |
| 976 |
</simpleContent> |
| 977 |
</complexType> |
| 978 |
|
| 979 |
DTD: |
| 980 |
|
| 981 |
<!ELEMENT SignatureValue (#PCDATA) > |
| 982 |
<!ATTLIST SignatureValue |
| 983 |
Id ID #IMPLIED> |
| 984 |
|
| 985 |
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a> The SignedInfo Element</span> |
| 986 |
|
| 987 |
The structure of SignedInfo includes the canonicalization algorithm, |
| 988 |
a signature algorithm, and one or more references. The SignedInfo |
| 989 |
element may contain an optional ID attribute that will allow it to be |
| 990 |
referenced by other signatures and objects. |
| 991 |
|
| 992 |
SignedInfo does not include explicit signature or digest properties |
| 993 |
(such as calculation time, cryptographic device serial number, etc.). |
| 994 |
If an application needs to associate properties with the signature or |
| 995 |
digest, it may include such information in a SignatureProperties |
| 996 |
element within an Object element. |
| 997 |
|
| 998 |
|
| 999 |
|
| 1000 |
|
| 1001 |
|
| 1002 |
|
| 1003 |
|
| 1004 |
<span class="grey">Eastlake, et al. Standards Track [Page 18]</span></pre> |
| 1005 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span> |
| 1006 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1007 |
|
| 1008 |
|
| 1009 |
Schema Definition: |
| 1010 |
|
| 1011 |
<element name="SignedInfo" type="ds:SignedInfoType"/> |
| 1012 |
<complexType name="SignedInfoType"> |
| 1013 |
<sequence> |
| 1014 |
<element ref="ds:CanonicalizationMethod"/> |
| 1015 |
<element ref="ds:SignatureMethod"/> |
| 1016 |
<element ref="ds:Reference" maxOccurs="unbounded"/> |
| 1017 |
</sequence> |
| 1018 |
<attribute name="Id" type="ID" use="optional"/> |
| 1019 |
</complexType> |
| 1020 |
|
| 1021 |
DTD: |
| 1022 |
|
| 1023 |
<!ELEMENT SignedInfo (CanonicalizationMethod, |
| 1024 |
SignatureMethod, Reference+) > |
| 1025 |
<!ATTLIST SignedInfo |
| 1026 |
Id ID #IMPLIED |
| 1027 |
|
| 1028 |
<span class="h4"><a class="selflink" id="section-4.3.1" href="#section-4.3.1">4.3.1</a> The CanonicalizationMethod Element</span> |
| 1029 |
|
| 1030 |
CanonicalizationMethod is a required element that specifies the |
| 1031 |
canonicalization algorithm applied to the SignedInfo element prior to |
| 1032 |
performing signature calculations. This element uses the general |
| 1033 |
structure for algorithms described in Algorithm Identifiers and |
| 1034 |
Implementation Requirements (<a href="#section-6.1">section 6.1</a>). Implementations MUST |
| 1035 |
support the REQUIRED canonicalization algorithms. |
| 1036 |
|
| 1037 |
Alternatives to the REQUIRED canonicalization algorithms (<a href="#section-6.5">section</a> |
| 1038 |
<a href="#section-6.5">6.5</a>), such as Canonical XML with Comments (<a href="#section-6.5.1">section 6.5.1</a>) or a |
| 1039 |
minimal canonicalization (such as CRLF and charset normalization), |
| 1040 |
may be explicitly specified but are NOT REQUIRED. Consequently, |
| 1041 |
their use may not interoperate with other applications that do not |
| 1042 |
support the specified algorithm (see XML Canonicalization and Syntax |
| 1043 |
Constraint Considerations, <a href="#section-7">section 7</a>). Security issues may also |
| 1044 |
arise in the treatment of entity processing and comments if non-XML |
| 1045 |
aware canonicalization algorithms are not properly constrained (see |
| 1046 |
<a href="#section-8.2">section 8.2</a>: Only What is "Seen" Should be Signed). |
| 1047 |
|
| 1048 |
The way in which the SignedInfo element is presented to the |
| 1049 |
canonicalization method is dependent on that method. The following |
| 1050 |
applies to algorithms which process XML as nodes or characters: |
| 1051 |
|
| 1052 |
* XML based canonicalization implementations MUST be provided |
| 1053 |
with a [<a href="#ref-XPath">XPath</a>] node-set originally formed from the document |
| 1054 |
containing the SignedInfo and currently indicating the |
| 1055 |
SignedInfo, its descendants, and the attribute and namespace |
| 1056 |
nodes of SignedInfo and its descendant elements. |
| 1057 |
|
| 1058 |
|
| 1059 |
|
| 1060 |
<span class="grey">Eastlake, et al. Standards Track [Page 19]</span></pre> |
| 1061 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span> |
| 1062 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1063 |
|
| 1064 |
|
| 1065 |
* Text based canonicalization algorithms (such as CRLF and |
| 1066 |
charset normalization) should be provided with the UTF-8 octets |
| 1067 |
that represent the well-formed SignedInfo element, from the |
| 1068 |
first character to the last character of the XML |
| 1069 |
representation, inclusive. This includes the entire text of |
| 1070 |
the start and end tags of the SignedInfo element as well as all |
| 1071 |
descendant markup and character data (i.e., the text) between |
| 1072 |
those tags. Use of text based canonicalization of SignedInfo |
| 1073 |
is NOT RECOMMENDED. |
| 1074 |
|
| 1075 |
We recommend applications that implement a text-based instead of |
| 1076 |
XML-based canonicalization -- such as resource constrained apps -- |
| 1077 |
generate canonicalized XML as their output serialization so as to |
| 1078 |
mitigate interoperability and security concerns. For instance, such |
| 1079 |
an implementation SHOULD (at least) generate standalone XML instances |
| 1080 |
[<a href="#ref-XML" title=" J. Paoli">XML</a>]. |
| 1081 |
|
| 1082 |
NOTE: The signature application must exercise great care in accepting |
| 1083 |
and executing an arbitrary CanonicalizationMethod. For example, the |
| 1084 |
canonicalization method could rewrite the URIs of the References |
| 1085 |
being validated. Or, the method could massively transform SignedInfo |
| 1086 |
so that validation would always succeed (i.e., converting it to a |
| 1087 |
trivial signature with a known key over trivial data). Since |
| 1088 |
CanonicalizationMethod is inside SignedInfo, in the resulting |
| 1089 |
canonical form it could erase itself from SignedInfo or modify the |
| 1090 |
SignedInfo element so that it appears that a different |
| 1091 |
canonicalization function was used! Thus a Signature which appears to |
| 1092 |
authenticate the desired data with the desired key, DigestMethod, and |
| 1093 |
SignatureMethod, can be meaningless if a capricious |
| 1094 |
CanonicalizationMethod is used. |
| 1095 |
|
| 1096 |
Schema Definition: |
| 1097 |
|
| 1098 |
<element name="CanonicalizationMethod" |
| 1099 |
type="ds:CanonicalizationMethodType"/> |
| 1100 |
<complexType name="CanonicalizationMethodType" mixed="true"> |
| 1101 |
<sequence> |
| 1102 |
<any namespace="##any" minOccurs="0" maxOccurs="unbounded"/> |
| 1103 |
<!-- (0,unbounded) elements from (1,1) namespace --> |
| 1104 |
</sequence> |
| 1105 |
<attribute name="Algorithm" type="anyURI" use="required"/> |
| 1106 |
</complexType> |
| 1107 |
|
| 1108 |
DTD: |
| 1109 |
|
| 1110 |
<!ELEMENT CanonicalizationMethod (#PCDATA %Method.ANY;)* > |
| 1111 |
<!ATTLIST CanonicalizationMethod |
| 1112 |
Algorithm CDATA #REQUIRED > |
| 1113 |
|
| 1114 |
|
| 1115 |
|
| 1116 |
<span class="grey">Eastlake, et al. Standards Track [Page 20]</span></pre> |
| 1117 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span> |
| 1118 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1119 |
|
| 1120 |
|
| 1121 |
<span class="h4"><a class="selflink" id="section-4.3.2" href="#section-4.3.2">4.3.2</a> The SignatureMethod Element</span> |
| 1122 |
|
| 1123 |
SignatureMethod is a required element that specifies the algorithm |
| 1124 |
used for signature generation and validation. This algorithm |
| 1125 |
identifies all cryptographic functions involved in the signature |
| 1126 |
operation (e.g., hashing, public key algorithms, MACs, padding, |
| 1127 |
etc.). This element uses the general structure here for algorithms |
| 1128 |
described in <a href="#section-6.1">section 6.1</a>: Algorithm Identifiers and Implementation |
| 1129 |
Requirements. While there is a single identifier, that identifier |
| 1130 |
may specify a format containing multiple distinct signature values. |
| 1131 |
|
| 1132 |
Schema Definition: |
| 1133 |
|
| 1134 |
<element name="SignatureMethod" type="ds:SignatureMethodType"/> |
| 1135 |
<complexType name="SignatureMethodType" mixed="true"> |
| 1136 |
<sequence> |
| 1137 |
<element name="HMACOutputLength" minOccurs="0" |
| 1138 |
type="ds:HMACOutputLengthType"/> |
| 1139 |
<any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> |
| 1140 |
<!-- (0,unbounded) elements from (1,1) external namespace --> |
| 1141 |
</sequence> |
| 1142 |
<attribute name="Algorithm" type="anyURI" use="required"/> |
| 1143 |
</complexType> |
| 1144 |
|
| 1145 |
DTD: |
| 1146 |
|
| 1147 |
<!ELEMENT SignatureMethod |
| 1148 |
(#PCDATA|HMACOutputLength %Method.ANY;)* > |
| 1149 |
<!ATTLIST SignatureMethod |
| 1150 |
Algorithm CDATA #REQUIRED > |
| 1151 |
|
| 1152 |
<span class="h4"><a class="selflink" id="section-4.3.3" href="#section-4.3.3">4.3.3</a> The Reference Element</span> |
| 1153 |
|
| 1154 |
Reference is an element that may occur one or more times. It |
| 1155 |
specifies a digest algorithm and digest value, and optionally an |
| 1156 |
identifier of the object being signed, the type of the object, and/or |
| 1157 |
a list of transforms to be applied prior to digesting. The |
| 1158 |
identification (URI) and transforms describe how the digested content |
| 1159 |
(i.e., the input to the digest method) was created. The Type |
| 1160 |
attribute facilitates the processing of referenced data. For |
| 1161 |
example, while this specification makes no requirements over external |
| 1162 |
data, an application may wish to signal that the referent is a |
| 1163 |
Manifest. An optional ID attribute permits a Reference to be |
| 1164 |
referenced from elsewhere. |
| 1165 |
|
| 1166 |
|
| 1167 |
|
| 1168 |
|
| 1169 |
|
| 1170 |
|
| 1171 |
|
| 1172 |
<span class="grey">Eastlake, et al. Standards Track [Page 21]</span></pre> |
| 1173 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span> |
| 1174 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1175 |
|
| 1176 |
|
| 1177 |
Schema Definition: |
| 1178 |
|
| 1179 |
<element name="Reference" type="ds:ReferenceType"/> |
| 1180 |
<complexType name="ReferenceType"> |
| 1181 |
<sequence> |
| 1182 |
<element ref="ds:Transforms" minOccurs="0"/> |
| 1183 |
<element ref="ds:DigestMethod"/> |
| 1184 |
<element ref="ds:DigestValue"/> |
| 1185 |
</sequence> |
| 1186 |
<attribute name="Id" type="ID" use="optional"/> |
| 1187 |
<attribute name="URI" type="anyURI" use="optional"/> |
| 1188 |
<attribute name="Type" type="anyURI" use="optional"/> |
| 1189 |
</complexType> |
| 1190 |
|
| 1191 |
DTD: |
| 1192 |
|
| 1193 |
<!ELEMENT Reference (Transforms?, DigestMethod, DigestValue) > |
| 1194 |
<!ATTLIST Reference |
| 1195 |
Id ID #IMPLIED |
| 1196 |
URI CDATA #IMPLIED |
| 1197 |
Type CDATA #IMPLIED> |
| 1198 |
|
| 1199 |
<span class="h5"><a class="selflink" id="section-4.3.3.1" href="#section-4.3.3.1">4.3.3.1</a> The URI Attribute</span> |
| 1200 |
|
| 1201 |
The URI attribute identifies a data object using a URI-Reference, as |
| 1202 |
specified by <a href="./rfc2396">RFC2396</a> [<a href="#ref-URI" title=""Uniform Resource Identifiers (URI): Generic Syntax"">URI</a>]. The set of allowed characters for URI |
| 1203 |
attributes is the same as for XML, namely [<a href="#ref-Unicode">Unicode</a>]. However, some |
| 1204 |
Unicode characters are disallowed from URI references including all |
| 1205 |
non-ASCII characters and the excluded characters listed in <a href="./rfc2396">RFC2396</a> |
| 1206 |
[URI, <a href="#section-2.4">section 2.4</a>]. However, the number sign (#), percent sign (%), |
| 1207 |
and square bracket characters re-allowed in <a href="./rfc2732">RFC 2732</a> [<a href="#ref-URI-Literal" title=""Format for Literal IPv6 Addresses in URL's"">URI-Literal</a>] |
| 1208 |
are permitted. Disallowed characters must be escaped as follows: |
| 1209 |
|
| 1210 |
1. Each disallowed character is converted to [<a href="#ref-UTF-8" title=""UTF-8, a transformation format of ISO 10646"">UTF-8</a>] as one or more |
| 1211 |
octets. |
| 1212 |
2. Any octets corresponding to a disallowed character are escaped |
| 1213 |
with the URI escaping mechanism (that is, converted to %HH, where |
| 1214 |
HH is the hexadecimal notation of the octet value). |
| 1215 |
3. The original character is replaced by the resulting character |
| 1216 |
sequence. |
| 1217 |
|
| 1218 |
XML signature applications MUST be able to parse URI syntax. We |
| 1219 |
RECOMMEND they be able to dereference URIs in the HTTP scheme. |
| 1220 |
Dereferencing a URI in the HTTP scheme MUST comply with the Status |
| 1221 |
Code Definitions of [<a href="#ref-HTTP" title=""Hypertext Transfer Protocol -- HTTP/1.1"">HTTP</a>] (e.g., 302, 305 and 307 redirects are |
| 1222 |
followed to obtain the entity-body of a 200 status code response). |
| 1223 |
Applications should also be cognizant of the fact that protocol |
| 1224 |
|
| 1225 |
|
| 1226 |
|
| 1227 |
|
| 1228 |
<span class="grey">Eastlake, et al. Standards Track [Page 22]</span></pre> |
| 1229 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span> |
| 1230 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1231 |
|
| 1232 |
|
| 1233 |
parameter and state information, (such as HTTP cookies, HTML device |
| 1234 |
profiles or content negotiation), may affect the content yielded by |
| 1235 |
dereferencing a URI. |
| 1236 |
|
| 1237 |
If a resource is identified by more than one URI, the most specific |
| 1238 |
should be used (e.g., <a href="http://www.w3.org/2000/06/interop-pressrelease.html.en">http://www.w3.org/2000/06/interop-</a> |
| 1239 |
<a href="http://www.w3.org/2000/06/interop-pressrelease.html.en">pressrelease.html.en</a> instead of <a href="http://www.w3.org/2000/06/interop-pressrelease">http://www.w3.org/2000/06/interop-</a> |
| 1240 |
<a href="http://www.w3.org/2000/06/interop-pressrelease">pressrelease</a>). (See the Reference Validation (<a href="#section-3.2.1">section 3.2.1</a>) for a |
| 1241 |
further information on reference processing.) |
| 1242 |
|
| 1243 |
If the URI attribute is omitted altogether, the receiving application |
| 1244 |
is expected to know the identity of the object. For example, a |
| 1245 |
lightweight data protocol might omit this attribute given the |
| 1246 |
identity of the object is part of the application context. This |
| 1247 |
attribute may be omitted from at most one Reference in any particular |
| 1248 |
SignedInfo, or Manifest. |
| 1249 |
|
| 1250 |
The optional Type attribute contains information about the type of |
| 1251 |
object being signed. This is represented as a URI. For example: |
| 1252 |
|
| 1253 |
Type="http://www.w3.org/2000/09/xmldsig#Object" |
| 1254 |
Type="http://www.w3.org/2000/09/xmldsig#Manifest" |
| 1255 |
|
| 1256 |
The Type attribute applies to the item being pointed at, not its |
| 1257 |
contents. For example, a reference that identifies an Object element |
| 1258 |
containing a SignatureProperties element is still of type #Object. |
| 1259 |
The type attribute is advisory. No validation of the type |
| 1260 |
information is required by this specification. |
| 1261 |
|
| 1262 |
<span class="h5"><a class="selflink" id="section-4.3.3.2" href="#section-4.3.3.2">4.3.3.2</a> The Reference Processing Model</span> |
| 1263 |
|
| 1264 |
Note: XPath is RECOMMENDED. Signature applications need not conform |
| 1265 |
to [<a href="#ref-XPath">XPath</a>] specification in order to conform to this specification. |
| 1266 |
However, the XPath data model, definitions (e.g., node-sets) and |
| 1267 |
syntax is used within this document in order to describe |
| 1268 |
functionality for those that want to process XML-as-XML (instead of |
| 1269 |
octets) as part of signature generation. For those that want to use |
| 1270 |
these features, a conformant [<a href="#ref-XPath">XPath</a>] implementation is one way to |
| 1271 |
implement these features, but it is not required. Such applications |
| 1272 |
could use a sufficiently functional replacement to a node-set and |
| 1273 |
implement only those XPath expression behaviors REQUIRED by this |
| 1274 |
specification. However, for simplicity we generally will use XPath |
| 1275 |
terminology without including this qualification on every point. |
| 1276 |
Requirements over "XPath node-sets" can include a node-set functional |
| 1277 |
equivalent. Requirements over XPath processing can include |
| 1278 |
application behaviors that are equivalent to the corresponding XPath |
| 1279 |
behavior. |
| 1280 |
|
| 1281 |
|
| 1282 |
|
| 1283 |
|
| 1284 |
<span class="grey">Eastlake, et al. Standards Track [Page 23]</span></pre> |
| 1285 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span> |
| 1286 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1287 |
|
| 1288 |
|
| 1289 |
The data-type of the result of URI dereferencing or subsequent |
| 1290 |
Transforms is either an octet stream or an XPath node-set. |
| 1291 |
|
| 1292 |
The Transforms specified in this document are defined with respect to |
| 1293 |
the input they require. The following is the default signature |
| 1294 |
application behavior: |
| 1295 |
|
| 1296 |
* If the data object is an octet stream and the next transform |
| 1297 |
requires a node-set, the signature application MUST attempt to |
| 1298 |
parse the octets yielding the required node-set via [<a href="#ref-XML" title=" J. Paoli">XML</a>] |
| 1299 |
well-formed processing. |
| 1300 |
* If the data object is a node-set and the next transform |
| 1301 |
requires octets, the signature application MUST attempt to |
| 1302 |
convert the node-set to an octet stream using Canonical XML |
| 1303 |
[<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>]. |
| 1304 |
|
| 1305 |
Users may specify alternative transforms that override these defaults |
| 1306 |
in transitions between transforms that expect different inputs. The |
| 1307 |
final octet stream contains the data octets being secured. The |
| 1308 |
digest algorithm specified by DigestMethod is then applied to these |
| 1309 |
data octets, resulting in the DigestValue. |
| 1310 |
|
| 1311 |
Unless the URI-Reference is a 'same-document' reference as defined in |
| 1312 |
[URI, <a href="#section-4.2">Section 4.2</a>], the result of dereferencing the URI-Reference |
| 1313 |
MUST be an octet stream. In particular, an XML document identified |
| 1314 |
by URI is not parsed by the signature application unless the URI is a |
| 1315 |
same-document reference or unless a transform that requires XML |
| 1316 |
parsing is applied. (See Transforms (<a href="#section-4.3.3.1">section 4.3.3.1</a>).) |
| 1317 |
|
| 1318 |
When a fragment is preceded by an absolute or relative URI in the |
| 1319 |
URI-Reference, the meaning of the fragment is defined by the |
| 1320 |
resource's MIME type. Even for XML documents, URI dereferencing |
| 1321 |
(including the fragment processing) might be done for the signature |
| 1322 |
application by a proxy. Therefore, reference validation might fail |
| 1323 |
if fragment processing is not performed in a standard way (as defined |
| 1324 |
in the following section for same-document references). |
| 1325 |
Consequently, we RECOMMEND that the URI attribute not include |
| 1326 |
fragment identifiers and that such processing be specified as an |
| 1327 |
additional XPath Transform. |
| 1328 |
|
| 1329 |
When a fragment is not preceded by a URI in the URI-Reference, XML |
| 1330 |
signature applications MUST support the null URI and barename |
| 1331 |
XPointer. We RECOMMEND support for the same-document XPointers |
| 1332 |
'#xpointer(/)' and '#xpointer(id('ID'))' if the application also |
| 1333 |
intends to support any canonicalization that preserves comments. |
| 1334 |
(Otherwise URI="#foo" will automatically remove comments before the |
| 1335 |
canonicalization can even be invoked.) All other support for |
| 1336 |
XPointers is OPTIONAL, especially all support for barename and other |
| 1337 |
|
| 1338 |
|
| 1339 |
|
| 1340 |
<span class="grey">Eastlake, et al. Standards Track [Page 24]</span></pre> |
| 1341 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span> |
| 1342 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1343 |
|
| 1344 |
|
| 1345 |
XPointers in external resources since the application may not have |
| 1346 |
control over how the fragment is generated (leading to |
| 1347 |
interoperability problems and validation failures). |
| 1348 |
|
| 1349 |
The following examples demonstrate what the URI attribute identifies |
| 1350 |
and how it is dereferenced: |
| 1351 |
|
| 1352 |
URI="http://example.com/bar.xml" |
| 1353 |
Identifies the octets that represent the external resource |
| 1354 |
'http://example.com/bar.xml', that is probably an XML document |
| 1355 |
given its file extension. |
| 1356 |
URI="http://example.com/bar.xml#chapter1" |
| 1357 |
Identifies the element with ID attribute value 'chapter1' of the |
| 1358 |
external XML resource 'http://example.com/bar.xml', provided as |
| 1359 |
an octet stream. Again, for the sake of interoperability, the |
| 1360 |
element identified as 'chapter1' should be obtained using an |
| 1361 |
XPath transform rather than a URI fragment (barename XPointer |
| 1362 |
resolution in external resources is not REQUIRED in this |
| 1363 |
specification). |
| 1364 |
URI="" |
| 1365 |
Identifies the node-set (minus any comment nodes) of the XML |
| 1366 |
resource containing the signature |
| 1367 |
URI="#chapter1" |
| 1368 |
Identifies a node-set containing the element with ID attribute |
| 1369 |
value 'chapter1' of the XML resource containing the signature. |
| 1370 |
XML Signature (and its applications) modify this node-set to |
| 1371 |
include the element plus all descendents including namespaces and |
| 1372 |
attributes -- but not comments. |
| 1373 |
|
| 1374 |
<span class="h5"><a class="selflink" id="section-4.3.3.3" href="#section-4.3.3.3">4.3.3.3</a> Same-Document URI-References</span> |
| 1375 |
|
| 1376 |
Dereferencing a same-document reference MUST result in an XPath |
| 1377 |
node-set suitable for use by Canonical XML [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>]. Specifically, |
| 1378 |
dereferencing a null URI (URI="") MUST result in an XPath node-set |
| 1379 |
that includes every non-comment node of the XML document containing |
| 1380 |
the URI attribute. In a fragment URI, the characters after the |
| 1381 |
number sign ('#') character conform to the XPointer syntax [Xptr]. |
| 1382 |
When processing an XPointer, the application MUST behave as if the |
| 1383 |
root node of the XML document containing the URI attribute were used |
| 1384 |
to initialize the XPointer evaluation context. The application MUST |
| 1385 |
behave as if the result of XPointer processing were a node-set |
| 1386 |
derived from the resultant location-set as follows: |
| 1387 |
|
| 1388 |
1. discard point nodes |
| 1389 |
2. replace each range node with all XPath nodes having full or |
| 1390 |
partial content within the range |
| 1391 |
3. replace the root node with its children (if it is in the node-set) |
| 1392 |
|
| 1393 |
|
| 1394 |
|
| 1395 |
|
| 1396 |
<span class="grey">Eastlake, et al. Standards Track [Page 25]</span></pre> |
| 1397 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span> |
| 1398 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1399 |
|
| 1400 |
|
| 1401 |
4. replace any element node E with E plus all descendants of E (text, |
| 1402 |
comment, PI, element) and all namespace and attribute nodes of E |
| 1403 |
and its descendant elements. |
| 1404 |
5. if the URI is not a full XPointer, then delete all comment nodes |
| 1405 |
|
| 1406 |
The second to last replacement is necessary because XPointer |
| 1407 |
typically indicates a subtree of an XML document's parse tree using |
| 1408 |
just the element node at the root of the subtree, whereas Canonical |
| 1409 |
XML treats a node-set as a set of nodes in which absence of |
| 1410 |
descendant nodes results in absence of their representative text from |
| 1411 |
the canonical form. |
| 1412 |
|
| 1413 |
The last step is performed for null URIs, barename XPointers and |
| 1414 |
child sequence XPointers. It's necessary because when [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>] is |
| 1415 |
passed a node-set, it processes the node-set as is: with or without |
| 1416 |
comments. Only when it's called with an octet stream does it invoke |
| 1417 |
its own XPath expressions (default or without comments). Therefore |
| 1418 |
to retain the default behavior of stripping comments when passed a |
| 1419 |
node-set, they are removed in the last step if the URI is not a full |
| 1420 |
XPointer. To retain comments while selecting an element by an |
| 1421 |
identifier ID, use the following full XPointer: |
| 1422 |
URI='#xpointer(id('ID'))'. To retain comments while selecting the |
| 1423 |
entire document, use the following full XPointer: URI='#xpointer(/)'. |
| 1424 |
This XPointer contains a simple XPath expression that includes the |
| 1425 |
root node, which the second to last step above replaces with all |
| 1426 |
nodes of the parse tree (all descendants, plus all attributes, plus |
| 1427 |
all namespaces nodes). |
| 1428 |
|
| 1429 |
<span class="h5"><a class="selflink" id="section-4.3.3.4" href="#section-4.3.3.4">4.3.3.4</a> The Transforms Element</span> |
| 1430 |
|
| 1431 |
The optional Transforms element contains an ordered list of Transform |
| 1432 |
elements; these describe how the signer obtained the data object that |
| 1433 |
was digested. The output of each Transform serves as input to the |
| 1434 |
next Transform. The input to the first Transform is the result of |
| 1435 |
dereferencing the URI attribute of the Reference element. The output |
| 1436 |
from the last Transform is the input for the DigestMethod algorithm. |
| 1437 |
When transforms are applied the signer is not signing the native |
| 1438 |
(original) document but the resulting (transformed) document. (See |
| 1439 |
Only What is Signed is Secure (<a href="#section-8.1">section 8.1</a>).) |
| 1440 |
|
| 1441 |
Each Transform consists of an Algorithm attribute and content |
| 1442 |
parameters, if any, appropriate for the given algorithm. The |
| 1443 |
Algorithm attribute value specifies the name of the algorithm to be |
| 1444 |
performed, and the Transform content provides additional data to |
| 1445 |
govern the algorithm's processing of the transform input. (See |
| 1446 |
Algorithm Identifiers and Implementation Requirements (<a href="#section-6">section 6</a>).) |
| 1447 |
|
| 1448 |
|
| 1449 |
|
| 1450 |
|
| 1451 |
|
| 1452 |
<span class="grey">Eastlake, et al. Standards Track [Page 26]</span></pre> |
| 1453 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span> |
| 1454 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1455 |
|
| 1456 |
|
| 1457 |
As described in The Reference Processing Model (section 4.3.3.2), |
| 1458 |
some transforms take an XPath node-set as input, while others require |
| 1459 |
an octet stream. If the actual input matches the input needs of the |
| 1460 |
transform, then the transform operates on the unaltered input. If |
| 1461 |
the transform input requirement differs from the format of the actual |
| 1462 |
input, then the input must be converted. |
| 1463 |
|
| 1464 |
Some Transforms may require explicit MIME type, charset (IANA |
| 1465 |
registered "character set"), or other such information concerning the |
| 1466 |
data they are receiving from an earlier Transform or the source data, |
| 1467 |
although no Transform algorithm specified in this document needs such |
| 1468 |
explicit information. Such data characteristics are provided as |
| 1469 |
parameters to the Transform algorithm and should be described in the |
| 1470 |
specification for the algorithm. |
| 1471 |
|
| 1472 |
Examples of transforms include but are not limited to base64 decoding |
| 1473 |
[<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>], canonicalization [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>], XPath filtering [<a href="#ref-XPath">XPath</a>], and |
| 1474 |
XSLT [<a href="#ref-XSLT">XSLT</a>]. The generic definition of the Transform element also |
| 1475 |
allows application-specific transform algorithms. For example, the |
| 1476 |
transform could be a decompression routine given by a Java class |
| 1477 |
appearing as a base64 encoded parameter to a Java Transform |
| 1478 |
algorithm. However, applications should refrain from using |
| 1479 |
application-specific transforms if they wish their signatures to be |
| 1480 |
verifiable outside of their application domain. Transform Algorithms |
| 1481 |
(<a href="#section-6.6">section 6.6</a>) define the list of standard transformations. |
| 1482 |
|
| 1483 |
Schema Definition: |
| 1484 |
|
| 1485 |
<element name="Transforms" type="ds:TransformsType"/> |
| 1486 |
<complexType name="TransformsType"> |
| 1487 |
<sequence> |
| 1488 |
<element ref="ds:Transform" maxOccurs="unbounded"/> |
| 1489 |
</sequence> |
| 1490 |
</complexType> |
| 1491 |
|
| 1492 |
<element name="Transform" type="ds:TransformType"/> |
| 1493 |
<complexType name="TransformType" mixed="true"> |
| 1494 |
<choice minOccurs="0" maxOccurs="unbounded"> |
| 1495 |
<any namespace="##other" processContents="lax"/> |
| 1496 |
<!-- (1,1) elements from (0,unbounded) namespaces --> |
| 1497 |
<element name="XPath" type="string"/> |
| 1498 |
</choice> |
| 1499 |
<attribute name="Algorithm" type="anyURI" use="required"/> |
| 1500 |
</complexType> |
| 1501 |
|
| 1502 |
|
| 1503 |
|
| 1504 |
|
| 1505 |
|
| 1506 |
|
| 1507 |
|
| 1508 |
<span class="grey">Eastlake, et al. Standards Track [Page 27]</span></pre> |
| 1509 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span> |
| 1510 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1511 |
|
| 1512 |
|
| 1513 |
DTD: |
| 1514 |
|
| 1515 |
<!ELEMENT Transforms (Transform+)> |
| 1516 |
|
| 1517 |
<!ELEMENT Transform (#PCDATA|XPath %Transform.ANY;)* > |
| 1518 |
<!ATTLIST Transform |
| 1519 |
Algorithm CDATA #REQUIRED > |
| 1520 |
|
| 1521 |
<!ELEMENT XPath (#PCDATA) > |
| 1522 |
|
| 1523 |
<span class="h5"><a class="selflink" id="section-4.3.3.5" href="#section-4.3.3.5">4.3.3.5</a> The DigestMethod Element</span> |
| 1524 |
|
| 1525 |
DigestMethod is a required element that identifies the digest |
| 1526 |
algorithm to be applied to the signed object. This element uses the |
| 1527 |
general structure here for algorithms specified in Algorithm |
| 1528 |
Identifiers and Implementation Requirements (<a href="#section-6.1">section 6.1</a>). |
| 1529 |
|
| 1530 |
If the result of the URI dereference and application of Transforms is |
| 1531 |
an XPath node-set (or sufficiently functional replacement implemented |
| 1532 |
by the application) then it must be converted as described in the |
| 1533 |
Reference Processing Model (section 4.3.3.2). If the result of URI |
| 1534 |
dereference and application of transforms is an octet stream, then no |
| 1535 |
conversion occurs (comments might be present if the Canonical XML |
| 1536 |
with Comments was specified in the Transforms). The digest algorithm |
| 1537 |
is applied to the data octets of the resulting octet stream. |
| 1538 |
|
| 1539 |
Schema Definition: |
| 1540 |
|
| 1541 |
<element name="DigestMethod" type="ds:DigestMethodType"/> |
| 1542 |
<complexType name="DigestMethodType" mixed="true"> |
| 1543 |
<sequence> |
| 1544 |
<any namespace="##other" processContents="lax" |
| 1545 |
minOccurs="0" maxOccurs="unbounded"/> |
| 1546 |
</sequence> |
| 1547 |
<attribute name="Algorithm" type="anyURI" use="required"/> |
| 1548 |
</complexType> |
| 1549 |
|
| 1550 |
DTD: |
| 1551 |
|
| 1552 |
<!ELEMENT DigestMethod (#PCDATA %Method.ANY;)* > |
| 1553 |
<!ATTLIST DigestMethod |
| 1554 |
Algorithm CDATA #REQUIRED > |
| 1555 |
|
| 1556 |
<span class="h5"><a class="selflink" id="section-4.3.3.6" href="#section-4.3.3.6">4.3.3.6</a> The DigestValue Element</span> |
| 1557 |
|
| 1558 |
DigestValue is an element that contains the encoded value of the |
| 1559 |
digest. The digest is always encoded using base64 [<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>]. |
| 1560 |
|
| 1561 |
|
| 1562 |
|
| 1563 |
|
| 1564 |
<span class="grey">Eastlake, et al. Standards Track [Page 28]</span></pre> |
| 1565 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span> |
| 1566 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1567 |
|
| 1568 |
|
| 1569 |
Schema Definition: |
| 1570 |
|
| 1571 |
<element name="DigestValue" type="ds:DigestValueType"/> |
| 1572 |
<simpleType name="DigestValueType"> |
| 1573 |
<restriction base="base64Binary"/> |
| 1574 |
</simpleType> |
| 1575 |
|
| 1576 |
DTD: |
| 1577 |
|
| 1578 |
<!ELEMENT DigestValue (#PCDATA) > |
| 1579 |
<!-- base64 encoded digest value --> |
| 1580 |
|
| 1581 |
<span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a> The KeyInfo Element</span> |
| 1582 |
|
| 1583 |
KeyInfo is an optional element that enables the recipient(s) to |
| 1584 |
obtain the key needed to validate the signature. KeyInfo may contain |
| 1585 |
keys, names, certificates and other public key management |
| 1586 |
information, such as in-band key distribution or key agreement data. |
| 1587 |
This specification defines a few simple types but applications may |
| 1588 |
extend those types or all together replace them with their own key |
| 1589 |
identification and exchange semantics using the XML namespace |
| 1590 |
facility. [<a href="#ref-XML-ns" title="D. Hollander">XML-ns</a>] However, questions of trust of such key |
| 1591 |
information (e.g., its authenticity or strength) are out of scope of |
| 1592 |
this specification and left to the application. |
| 1593 |
|
| 1594 |
If KeyInfo is omitted, the recipient is expected to be able to |
| 1595 |
identify the key based on application context. Multiple declarations |
| 1596 |
within KeyInfo refer to the same key. While applications may define |
| 1597 |
and use any mechanism they choose through inclusion of elements from |
| 1598 |
a different namespace, compliant versions MUST implement KeyValue |
| 1599 |
(<a href="#section-4.4.2">section 4.4.2</a>) and SHOULD implement RetrievalMethod (<a href="#section-4.4.3">section 4.4.3</a>). |
| 1600 |
|
| 1601 |
The schema/DTD specifications of many of KeyInfo's children (e.g., |
| 1602 |
PGPData, SPKIData, X509Data) permit their content to be |
| 1603 |
extended/complemented with elements from another namespace. This may |
| 1604 |
be done only if it is safe to ignore these extension elements while |
| 1605 |
claiming support for the types defined in this specification. |
| 1606 |
Otherwise, external elements, including alternative structures to |
| 1607 |
those defined by this specification, MUST be a child of KeyInfo. For |
| 1608 |
example, should a complete XML-PGP standard be defined, its root |
| 1609 |
element MUST be a child of KeyInfo. (Of course, new structures from |
| 1610 |
external namespaces can incorporate elements from the &dsig; |
| 1611 |
namespace via features of the type definition language. For |
| 1612 |
instance, they can create a DTD that mixes their own and dsig |
| 1613 |
qualified elements, or a schema that permits, includes, imports, or |
| 1614 |
derives new types based on &dsig; elements.) |
| 1615 |
|
| 1616 |
|
| 1617 |
|
| 1618 |
|
| 1619 |
|
| 1620 |
<span class="grey">Eastlake, et al. Standards Track [Page 29]</span></pre> |
| 1621 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span> |
| 1622 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1623 |
|
| 1624 |
|
| 1625 |
The following list summarizes the KeyInfo types that are allocated to |
| 1626 |
an identifier in the &dsig; namespace; these can be used within the |
| 1627 |
RetrievalMethod Type attribute to describe a remote KeyInfo |
| 1628 |
structure. |
| 1629 |
|
| 1630 |
* <a href="http://www.w3.org/2000/09/xmldsig#DSAKeyValue">http://www.w3.org/2000/09/xmldsig#DSAKeyValue</a> |
| 1631 |
* <a href="http://www.w3.org/2000/09/xmldsig#RSAKeyValue">http://www.w3.org/2000/09/xmldsig#RSAKeyValue</a> |
| 1632 |
* <a href="http://www.w3.org/2000/09/xmldsig#X509Data">http://www.w3.org/2000/09/xmldsig#X509Data</a> |
| 1633 |
* <a href="http://www.w3.org/2000/09/xmldsig#PGPData">http://www.w3.org/2000/09/xmldsig#PGPData</a> |
| 1634 |
* <a href="http://www.w3.org/2000/09/xmldsig#SPKIData">http://www.w3.org/2000/09/xmldsig#SPKIData</a> |
| 1635 |
* <a href="http://www.w3.org/2000/09/xmldsig#MgmtData">http://www.w3.org/2000/09/xmldsig#MgmtData</a> |
| 1636 |
|
| 1637 |
In addition to the types above for which we define an XML structure, |
| 1638 |
we specify one additional type to indicate a binary (ASN.1 DER) X.509 |
| 1639 |
Certificate. |
| 1640 |
|
| 1641 |
* <a href="http://www.w3.org/2000/09/xmldsig#rawX509Certificate">http://www.w3.org/2000/09/xmldsig#rawX509Certificate</a> |
| 1642 |
|
| 1643 |
Schema Definition: |
| 1644 |
|
| 1645 |
<element name="KeyInfo" type="ds:KeyInfoType"/> |
| 1646 |
<complexType name="KeyInfoType" mixed="true"> |
| 1647 |
<choice maxOccurs="unbounded"> |
| 1648 |
<element ref="ds:KeyName"/> |
| 1649 |
<element ref="ds:KeyValue"/> |
| 1650 |
<element ref="ds:RetrievalMethod"/> |
| 1651 |
<element ref="ds:X509Data"/> |
| 1652 |
<element ref="ds:PGPData"/> |
| 1653 |
<element ref="ds:SPKIData"/> |
| 1654 |
<element ref="ds:MgmtData"/> |
| 1655 |
<any processContents="lax" namespace="##other"/> |
| 1656 |
<!-- (1,1) elements from (0,unbounded) namespaces --> |
| 1657 |
</choice> |
| 1658 |
<attribute name="Id" type="ID" use="optional"/> |
| 1659 |
</complexType> |
| 1660 |
|
| 1661 |
DTD: |
| 1662 |
|
| 1663 |
<!ELEMENT KeyInfo (#PCDATA|KeyName|KeyValue|RetrievalMethod| |
| 1664 |
X509Data|PGPData|SPKIData|MgmtData %KeyInfo.ANY;)* > |
| 1665 |
<!ATTLIST KeyInfo |
| 1666 |
Id ID #IMPLIED > |
| 1667 |
|
| 1668 |
|
| 1669 |
|
| 1670 |
|
| 1671 |
|
| 1672 |
|
| 1673 |
|
| 1674 |
|
| 1675 |
|
| 1676 |
<span class="grey">Eastlake, et al. Standards Track [Page 30]</span></pre> |
| 1677 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span> |
| 1678 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1679 |
|
| 1680 |
|
| 1681 |
<span class="h4"><a class="selflink" id="section-4.4.1" href="#section-4.4.1">4.4.1</a> The KeyName Element</span> |
| 1682 |
|
| 1683 |
The KeyName element contains a string value (in which white space is |
| 1684 |
significant) which may be used by the signer to communicate a key |
| 1685 |
identifier to the recipient. Typically, KeyName contains an |
| 1686 |
identifier related to the key pair used to sign the message, but it |
| 1687 |
may contain other protocol-related information that indirectly |
| 1688 |
identifies a key pair. (Common uses of KeyName include simple string |
| 1689 |
names for keys, a key index, a distinguished name (DN), an email |
| 1690 |
address, etc.) |
| 1691 |
|
| 1692 |
Schema Definition: |
| 1693 |
|
| 1694 |
<element name="KeyName" type="string"/> |
| 1695 |
|
| 1696 |
DTD: |
| 1697 |
|
| 1698 |
<!ELEMENT KeyName (#PCDATA) > |
| 1699 |
|
| 1700 |
<span class="h4"><a class="selflink" id="section-4.4.2" href="#section-4.4.2">4.4.2</a> The KeyValue Element</span> |
| 1701 |
|
| 1702 |
The KeyValue element contains a single public key that may be useful |
| 1703 |
in validating the signature. Structured formats for defining DSA |
| 1704 |
(REQUIRED) and RSA (RECOMMENDED) public keys are defined in Signature |
| 1705 |
Algorithms (<a href="#section-6.4">section 6.4</a>). The KeyValue element may include |
| 1706 |
externally defined public key values represented as PCDATA or element |
| 1707 |
types from an external namespace. |
| 1708 |
|
| 1709 |
Schema Definition: |
| 1710 |
|
| 1711 |
<element name="KeyValue" type="ds:KeyValueType"/> |
| 1712 |
<complexType name="KeyValueType" mixed="true"> |
| 1713 |
<choice> |
| 1714 |
<element ref="ds:DSAKeyValue"/> |
| 1715 |
<element ref="ds:RSAKeyValue"/> |
| 1716 |
<any namespace="##other" processContents="lax"/> |
| 1717 |
</choice> |
| 1718 |
</complexType> |
| 1719 |
|
| 1720 |
DTD: |
| 1721 |
|
| 1722 |
<!ELEMENT KeyValue (#PCDATA|DSAKeyValue|RSAKeyValue |
| 1723 |
%KeyValue.ANY;)* > |
| 1724 |
|
| 1725 |
|
| 1726 |
|
| 1727 |
|
| 1728 |
|
| 1729 |
|
| 1730 |
|
| 1731 |
|
| 1732 |
<span class="grey">Eastlake, et al. Standards Track [Page 31]</span></pre> |
| 1733 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span> |
| 1734 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1735 |
|
| 1736 |
|
| 1737 |
<span class="h5"><a class="selflink" id="section-4.4.2.1" href="#section-4.4.2.1">4.4.2.1</a> The DSAKeyValue Element</span> |
| 1738 |
|
| 1739 |
Identifier |
| 1740 |
Type="http://www.w3.org/2000/09/xmldsig#DSAKeyValue" (this can be |
| 1741 |
used within a RetrievalMethod or Reference element to identify the |
| 1742 |
referent's type) |
| 1743 |
|
| 1744 |
DSA keys and the DSA signature algorithm are specified in [<a href="#ref-DSS">DSS</a>]. DSA |
| 1745 |
public key values can have the following fields: |
| 1746 |
|
| 1747 |
P |
| 1748 |
a prime modulus meeting the [<a href="#ref-DSS">DSS</a>] requirements |
| 1749 |
Q |
| 1750 |
an integer in the range 2**159 < Q < 2**160 which is a prime |
| 1751 |
divisor of P-1 |
| 1752 |
G |
| 1753 |
an integer with certain properties with respect to P and Q |
| 1754 |
Y |
| 1755 |
G**X mod P (where X is part of the private key and not made |
| 1756 |
public) |
| 1757 |
J |
| 1758 |
(P - 1) / Q |
| 1759 |
seed |
| 1760 |
a DSA prime generation seed |
| 1761 |
pgenCounter |
| 1762 |
a DSA prime generation counter |
| 1763 |
|
| 1764 |
Parameter J is available for inclusion solely for efficiency as it is |
| 1765 |
calculatable from P and Q. Parameters seed and pgenCounter are used |
| 1766 |
in the DSA prime number generation algorithm specified in [<a href="#ref-DSS">DSS</a>]. As |
| 1767 |
such, they are optional, but must either both be present or both be |
| 1768 |
absent. This prime generation algorithm is designed to provide |
| 1769 |
assurance that a weak prime is not being used and it yields a P and Q |
| 1770 |
value. Parameters P, Q, and G can be public and common to a group of |
| 1771 |
users. They might be known from application context. As such, they |
| 1772 |
are optional but P and Q must either both appear or both be absent. |
| 1773 |
If all of P, Q, seed, and pgenCounter are present, implementations |
| 1774 |
are not required to check if they are consistent and are free to use |
| 1775 |
either P and Q or seed and pgenCounter. All parameters are encoded |
| 1776 |
as base64 [<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>] values. |
| 1777 |
|
| 1778 |
Arbitrary-length integers (e.g., "bignums" such as RSA moduli) are |
| 1779 |
represented in XML as octet strings as defined by the ds:CryptoBinary |
| 1780 |
type. |
| 1781 |
|
| 1782 |
|
| 1783 |
|
| 1784 |
|
| 1785 |
|
| 1786 |
|
| 1787 |
|
| 1788 |
<span class="grey">Eastlake, et al. Standards Track [Page 32]</span></pre> |
| 1789 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span> |
| 1790 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1791 |
|
| 1792 |
|
| 1793 |
Schema Definition: |
| 1794 |
|
| 1795 |
<element name="DSAKeyValue" type="ds:DSAKeyValueType"/> |
| 1796 |
<complexType name="DSAKeyValueType"> |
| 1797 |
<sequence> |
| 1798 |
<sequence minOccurs="0"> |
| 1799 |
<element name="P" type="ds:CryptoBinary"/> |
| 1800 |
<element name="Q" type="ds:CryptoBinary"/> |
| 1801 |
</sequence> |
| 1802 |
<element name="G" type="ds:CryptoBinary" minOccurs="0"/> |
| 1803 |
<element name="Y" type="ds:CryptoBinary"/> |
| 1804 |
<element name="J" type="ds:CryptoBinary" minOccurs="0"/> |
| 1805 |
<sequence minOccurs="0"> |
| 1806 |
<element name="Seed" type="ds:CryptoBinary"/> |
| 1807 |
<element name="PgenCounter" type="ds:CryptoBinary"/> |
| 1808 |
</sequence> |
| 1809 |
</sequence> |
| 1810 |
</complexType> |
| 1811 |
|
| 1812 |
DTD Definition: |
| 1813 |
|
| 1814 |
<!ELEMENT DSAKeyValue ((P, Q)?, G?, Y, J?, (Seed, PgenCounter)?) > |
| 1815 |
<!ELEMENT P (#PCDATA) > |
| 1816 |
<!ELEMENT Q (#PCDATA) > |
| 1817 |
<!ELEMENT G (#PCDATA) > |
| 1818 |
<!ELEMENT Y (#PCDATA) > |
| 1819 |
<!ELEMENT J (#PCDATA) > |
| 1820 |
<!ELEMENT Seed (#PCDATA) > |
| 1821 |
<!ELEMENT PgenCounter (#PCDATA) > |
| 1822 |
|
| 1823 |
<span class="h5"><a class="selflink" id="section-4.4.2.2" href="#section-4.4.2.2">4.4.2.2</a> The RSAKeyValue Element</span> |
| 1824 |
|
| 1825 |
Identifier |
| 1826 |
Type="http://www.w3.org/2000/09/xmldsig#RSAKeyValue" (this can be |
| 1827 |
used within a RetrievalMethod or Reference element to identify the |
| 1828 |
referent's type) |
| 1829 |
|
| 1830 |
RSA key values have two fields: Modulus and Exponent. |
| 1831 |
|
| 1832 |
<RSAKeyValue> |
| 1833 |
<Modulus> |
| 1834 |
xA7SEU+e0yQH5rm9kbCDN9o3aPIo7HbP7tX6WOocLZAtNfyxSZDU16ksL6W |
| 1835 |
jubafOqNEpcwR3RdFsT7bCqnXPBe5ELh5u4VEy19MzxkXRgrMvavzyBpVRg |
| 1836 |
BUwUlV5foK5hhmbktQhyNdy/6LpQRhDUDsTvK+g9Ucj47es9AQJ3U= |
| 1837 |
</Modulus> |
| 1838 |
<Exponent>AQAB</Exponent> |
| 1839 |
</RSAKeyValue> |
| 1840 |
|
| 1841 |
|
| 1842 |
|
| 1843 |
|
| 1844 |
<span class="grey">Eastlake, et al. Standards Track [Page 33]</span></pre> |
| 1845 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span> |
| 1846 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1847 |
|
| 1848 |
|
| 1849 |
Arbitrary-length integers (e.g., "bignums" such as RSA moduli) are |
| 1850 |
represented in XML as octet strings as defined by the ds:CryptoBinary |
| 1851 |
type. |
| 1852 |
|
| 1853 |
Schema Definition: |
| 1854 |
|
| 1855 |
<element name="RSAKeyValue" type="ds:RSAKeyValueType"/> |
| 1856 |
<complexType name="RSAKeyValueType"> |
| 1857 |
<sequence> |
| 1858 |
<element name="Modulus" type="ds:CryptoBinary"/> |
| 1859 |
<element name="Exponent" type="ds:CryptoBinary"/> |
| 1860 |
</sequence> |
| 1861 |
</complexType> |
| 1862 |
|
| 1863 |
DTD Definition: |
| 1864 |
|
| 1865 |
<!ELEMENT RSAKeyValue (Modulus, Exponent) > |
| 1866 |
<!ELEMENT Modulus (#PCDATA) > |
| 1867 |
<!ELEMENT Exponent (#PCDATA) > |
| 1868 |
|
| 1869 |
<span class="h4"><a class="selflink" id="section-4.4.3" href="#section-4.4.3">4.4.3</a> The RetrievalMethod Element</span> |
| 1870 |
|
| 1871 |
A RetrievalMethod element within KeyInfo is used to convey a |
| 1872 |
reference to KeyInfo information that is stored at another location. |
| 1873 |
For example, several signatures in a document might use a key |
| 1874 |
verified by an X.509v3 certificate chain appearing once in the |
| 1875 |
document or remotely outside the document; each signature's KeyInfo |
| 1876 |
can reference this chain using a single RetrievalMethod element |
| 1877 |
instead of including the entire chain with a sequence of |
| 1878 |
X509Certificate elements. |
| 1879 |
|
| 1880 |
RetrievalMethod uses the same syntax and dereferencing behavior as |
| 1881 |
Reference's URI (<a href="#section-4.3.3.1">section 4.3.3.1</a>) and the Reference Processing Model |
| 1882 |
(<a href="#section-4.3.3.2">section 4.3.3.2</a>) except that there is no DigestMethod or DigestValue |
| 1883 |
child elements and presence of the URI is mandatory. |
| 1884 |
|
| 1885 |
Type is an optional identifier for the type of data to be retrieved. |
| 1886 |
The result of dereferencing a RetrievalMethod Reference for all |
| 1887 |
KeyInfo types defined by this specification (<a href="#section-4.4">section 4.4</a>) with a |
| 1888 |
corresponding XML structure is an XML element or document with that |
| 1889 |
element as the root. The rawX509Certificate KeyInfo (for which there |
| 1890 |
is no XML structure) returns a binary X509 certificate. |
| 1891 |
|
| 1892 |
|
| 1893 |
|
| 1894 |
|
| 1895 |
|
| 1896 |
|
| 1897 |
|
| 1898 |
|
| 1899 |
|
| 1900 |
<span class="grey">Eastlake, et al. Standards Track [Page 34]</span></pre> |
| 1901 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span> |
| 1902 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1903 |
|
| 1904 |
|
| 1905 |
Schema Definition: |
| 1906 |
|
| 1907 |
<element name="RetrievalMethod" type="ds:RetrievalMethodType"/> |
| 1908 |
<complexType name="RetrievalMethodType"> |
| 1909 |
<sequence> |
| 1910 |
<element ref="ds:Transforms" minOccurs="0"/> |
| 1911 |
</sequence> |
| 1912 |
<attribute name="URI" type="anyURI"/> |
| 1913 |
<attribute name="Type" type="anyURI" use="optional"/> |
| 1914 |
</complexType> |
| 1915 |
|
| 1916 |
DTD: |
| 1917 |
|
| 1918 |
<!ELEMENT RetrievalMethod (Transforms?) > |
| 1919 |
<!ATTLIST RetrievalMethod |
| 1920 |
URI CDATA #REQUIRED |
| 1921 |
Type CDATA #IMPLIED > |
| 1922 |
|
| 1923 |
<span class="h4"><a class="selflink" id="section-4.4.4" href="#section-4.4.4">4.4.4</a> The X509Data Element</span> |
| 1924 |
|
| 1925 |
Identifier |
| 1926 |
Type="http://www.w3.org/2000/09/xmldsig#X509Data" (this can be |
| 1927 |
used within a RetrievalMethod or Reference element to identify the |
| 1928 |
referent's type) |
| 1929 |
|
| 1930 |
An X509Data element within KeyInfo contains one or more identifiers |
| 1931 |
of keys or X509 certificates (or certificates' identifiers or a |
| 1932 |
revocation list). The content of X509Data is: |
| 1933 |
|
| 1934 |
1. At least one element, from the following set of element types; any |
| 1935 |
of these may appear together or more than once if (if and only if) |
| 1936 |
each instance describes or is related to the same certificate: |
| 1937 |
2. |
| 1938 |
o The X509IssuerSerial element, which contains an X.509 issuer |
| 1939 |
distinguished name/serial number pair that SHOULD be compliant |
| 1940 |
with <a href="./rfc2253">RFC 2253</a> [<a href="#ref-LDAP-DN" title=""Lightweight Directory Access Protocol (v3): UTF-8 String Representation of Distinguished Names"">LDAP-DN</a>], |
| 1941 |
o The X509SubjectName element, which contains an X.509 subject |
| 1942 |
distinguished name that SHOULD be compliant with <a href="./rfc2253">RFC 2253</a> |
| 1943 |
[<a href="#ref-LDAP-DN" title=""Lightweight Directory Access Protocol (v3): UTF-8 String Representation of Distinguished Names"">LDAP-DN</a>], |
| 1944 |
o The X509SKI element, which contains the base64 encoded plain |
| 1945 |
(i.e., non-DER-encoded) value of a X509 V.3 |
| 1946 |
SubjectKeyIdentifier extension. |
| 1947 |
o The X509Certificate element, which contains a base64-encoded |
| 1948 |
[<a href="#ref-X509v3" title=""Information Technology - Open Systems Interconnection - The Directory Authentication Framework"">X509v3</a>] certificate, and |
| 1949 |
o Elements from an external namespace which |
| 1950 |
accompanies/complements any of the elements above. |
| 1951 |
o The X509CRL element, which contains a base64-encoded |
| 1952 |
certificate revocation list (CRL) [<a href="#ref-X509v3" title=""Information Technology - Open Systems Interconnection - The Directory Authentication Framework"">X509v3</a>]. |
| 1953 |
|
| 1954 |
|
| 1955 |
|
| 1956 |
<span class="grey">Eastlake, et al. Standards Track [Page 35]</span></pre> |
| 1957 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span> |
| 1958 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 1959 |
|
| 1960 |
|
| 1961 |
Any X509IssuerSerial, X509SKI, and X509SubjectName elements that |
| 1962 |
appear MUST refer to the certificate or certificates containing the |
| 1963 |
validation key. All such elements that refer to a particular |
| 1964 |
individual certificate MUST be grouped inside a single X509Data |
| 1965 |
element and if the certificate to which they refer appears, it MUST |
| 1966 |
also be in that X509Data element. |
| 1967 |
|
| 1968 |
Any X509IssuerSerial, X509SKI, and X509SubjectName elements that |
| 1969 |
relate to the same key but different certificates MUST be grouped |
| 1970 |
within a single KeyInfo but MAY occur in multiple X509Data elements. |
| 1971 |
|
| 1972 |
All certificates appearing in an X509Data element MUST relate to the |
| 1973 |
validation key by either containing it or being part of a |
| 1974 |
certification chain that terminates in a certificate containing the |
| 1975 |
validation key. |
| 1976 |
|
| 1977 |
No ordering is implied by the above constraints. The comments in the |
| 1978 |
following instance demonstrate these constraints: |
| 1979 |
|
| 1980 |
<KeyInfo> |
| 1981 |
<X509Data> <!-- two pointers to certificate-A --> |
| 1982 |
<X509IssuerSerial> |
| 1983 |
<X509IssuerName>CN=TAMURA Kent, OU=TRL, O=IBM, |
| 1984 |
L=Yamato-shi, ST=Kanagawa, C=JP</X509IssuerName> |
| 1985 |
<X509SerialNumber>12345678</X509SerialNumber> |
| 1986 |
</X509IssuerSerial> |
| 1987 |
<X509SKI>31d97bd7</X509SKI> |
| 1988 |
</X509Data> |
| 1989 |
<X509Data><!-- single pointer to certificate-B --> |
| 1990 |
<X509SubjectName>Subject of Certificate B</X509SubjectName> |
| 1991 |
</X509Data> |
| 1992 |
<X509Data> <!-- certificate chain --> |
| 1993 |
<!--Signer cert, issuer CN=arbolCA,OU=FVT,O=IBM,C=US, serial 4--> |
| 1994 |
<X509Certificate>MIICXTCCA..</X509Certificate> |
| 1995 |
<!-- Intermediate cert subject CN=arbolCA,OU=FVT,O=IBM,C=US |
| 1996 |
issuer CN=tootiseCA,OU=FVT,O=Bridgepoint,C=US --> |
| 1997 |
<X509Certificate>MIICPzCCA...</X509Certificate> |
| 1998 |
<!-- Root cert subject CN=tootiseCA,OU=FVT,O=Bridgepoint,C=US --> |
| 1999 |
<X509Certificate>MIICSTCCA...</X509Certificate> |
| 2000 |
</X509Data> |
| 2001 |
</KeyInfo> |
| 2002 |
|
| 2003 |
Note, there is no direct provision for a PKCS#7 encoded "bag" of |
| 2004 |
certificates or CRLs. However, a set of certificates and CRLs can |
| 2005 |
occur within an X509Data element and multiple X509Data elements can |
| 2006 |
occur in a KeyInfo. Whenever multiple certificates occur in an |
| 2007 |
X509Data element, at least one such certificate must contain the |
| 2008 |
public key which verifies the signature. |
| 2009 |
|
| 2010 |
|
| 2011 |
|
| 2012 |
<span class="grey">Eastlake, et al. Standards Track [Page 36]</span></pre> |
| 2013 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span> |
| 2014 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2015 |
|
| 2016 |
|
| 2017 |
Also, strings in DNames (X509IssuerSerial,X509SubjectName, and |
| 2018 |
KeyNameif appropriate) should be encoded as follows: |
| 2019 |
|
| 2020 |
* Consider the string as consisting of Unicode characters. |
| 2021 |
* Escape occurrences of the following special characters by |
| 2022 |
prefixing it with the "\" character: a "#" character occurring |
| 2023 |
at the beginning of the string or one of the characters ",", |
| 2024 |
"+", """, "\", "<", ">" or ";" |
| 2025 |
* Escape all occurrences of ASCII control characters (Unicode |
| 2026 |
range \x00 - \x 1f) by replacing them with "\" followed by a |
| 2027 |
two digit hex number showing its Unicode number. |
| 2028 |
* Escape any trailing white space by replacing "\ " with "\20". |
| 2029 |
* Since a XML document logically consists of characters, not |
| 2030 |
octets, the resulting Unicode string is finally encoded |
| 2031 |
according to the character encoding used for producing the |
| 2032 |
physical representation of the XML document. |
| 2033 |
|
| 2034 |
Schema Definition: |
| 2035 |
|
| 2036 |
<element name="X509Data" type="ds:X509DataType"/> |
| 2037 |
<complexType name="X509DataType"> |
| 2038 |
<sequence maxOccurs="unbounded"> |
| 2039 |
<choice> |
| 2040 |
<element name="X509IssuerSerial" |
| 2041 |
type="ds:X509IssuerSerialType"/> |
| 2042 |
<element name="X509SKI" type="base64Binary"/> |
| 2043 |
<element name="X509SubjectName" type="string"/> |
| 2044 |
<element name="X509Certificate" type="base64Binary"/> |
| 2045 |
<element name="X509CRL" type="base64Binary"/> |
| 2046 |
<any namespace="##other" processContents="lax"/> |
| 2047 |
</choice> |
| 2048 |
</sequence> |
| 2049 |
</complexType> |
| 2050 |
<complexType name="X509IssuerSerialType"> |
| 2051 |
<sequence> |
| 2052 |
<element name="X509IssuerName" type="string"/> |
| 2053 |
<element name="X509SerialNumber" type="integer"/> |
| 2054 |
</sequence> |
| 2055 |
</complexType> |
| 2056 |
|
| 2057 |
|
| 2058 |
|
| 2059 |
|
| 2060 |
|
| 2061 |
|
| 2062 |
|
| 2063 |
|
| 2064 |
|
| 2065 |
|
| 2066 |
|
| 2067 |
|
| 2068 |
<span class="grey">Eastlake, et al. Standards Track [Page 37]</span></pre> |
| 2069 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span> |
| 2070 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2071 |
|
| 2072 |
|
| 2073 |
DTD: |
| 2074 |
|
| 2075 |
<!ELEMENT X509Data ((X509IssuerSerial | X509SKI | X509SubjectName |
| 2076 |
| X509Certificate | X509CRL)+ %X509.ANY;)> |
| 2077 |
<!ELEMENT X509IssuerSerial (X509IssuerName, X509SerialNumber) > |
| 2078 |
<!ELEMENT X509IssuerName (#PCDATA) > |
| 2079 |
<!ELEMENT X509SubjectName (#PCDATA) > |
| 2080 |
<!ELEMENT X509SerialNumber (#PCDATA) > |
| 2081 |
<!ELEMENT X509SKI (#PCDATA) > |
| 2082 |
<!ELEMENT X509Certificate (#PCDATA) > |
| 2083 |
<!ELEMENT X509CRL (#PCDATA) > |
| 2084 |
|
| 2085 |
<!-- Note, this DTD and schema permit X509Data to be empty; this is |
| 2086 |
precluded by the text in KeyInfo Element (<a href="#section-4.4">section 4.4</a>) which states |
| 2087 |
that at least one element from the dsig namespace should be present |
| 2088 |
in the PGP, SPKI, and X509 structures. This is easily expressed for |
| 2089 |
the other key types, but not for X509Data because of its rich |
| 2090 |
structure. --> |
| 2091 |
|
| 2092 |
|
| 2093 |
<span class="h4"><a class="selflink" id="section-4.4.5" href="#section-4.4.5">4.4.5</a> The PGPData Element</span> |
| 2094 |
|
| 2095 |
Identifier |
| 2096 |
Type="http://www.w3.org/2000/09/xmldsig#PGPData" (this can be used |
| 2097 |
within a RetrievalMethod or Reference element to identify the |
| 2098 |
referent's type) |
| 2099 |
|
| 2100 |
The PGPData element within KeyInfo is used to convey information |
| 2101 |
related to PGP public key pairs and signatures on such keys. The |
| 2102 |
PGPKeyID's value is a base64Binary sequence containing a standard PGP |
| 2103 |
public key identifier as defined in [PGP, <a href="#section-11.2">section 11.2</a>]. The |
| 2104 |
PGPKeyPacket contains a base64-encoded Key Material Packet as defined |
| 2105 |
in [PGP, <a href="#section-5.5">section 5.5</a>]. These children element types can be |
| 2106 |
complemented/extended by siblings from an external namespace within |
| 2107 |
PGPData, or PGPData can be replaced all together with an alternative |
| 2108 |
PGP XML structure as a child of KeyInfo. PGPData must contain one |
| 2109 |
PGPKeyID and/or one PGPKeyPacket and 0 or more elements from an |
| 2110 |
external namespace. |
| 2111 |
|
| 2112 |
|
| 2113 |
|
| 2114 |
|
| 2115 |
|
| 2116 |
|
| 2117 |
|
| 2118 |
|
| 2119 |
|
| 2120 |
|
| 2121 |
|
| 2122 |
|
| 2123 |
|
| 2124 |
<span class="grey">Eastlake, et al. Standards Track [Page 38]</span></pre> |
| 2125 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span> |
| 2126 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2127 |
|
| 2128 |
|
| 2129 |
Schema Definition: |
| 2130 |
|
| 2131 |
<element name="PGPData" type="ds:PGPDataType"/> |
| 2132 |
<complexType name="PGPDataType"> |
| 2133 |
<choice> |
| 2134 |
<sequence> |
| 2135 |
<element name="PGPKeyID" type="base64Binary"/> |
| 2136 |
<element name="PGPKeyPacket" type="base64Binary" |
| 2137 |
minOccurs="0"/> |
| 2138 |
<any namespace="##other" processContents="lax" minOccurs="0" |
| 2139 |
maxOccurs="unbounded"/> |
| 2140 |
</sequence> |
| 2141 |
<sequence> |
| 2142 |
<element name="PGPKeyPacket" type="base64Binary"/> |
| 2143 |
<any namespace="##other" processContents="lax" minOccurs="0" |
| 2144 |
maxOccurs="unbounded"/> |
| 2145 |
</sequence> |
| 2146 |
</choice> |
| 2147 |
</complexType> |
| 2148 |
|
| 2149 |
DTD: |
| 2150 |
|
| 2151 |
<!ELEMENT PGPData ((PGPKeyID, PGPKeyPacket?) | (PGPKeyPacket) |
| 2152 |
%PGPData.ANY;) > |
| 2153 |
<!ELEMENT PGPKeyPacket (#PCDATA) > |
| 2154 |
<!ELEMENT PGPKeyID (#PCDATA) > |
| 2155 |
|
| 2156 |
<span class="h4"><a class="selflink" id="section-4.4.6" href="#section-4.4.6">4.4.6</a> The SPKIData Element</span> |
| 2157 |
|
| 2158 |
Identifier |
| 2159 |
Type="http://www.w3.org/2000/09/xmldsig#SPKIData" (this can be |
| 2160 |
used within a RetrievalMethod or Reference element to identify the |
| 2161 |
referent's type) |
| 2162 |
|
| 2163 |
The SPKIData element within KeyInfo is used to convey information |
| 2164 |
related to SPKI public key pairs, certificates and other SPKI data. |
| 2165 |
SPKISexp is the base64 encoding of a SPKI canonical S-expression. |
| 2166 |
SPKIData must have at least one SPKISexp; SPKISexp can be |
| 2167 |
complemented/extended by siblings from an external namespace within |
| 2168 |
SPKIData, or SPKIData can be entirely replaced with an alternative |
| 2169 |
SPKI XML structure as a child of KeyInfo. |
| 2170 |
|
| 2171 |
|
| 2172 |
|
| 2173 |
|
| 2174 |
|
| 2175 |
|
| 2176 |
|
| 2177 |
|
| 2178 |
|
| 2179 |
|
| 2180 |
<span class="grey">Eastlake, et al. Standards Track [Page 39]</span></pre> |
| 2181 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span> |
| 2182 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2183 |
|
| 2184 |
|
| 2185 |
Schema Definition: |
| 2186 |
|
| 2187 |
<element name="SPKIData" type="ds:SPKIDataType"/> |
| 2188 |
<complexType name="SPKIDataType"> |
| 2189 |
<sequence maxOccurs="unbounded"> |
| 2190 |
<element name="SPKISexp" type="base64Binary"/> |
| 2191 |
<any namespace="##other" processContents="lax" minOccurs="0"/> |
| 2192 |
</sequence> |
| 2193 |
</complexType> |
| 2194 |
|
| 2195 |
DTD: |
| 2196 |
|
| 2197 |
<!ELEMENT SPKIData (SPKISexp %SPKIData.ANY;) > |
| 2198 |
<!ELEMENT SPKISexp (#PCDATA) > |
| 2199 |
|
| 2200 |
<span class="h4"><a class="selflink" id="section-4.4.7" href="#section-4.4.7">4.4.7</a> The MgmtData Element</span> |
| 2201 |
|
| 2202 |
Identifier |
| 2203 |
Type="http://www.w3.org/2000/09/xmldsig#MgmtData" (this can be |
| 2204 |
used within a RetrievalMethod or Reference element to identify the |
| 2205 |
referent's type) |
| 2206 |
|
| 2207 |
The MgmtData element within KeyInfo is a string value used to convey |
| 2208 |
in-band key distribution or agreement data. For example, DH key |
| 2209 |
exchange, RSA key encryption, etc. Use of this element is NOT |
| 2210 |
RECOMMENDED. It provides a syntactic hook where in-band key |
| 2211 |
distribution or agreement data can be placed. However, superior |
| 2212 |
interoperable child elements of KeyInfo for the transmission of |
| 2213 |
encrypted keys and for key agreement are being specified by the W3C |
| 2214 |
XML Encryption Working Group and they should be used instead of |
| 2215 |
MgmtData. |
| 2216 |
|
| 2217 |
Schema Definition: |
| 2218 |
|
| 2219 |
<element name="MgmtData" type="string"/> |
| 2220 |
|
| 2221 |
DTD: |
| 2222 |
|
| 2223 |
<!ELEMENT MgmtData (#PCDATA)> |
| 2224 |
|
| 2225 |
<span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a> The Object Element</span> |
| 2226 |
|
| 2227 |
Identifier |
| 2228 |
Type="http://www.w3.org/2000/09/xmldsig#Object" (this can be used |
| 2229 |
within a Reference element to identify the referent's type) |
| 2230 |
|
| 2231 |
|
| 2232 |
|
| 2233 |
|
| 2234 |
|
| 2235 |
|
| 2236 |
<span class="grey">Eastlake, et al. Standards Track [Page 40]</span></pre> |
| 2237 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span> |
| 2238 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2239 |
|
| 2240 |
|
| 2241 |
Object is an optional element that may occur one or more times. When |
| 2242 |
present, this element may contain any data. The Object element may |
| 2243 |
include optional MIME type, ID, and encoding attributes. |
| 2244 |
|
| 2245 |
The Object's Encoding attributed may be used to provide a URI that |
| 2246 |
identifies the method by which the object is encoded (e.g., a binary |
| 2247 |
file). |
| 2248 |
|
| 2249 |
The MimeType attribute is an optional attribute which describes the |
| 2250 |
data within the Object (independent of its encoding). This is a |
| 2251 |
string with values defined by [<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>]. For example, if the Object |
| 2252 |
contains base64 encoded PNG, the Encoding may be specified as |
| 2253 |
'base64' and the MimeType as 'image/png'. This attribute is purely |
| 2254 |
advisory; no validation of the MimeType information is required by |
| 2255 |
this specification. Applications which require normative type and |
| 2256 |
encoding information for signature validation should specify |
| 2257 |
Transforms with well defined resulting types and/or encodings. |
| 2258 |
|
| 2259 |
The Object's Id is commonly referenced from a Reference in |
| 2260 |
SignedInfo, or Manifest. This element is typically used for |
| 2261 |
enveloping signatures where the object being signed is to be included |
| 2262 |
in the signature element. The digest is calculated over the entire |
| 2263 |
Object element including start and end tags. |
| 2264 |
|
| 2265 |
Note, if the application wishes to exclude the <Object> tags from the |
| 2266 |
digest calculation, the Reference must identify the actual data |
| 2267 |
object (easy for XML documents) or a transform must be used to remove |
| 2268 |
the Object tags (likely where the data object is non-XML). Exclusion |
| 2269 |
of the object tags may be desired for cases where one wants the |
| 2270 |
signature to remain valid if the data object is moved from inside a |
| 2271 |
signature to outside the signature (or vice versa), or where the |
| 2272 |
content of the Object is an encoding of an original binary document |
| 2273 |
and it is desired to extract and decode so as to sign the original |
| 2274 |
bitwise representation. |
| 2275 |
|
| 2276 |
Schema Definition: |
| 2277 |
|
| 2278 |
<element name="Object" type="ds:ObjectType"/> |
| 2279 |
<complexType name="ObjectType" mixed="true"> |
| 2280 |
<sequence minOccurs="0" maxOccurs="unbounded"> |
| 2281 |
<any namespace="##any" processContents="lax"/> |
| 2282 |
</sequence> |
| 2283 |
<attribute name="Id" type="ID" use="optional"/> |
| 2284 |
<attribute name="MimeType" type="string" use="optional"/> |
| 2285 |
<attribute name="Encoding" type="anyURI" use="optional"/> |
| 2286 |
</complexType> |
| 2287 |
|
| 2288 |
|
| 2289 |
|
| 2290 |
|
| 2291 |
|
| 2292 |
<span class="grey">Eastlake, et al. Standards Track [Page 41]</span></pre> |
| 2293 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-42" ></span> |
| 2294 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2295 |
|
| 2296 |
|
| 2297 |
DTD: |
| 2298 |
|
| 2299 |
<!ELEMENT Object (#PCDATA|Signature|SignatureProperties|Manifest |
| 2300 |
%Object.ANY;)* > |
| 2301 |
<!ATTLIST Object |
| 2302 |
Id ID #IMPLIED |
| 2303 |
MimeType CDATA #IMPLIED |
| 2304 |
Encoding CDATA #IMPLIED > |
| 2305 |
|
| 2306 |
<span class="h3"><a class="selflink" id="section-5.0" href="#section-5.0">5.0</a> Additional Signature Syntax</span> |
| 2307 |
|
| 2308 |
This section describes the optional to implement Manifest and |
| 2309 |
SignatureProperties elements and describes the handling of XML |
| 2310 |
processing instructions and comments. With respect to the elements |
| 2311 |
Manifest and SignatureProperties, this section specifies syntax and |
| 2312 |
little behavior -- it is left to the application. These elements can |
| 2313 |
appear anywhere the parent's content model permits; the Signature |
| 2314 |
content model only permits them within Object. |
| 2315 |
|
| 2316 |
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a> The Manifest Element</span> |
| 2317 |
|
| 2318 |
Identifier |
| 2319 |
Type="http://www.w3.org/2000/09/xmldsig#Manifest" (this can be |
| 2320 |
used within a Reference element to identify the referent's type) |
| 2321 |
|
| 2322 |
The Manifest element provides a list of References. The difference |
| 2323 |
from the list in SignedInfo is that it is application defined which, |
| 2324 |
if any, of the digests are actually checked against the objects |
| 2325 |
referenced and what to do if the object is inaccessible or the digest |
| 2326 |
compare fails. If a Manifest is pointed to from SignedInfo, the |
| 2327 |
digest over the Manifest itself will be checked by the core signature |
| 2328 |
validation behavior. The digests within such a Manifest are checked |
| 2329 |
at the application's discretion. If a Manifest is referenced from |
| 2330 |
another Manifest, even the overall digest of this two level deep |
| 2331 |
Manifest might not be checked. |
| 2332 |
|
| 2333 |
Schema Definition: |
| 2334 |
|
| 2335 |
<element name="Manifest" type="ds:ManifestType"/> |
| 2336 |
<complexType name="ManifestType"> |
| 2337 |
<sequence> |
| 2338 |
<element ref="ds:Reference" maxOccurs="unbounded"/> |
| 2339 |
</sequence> |
| 2340 |
<attribute name="Id" type="ID" use="optional"/> |
| 2341 |
</complexType> |
| 2342 |
|
| 2343 |
|
| 2344 |
|
| 2345 |
|
| 2346 |
|
| 2347 |
|
| 2348 |
<span class="grey">Eastlake, et al. Standards Track [Page 42]</span></pre> |
| 2349 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-43" ></span> |
| 2350 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2351 |
|
| 2352 |
|
| 2353 |
DTD: |
| 2354 |
|
| 2355 |
<!ELEMENT Manifest (Reference+) > |
| 2356 |
<!ATTLIST Manifest |
| 2357 |
Id ID #IMPLIED > |
| 2358 |
|
| 2359 |
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a> The SignatureProperties Element</span> |
| 2360 |
|
| 2361 |
Identifier |
| 2362 |
Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" (this |
| 2363 |
can be used within a Reference element to identify the referent's |
| 2364 |
type) |
| 2365 |
|
| 2366 |
Additional information items concerning the generation of the |
| 2367 |
signature(s) can be placed in a SignatureProperty element (i.e., |
| 2368 |
date/time stamp or the serial number of cryptographic hardware used |
| 2369 |
in signature generation). |
| 2370 |
|
| 2371 |
Schema Definition: |
| 2372 |
|
| 2373 |
<element name="SignatureProperties" |
| 2374 |
type="ds:SignaturePropertiesType"/> |
| 2375 |
<complexType name="SignaturePropertiesType"> |
| 2376 |
<sequence> |
| 2377 |
<element ref="ds:SignatureProperty" maxOccurs="unbounded"/> |
| 2378 |
</sequence> |
| 2379 |
<attribute name="Id" type="ID" use="optional"/> |
| 2380 |
</complexType> |
| 2381 |
|
| 2382 |
<element name="SignatureProperty" |
| 2383 |
type="ds:SignaturePropertyType"/> |
| 2384 |
<complexType name="SignaturePropertyType" mixed="true"> |
| 2385 |
<choice maxOccurs="unbounded"> |
| 2386 |
<any namespace="##other" processContents="lax"/> |
| 2387 |
<!-- (1,1) elements from (1,unbounded) namespaces --> |
| 2388 |
</choice> |
| 2389 |
<attribute name="Target" type="anyURI" use="required"/> |
| 2390 |
<attribute name="Id" type="ID" use="optional"/> |
| 2391 |
</complexType> |
| 2392 |
|
| 2393 |
|
| 2394 |
|
| 2395 |
|
| 2396 |
|
| 2397 |
|
| 2398 |
|
| 2399 |
|
| 2400 |
|
| 2401 |
|
| 2402 |
|
| 2403 |
|
| 2404 |
<span class="grey">Eastlake, et al. Standards Track [Page 43]</span></pre> |
| 2405 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-44" ></span> |
| 2406 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2407 |
|
| 2408 |
|
| 2409 |
DTD: |
| 2410 |
|
| 2411 |
<!ELEMENT SignatureProperties (SignatureProperty+) > |
| 2412 |
<!ATTLIST SignatureProperties |
| 2413 |
Id ID #IMPLIED > |
| 2414 |
|
| 2415 |
<!ELEMENT SignatureProperty (#PCDATA %SignatureProperty.ANY;)* > |
| 2416 |
<!ATTLIST SignatureProperty |
| 2417 |
Target CDATA #REQUIRED |
| 2418 |
Id ID #IMPLIED > |
| 2419 |
|
| 2420 |
<span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a> Processing Instructions in Signature Elements</span> |
| 2421 |
|
| 2422 |
No XML processing instructions (PIs) are used by this specification. |
| 2423 |
|
| 2424 |
Note that PIs placed inside SignedInfo by an application will be |
| 2425 |
signed unless the CanonicalizationMethod algorithm discards them. |
| 2426 |
(This is true for any signed XML content.) All of the |
| 2427 |
CanonicalizationMethods identified within this specification retain |
| 2428 |
PIs. When a PI is part of content that is signed (e.g., within |
| 2429 |
SignedInfo or referenced XML documents) any change to the PI will |
| 2430 |
obviously result in a signature failure. |
| 2431 |
|
| 2432 |
<span class="h3"><a class="selflink" id="section-5.4" href="#section-5.4">5.4</a> Comments in Signature Elements</span> |
| 2433 |
|
| 2434 |
XML comments are not used by this specification. |
| 2435 |
|
| 2436 |
Note that unless CanonicalizationMethod removes comments within |
| 2437 |
SignedInfo or any other referenced XML (which [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>] does), they |
| 2438 |
will be signed. Consequently, if they are retained, a change to the |
| 2439 |
comment will cause a signature failure. Similarly, the XML signature |
| 2440 |
over any XML data will be sensitive to comment changes unless a |
| 2441 |
comment-ignoring canonicalization/transform method, such as the |
| 2442 |
Canonical XML [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>], is specified. |
| 2443 |
|
| 2444 |
<span class="h3"><a class="selflink" id="section-6.0" href="#section-6.0">6.0</a> Algorithms</span> |
| 2445 |
|
| 2446 |
This section identifies algorithms used with the XML digital |
| 2447 |
signature specification. Entries contain the identifier to be used |
| 2448 |
in Signature elements, a reference to the formal specification, and |
| 2449 |
definitions, where applicable, for the representation of keys and the |
| 2450 |
results of cryptographic operations. |
| 2451 |
|
| 2452 |
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a> Algorithm Identifiers and Implementation Requirements</span> |
| 2453 |
|
| 2454 |
Algorithms are identified by URIs that appear as an attribute to the |
| 2455 |
element that identifies the algorithms' role (DigestMethod, |
| 2456 |
Transform, SignatureMethod, or CanonicalizationMethod). All |
| 2457 |
|
| 2458 |
|
| 2459 |
|
| 2460 |
<span class="grey">Eastlake, et al. Standards Track [Page 44]</span></pre> |
| 2461 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-45" ></span> |
| 2462 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2463 |
|
| 2464 |
|
| 2465 |
algorithms used herein take parameters but in many cases the |
| 2466 |
parameters are implicit. For example, a SignatureMethod is |
| 2467 |
implicitly given two parameters: the keying info and the output of |
| 2468 |
CanonicalizationMethod. Explicit additional parameters to an |
| 2469 |
algorithm appear as content elements within the algorithm role |
| 2470 |
element. Such parameter elements have a descriptive element name, |
| 2471 |
which is frequently algorithm specific, and MUST be in the XML |
| 2472 |
Signature namespace or an algorithm specific namespace. |
| 2473 |
|
| 2474 |
This specification defines a set of algorithms, their URIs, and |
| 2475 |
requirements for implementation. Requirements are specified over |
| 2476 |
implementation, not over requirements for signature use. |
| 2477 |
Furthermore, the mechanism is extensible; alternative algorithms may |
| 2478 |
be used by signature applications. |
| 2479 |
|
| 2480 |
Digest |
| 2481 |
1. Required SHA1 |
| 2482 |
<a href="http://www.w3.org/2000/09/xmldsig#sha1">http://www.w3.org/2000/09/xmldsig#sha1</a> |
| 2483 |
Encoding |
| 2484 |
1. Required base64 |
| 2485 |
<a href="http://www.w3.org/2000/09/xmldsig#base64">http://www.w3.org/2000/09/xmldsig#base64</a> |
| 2486 |
MAC |
| 2487 |
1. Required HMAC-SHA1 |
| 2488 |
<a href="http://www.w3.org/2000/09/xmldsig#hmac-sha1">http://www.w3.org/2000/09/xmldsig#hmac-sha1</a> |
| 2489 |
Signature |
| 2490 |
1. Required DSAwithSHA1 (DSS) |
| 2491 |
<a href="http://www.w3.org/2000/09/xmldsig#dsa-sha1">http://www.w3.org/2000/09/xmldsig#dsa-sha1</a> |
| 2492 |
2. Recommended RSAwithSHA1 |
| 2493 |
<a href="http://www.w3.org/2000/09/xmldsig#rsa-sha1">http://www.w3.org/2000/09/xmldsig#rsa-sha1</a> |
| 2494 |
Canonicalization |
| 2495 |
1. Required Canonical XML (omits comments) |
| 2496 |
<a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">http://www.w3.org/TR/2001/REC-xml-c14n-20010315</a> |
| 2497 |
2. Recommended Canonical XML with Comments |
| 2498 |
<a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments">http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments</a> |
| 2499 |
Transform |
| 2500 |
1. Optional XSLT |
| 2501 |
<a href="http://www.w3.org/TR/1999/REC-xslt-19991116">http://www.w3.org/TR/1999/REC-xslt-19991116</a> |
| 2502 |
2. Recommended XPath |
| 2503 |
<a href="http://www.w3.org/TR/1999/REC-xpath-19991116">http://www.w3.org/TR/1999/REC-xpath-19991116</a> |
| 2504 |
3. Required Enveloped Signature* |
| 2505 |
<a href="http://www.w3.org/2000/09/xmldsig#enveloped-signature">http://www.w3.org/2000/09/xmldsig#enveloped-signature</a> |
| 2506 |
|
| 2507 |
* The Enveloped Signature transform removes the Signature element |
| 2508 |
from the calculation of the signature when the signature is within |
| 2509 |
the content that it is being signed. This MAY be implemented via the |
| 2510 |
RECOMMENDED XPath specification specified in 6.6.4: Enveloped |
| 2511 |
Signature Transform; it MUST have the same effect as that specified |
| 2512 |
by the XPath Transform. |
| 2513 |
|
| 2514 |
|
| 2515 |
|
| 2516 |
<span class="grey">Eastlake, et al. Standards Track [Page 45]</span></pre> |
| 2517 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-46" ></span> |
| 2518 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2519 |
|
| 2520 |
|
| 2521 |
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a> Message Digests</span> |
| 2522 |
|
| 2523 |
Only one digest algorithm is defined herein. However, it is expected |
| 2524 |
that one or more additional strong digest algorithms will be |
| 2525 |
developed in connection with the US Advanced Encryption Standard |
| 2526 |
effort. Use of MD5 [<a href="#ref-MD5" title=""The MD5 Message-Digest Algorithm"">MD5</a>] is NOT RECOMMENDED because recent advances |
| 2527 |
in cryptanalysis have cast doubt on its strength. |
| 2528 |
|
| 2529 |
<span class="h4"><a class="selflink" id="section-6.2.1" href="#section-6.2.1">6.2.1</a> SHA-1</span> |
| 2530 |
|
| 2531 |
Identifier: |
| 2532 |
<a href="http://www.w3.org/2000/09/xmldsig#sha1">http://www.w3.org/2000/09/xmldsig#sha1</a> |
| 2533 |
|
| 2534 |
The SHA-1 algorithm [<a href="#ref-SHA-1">SHA-1</a>] takes no explicit parameters. An example |
| 2535 |
of an SHA-1 DigestAlg element is: |
| 2536 |
|
| 2537 |
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> |
| 2538 |
|
| 2539 |
A SHA-1 digest is a 160-bit string. The content of the DigestValue |
| 2540 |
element shall be the base64 encoding of this bit string viewed as a |
| 2541 |
20-octet octet stream. For example, the DigestValue element for the |
| 2542 |
message digest: |
| 2543 |
|
| 2544 |
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D |
| 2545 |
|
| 2546 |
from <a href="#appendix-A">Appendix A</a> of the SHA-1 standard would be: |
| 2547 |
|
| 2548 |
<DigestValue>qZk+NkcGgWq6PiVxeFDCbJzQ2J0=</DigestValue> |
| 2549 |
|
| 2550 |
<span class="h3"><a class="selflink" id="section-6.3" href="#section-6.3">6.3</a> Message Authentication Codes</span> |
| 2551 |
|
| 2552 |
MAC algorithms take two implicit parameters, their keying material |
| 2553 |
determined from KeyInfo and the octet stream output by |
| 2554 |
CanonicalizationMethod. MACs and signature algorithms are |
| 2555 |
syntactically identical but a MAC implies a shared secret key. |
| 2556 |
|
| 2557 |
<span class="h4"><a class="selflink" id="section-6.3.1" href="#section-6.3.1">6.3.1</a> HMAC</span> |
| 2558 |
|
| 2559 |
Identifier: |
| 2560 |
<a href="http://www.w3.org/2000/09/xmldsig#hmac-sha1">http://www.w3.org/2000/09/xmldsig#hmac-sha1</a> |
| 2561 |
|
| 2562 |
The HMAC algorithm (<a href="./rfc2104">RFC2104</a> [<a href="#ref-HMAC" title=""HMAC: Keyed-Hashing for Message Authentication"">HMAC</a>]) takes the truncation length in |
| 2563 |
bits as a parameter; if the parameter is not specified then all the |
| 2564 |
bits of the hash are output. An example of an HMAC SignatureMethod |
| 2565 |
element: |
| 2566 |
|
| 2567 |
|
| 2568 |
|
| 2569 |
|
| 2570 |
|
| 2571 |
|
| 2572 |
<span class="grey">Eastlake, et al. Standards Track [Page 46]</span></pre> |
| 2573 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-47" ></span> |
| 2574 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2575 |
|
| 2576 |
|
| 2577 |
<SignatureMethod |
| 2578 |
Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"> |
| 2579 |
<HMACOutputLength>128</HMACOutputLength> |
| 2580 |
</SignatureMethod> |
| 2581 |
|
| 2582 |
The output of the HMAC algorithm is ultimately the output (possibly |
| 2583 |
truncated) of the chosen digest algorithm. This value shall be |
| 2584 |
base64 encoded in the same straightforward fashion as the output of |
| 2585 |
the digest algorithms. Example: the SignatureValue element for the |
| 2586 |
HMAC-SHA1 digest |
| 2587 |
|
| 2588 |
9294727A 3638BB1C 13F48EF8 158BFC9D |
| 2589 |
|
| 2590 |
from the test vectors in [<a href="#ref-HMAC" title=""HMAC: Keyed-Hashing for Message Authentication"">HMAC</a>] would be |
| 2591 |
|
| 2592 |
<SignatureValue>kpRyejY4uxwT9I74FYv8nQ==</SignatureValue> |
| 2593 |
|
| 2594 |
Schema Definition: |
| 2595 |
|
| 2596 |
<simpleType name="HMACOutputLengthType"> |
| 2597 |
<restriction base="integer"/> |
| 2598 |
</simpleType> |
| 2599 |
|
| 2600 |
DTD: |
| 2601 |
|
| 2602 |
<!ELEMENT HMACOutputLength (#PCDATA)> |
| 2603 |
|
| 2604 |
<span class="h3"><a class="selflink" id="section-6.4" href="#section-6.4">6.4</a> Signature Algorithms</span> |
| 2605 |
|
| 2606 |
Signature algorithms take two implicit parameters, their keying |
| 2607 |
material determined from KeyInfo and the octet stream output by |
| 2608 |
CanonicalizationMethod. Signature and MAC algorithms are |
| 2609 |
syntactically identical but a signature implies public key |
| 2610 |
cryptography. |
| 2611 |
|
| 2612 |
<span class="h4"><a class="selflink" id="section-6.4.1" href="#section-6.4.1">6.4.1</a> DSA</span> |
| 2613 |
|
| 2614 |
Identifier: |
| 2615 |
<a href="http://www.w3.org/2000/09/xmldsig#dsa-sha1">http://www.w3.org/2000/09/xmldsig#dsa-sha1</a> |
| 2616 |
|
| 2617 |
The DSA algorithm [<a href="#ref-DSS">DSS</a>] takes no explicit parameters. An example of |
| 2618 |
a DSA SignatureMethod element is: |
| 2619 |
|
| 2620 |
<SignatureMethod |
| 2621 |
Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/> |
| 2622 |
|
| 2623 |
|
| 2624 |
|
| 2625 |
|
| 2626 |
|
| 2627 |
|
| 2628 |
<span class="grey">Eastlake, et al. Standards Track [Page 47]</span></pre> |
| 2629 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-48" ></span> |
| 2630 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2631 |
|
| 2632 |
|
| 2633 |
The output of the DSA algorithm consists of a pair of integers |
| 2634 |
usually referred by the pair (r, s). The signature value consists of |
| 2635 |
the base64 encoding of the concatenation of two octet-streams that |
| 2636 |
respectively result from the octet-encoding of the values r and s in |
| 2637 |
that order. Integer to octet-stream conversion must be done |
| 2638 |
according to the I2OSP operation defined in the <a href="./rfc2437">RFC 2437</a> [<a href="#ref-PKCS1" title=""PKCS #1: RSA Cryptography Specifications Version 2.0"">PKCS1</a>] |
| 2639 |
specification with a l parameter equal to 20. For example, the |
| 2640 |
SignatureValue element for a DSA signature (r, s) with values |
| 2641 |
specified in hexadecimal: |
| 2642 |
|
| 2643 |
r = 8BAC1AB6 6410435C B7181F95 B16AB97C 92B341C0 |
| 2644 |
s = 41E2345F 1F56DF24 58F426D1 55B4BA2D B6DCD8C8 |
| 2645 |
|
| 2646 |
from the example in Appendix 5 of the DSS standard would be |
| 2647 |
|
| 2648 |
<SignatureValue> |
| 2649 |
i6watmQQQ1y3GB+VsWq5fJKzQcBB4jRfH1bfJFj0JtFVtLotttzYyA== |
| 2650 |
</SignatureValue> |
| 2651 |
|
| 2652 |
<span class="h4"><a class="selflink" id="section-6.4.2" href="#section-6.4.2">6.4.2</a> PKCS1 (RSA-SHA1)</span> |
| 2653 |
|
| 2654 |
Identifier: |
| 2655 |
<a href="http://www.w3.org/2000/09/xmldsig#rsa-sha1">http://www.w3.org/2000/09/xmldsig#rsa-sha1</a> |
| 2656 |
|
| 2657 |
The expression "RSA algorithm" as used in this document refers to the |
| 2658 |
RSASSA-PKCS1-v1_5 algorithm described in <a href="./rfc2437">RFC 2437</a> [<a href="#ref-PKCS1" title=""PKCS #1: RSA Cryptography Specifications Version 2.0"">PKCS1</a>]. The RSA |
| 2659 |
algorithm takes no explicit parameters. An example of an RSA |
| 2660 |
SignatureMethod element is: |
| 2661 |
|
| 2662 |
<SignatureMethod |
| 2663 |
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> |
| 2664 |
|
| 2665 |
The SignatureValue content for an RSA signature is the base64 [<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>] |
| 2666 |
encoding of the octet string computed as per <a href="./rfc2437">RFC 2437</a> [PKCS1, <a href="#section-8.1.1">section</a> |
| 2667 |
<a href="#section-8.1.1">8.1.1</a>: Signature generation for the RSASSA-PKCS1-v1_5 signature |
| 2668 |
scheme]. As specified in the EMSA-PKCS1-V1_5-ENCODE function <a href="./rfc2437">RFC</a> |
| 2669 |
<a href="./rfc2437">2437</a> [PKCS1, <a href="#section-9.2.1">section 9.2.1</a>], the value input to the signature |
| 2670 |
function MUST contain a pre-pended algorithm object identifier for |
| 2671 |
the hash function, but the availability of an ASN.1 parser and |
| 2672 |
recognition of OIDs are not required of a signature verifier. The |
| 2673 |
PKCS#1 v1.5 representation appears as: |
| 2674 |
|
| 2675 |
CRYPT (PAD (ASN.1 (OID, DIGEST (data)))) |
| 2676 |
|
| 2677 |
Note that the padded ASN.1 will be of the following form: |
| 2678 |
|
| 2679 |
01 | FF* | 00 | prefix | hash |
| 2680 |
|
| 2681 |
|
| 2682 |
|
| 2683 |
|
| 2684 |
<span class="grey">Eastlake, et al. Standards Track [Page 48]</span></pre> |
| 2685 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-49" ></span> |
| 2686 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2687 |
|
| 2688 |
|
| 2689 |
where "|" is concatenation, "01", "FF", and "00" are fixed octets of |
| 2690 |
the corresponding hexadecimal value, "hash" is the SHA1 digest of the |
| 2691 |
data, and "prefix" is the ASN.1 BER SHA1 algorithm designator prefix |
| 2692 |
required in PKCS1 [<a href="./rfc2437">RFC 2437</a>], that is, |
| 2693 |
|
| 2694 |
hex 30 21 30 09 06 05 2B 0E 03 02 1A 05 00 04 14 |
| 2695 |
|
| 2696 |
This prefix is included to make it easier to use standard |
| 2697 |
cryptographic libraries. The FF octet MUST be repeated the maximum |
| 2698 |
number of times such that the value of the quantity being CRYPTed is |
| 2699 |
one octet shorter than the RSA modulus. |
| 2700 |
|
| 2701 |
The resulting base64 [<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>] string is the value of the child text |
| 2702 |
node of the SignatureValue element, e.g., |
| 2703 |
|
| 2704 |
<SignatureValue> |
| 2705 |
IWijxQjUrcXBYoCei4QxjWo9Kg8D3p9tlWoT4t0/gyTE96639 |
| 2706 |
In0FZFY2/rvP+/bMJ01EArmKZsR5VW3rwoPxw= |
| 2707 |
</SignatureValue> |
| 2708 |
|
| 2709 |
<span class="h3"><a class="selflink" id="section-6.5" href="#section-6.5">6.5</a> Canonicalization Algorithms</span> |
| 2710 |
|
| 2711 |
If canonicalization is performed over octets, the canonicalization |
| 2712 |
algorithms take two implicit parameters: the content and its charset. |
| 2713 |
The charset is derived according to the rules of the transport |
| 2714 |
protocols and media types (e.g., <a href="./rfc2376">RFC2376</a> [<a href="#ref-XML-MT" title=""XML Media Types"">XML-MT</a>] defines the media |
| 2715 |
types for XML). This information is necessary to correctly sign and |
| 2716 |
verify documents and often requires careful server side |
| 2717 |
configuration. |
| 2718 |
|
| 2719 |
Various canonicalization algorithms require conversion to [<a href="#ref-UTF-8" title=""UTF-8, a transformation format of ISO 10646"">UTF-8</a>]. |
| 2720 |
The two algorithms below understand at least [<a href="#ref-UTF-8" title=""UTF-8, a transformation format of ISO 10646"">UTF-8</a>] and [<a href="#ref-UTF-16" title=""UTF-16, an encoding of ISO 10646"">UTF-16</a>] as |
| 2721 |
input encodings. We RECOMMEND that externally specified algorithms |
| 2722 |
do the same. Knowledge of other encodings is OPTIONAL. |
| 2723 |
|
| 2724 |
Various canonicalization algorithms transcode from a non-Unicode |
| 2725 |
encoding to Unicode. The two algorithms below perform text |
| 2726 |
normalization during transcoding [<a href="#ref-NFC" title="Unicode Normalization Forms. M. Davis">NFC</a>, NFC-Corrigendum]. We |
| 2727 |
RECOMMEND that externally specified canonicalization algorithms do |
| 2728 |
the same. (Note, there can be ambiguities in converting existing |
| 2729 |
charsets to Unicode, for an example see the XML Japanese Profile |
| 2730 |
[<a href="#ref-XML-Japanese">XML-Japanese</a>] Note.) |
| 2731 |
|
| 2732 |
<span class="h4"><a class="selflink" id="section-6.5.1" href="#section-6.5.1">6.5.1</a> Canonical XML</span> |
| 2733 |
|
| 2734 |
Identifier for REQUIRED Canonical XML (omits comments): |
| 2735 |
<a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">http://www.w3.org/TR/2001/REC-xml-c14n-20010315</a> |
| 2736 |
|
| 2737 |
|
| 2738 |
|
| 2739 |
|
| 2740 |
<span class="grey">Eastlake, et al. Standards Track [Page 49]</span></pre> |
| 2741 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-50" ></span> |
| 2742 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2743 |
|
| 2744 |
|
| 2745 |
Identifier for Canonical XML with Comments: |
| 2746 |
<a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments">http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments</a> |
| 2747 |
|
| 2748 |
An example of an XML canonicalization element is: |
| 2749 |
<CanonicalizationMethod |
| 2750 |
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> |
| 2751 |
|
| 2752 |
The normative specification of Canonical XML is [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>]. The |
| 2753 |
algorithm is capable of taking as input either an octet stream or an |
| 2754 |
XPath node-set (or sufficiently functional alternative). The |
| 2755 |
algorithm produces an octet stream as output. Canonical XML is |
| 2756 |
easily parameterized (via an additional URI) to omit or retain |
| 2757 |
comments. |
| 2758 |
|
| 2759 |
<span class="h3"><a class="selflink" id="section-6.6" href="#section-6.6">6.6</a> Transform Algorithms</span> |
| 2760 |
|
| 2761 |
A Transform algorithm has a single implicit parameter: an octet |
| 2762 |
stream from the Reference or the output of an earlier Transform. |
| 2763 |
|
| 2764 |
Application developers are strongly encouraged to support all |
| 2765 |
transforms listed in this section as RECOMMENDED unless the |
| 2766 |
application environment has resource constraints that would make such |
| 2767 |
support impractical. Compliance with this recommendation will |
| 2768 |
maximize application interoperability and libraries should be |
| 2769 |
available to enable support of these transforms in applications |
| 2770 |
without extensive development. |
| 2771 |
|
| 2772 |
<span class="h4"><a class="selflink" id="section-6.6.1" href="#section-6.6.1">6.6.1</a> Canonicalization</span> |
| 2773 |
|
| 2774 |
Any canonicalization algorithm that can be used for |
| 2775 |
CanonicalizationMethod (such as those in Canonicalization Algorithms |
| 2776 |
(<a href="#section-6.5">section 6.5</a>)) can be used as a Transform. |
| 2777 |
|
| 2778 |
<span class="h4"><a class="selflink" id="section-6.6.2" href="#section-6.6.2">6.6.2</a> Base64</span> |
| 2779 |
|
| 2780 |
Identifiers: |
| 2781 |
<a href="http://www.w3.org/2000/09/xmldsig#base64">http://www.w3.org/2000/09/xmldsig#base64</a> |
| 2782 |
|
| 2783 |
The normative specification for base64 decoding transforms is [<a href="#ref-MIME" title=""Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"">MIME</a>]. |
| 2784 |
The base64 Transform element has no content. The input is decoded by |
| 2785 |
the algorithms. This transform is useful if an application needs to |
| 2786 |
sign the raw data associated with the encoded content of an element. |
| 2787 |
|
| 2788 |
This transform requires an octet stream for input. If an XPath |
| 2789 |
node-set (or sufficiently functional alternative) is given as input, |
| 2790 |
then it is converted to an octet stream by performing operations |
| 2791 |
logically equivalent to 1) applying an XPath transform with |
| 2792 |
expression self::text(), then 2) taking the string-value of the |
| 2793 |
|
| 2794 |
|
| 2795 |
|
| 2796 |
<span class="grey">Eastlake, et al. Standards Track [Page 50]</span></pre> |
| 2797 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-51" ></span> |
| 2798 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2799 |
|
| 2800 |
|
| 2801 |
node-set. Thus, if an XML element is identified by a barename |
| 2802 |
XPointer in the Reference URI, and its content consists solely of |
| 2803 |
base64 encoded character data, then this transform automatically |
| 2804 |
strips away the start and end tags of the identified element and any |
| 2805 |
of its descendant elements as well as any descendant comments and |
| 2806 |
processing instructions. The output of this transform is an octet |
| 2807 |
stream. |
| 2808 |
|
| 2809 |
<span class="h4"><a class="selflink" id="section-6.6.3" href="#section-6.6.3">6.6.3</a> XPath Filtering</span> |
| 2810 |
|
| 2811 |
Identifier: |
| 2812 |
<a href="http://www.w3.org/TR/1999/REC-xpath-19991116">http://www.w3.org/TR/1999/REC-xpath-19991116</a> |
| 2813 |
|
| 2814 |
The normative specification for XPath expression evaluation is |
| 2815 |
[<a href="#ref-XPath">XPath</a>]. The XPath expression to be evaluated appears as the |
| 2816 |
character content of a transform parameter child element named XPath. |
| 2817 |
|
| 2818 |
The input required by this transform is an XPath node-set. Note that |
| 2819 |
if the actual input is an XPath node-set resulting from a null URI or |
| 2820 |
barename XPointer dereference, then comment nodes will have been |
| 2821 |
omitted. If the actual input is an octet stream, then the |
| 2822 |
application MUST convert the octet stream to an XPath node-set |
| 2823 |
suitable for use by Canonical XML with Comments. (A subsequent |
| 2824 |
application of the REQUIRED Canonical XML algorithm would strip away |
| 2825 |
these comments.) In other words, the input node-set should be |
| 2826 |
equivalent to the one that would be created by the following process: |
| 2827 |
|
| 2828 |
1. Initialize an XPath evaluation context by setting the initial node |
| 2829 |
equal to the input XML document's root node, and set the context |
| 2830 |
position and size to 1. |
| 2831 |
2. Evaluate the XPath expression (//. | //@* | //namespace::*) |
| 2832 |
|
| 2833 |
The evaluation of this expression includes all of the document's |
| 2834 |
nodes (including comments) in the node-set representing the octet |
| 2835 |
stream. |
| 2836 |
|
| 2837 |
The transform output is also an XPath node-set. The XPath expression |
| 2838 |
appearing in the XPath parameter is evaluated once for each node in |
| 2839 |
the input node-set. The result is converted to a boolean. If the |
| 2840 |
boolean is true, then the node is included in the output node-set. |
| 2841 |
If the boolean is false, then the node is omitted from the output |
| 2842 |
node-set. |
| 2843 |
|
| 2844 |
Note: Even if the input node-set has had comments removed, the |
| 2845 |
comment nodes still exist in the underlying parse tree and can |
| 2846 |
separate text nodes. For example, the markup <e>Hello, <!-- comment |
| 2847 |
-->world!</e> contains two text nodes. Therefore, the expression |
| 2848 |
self::text()[string()="Hello, world!"] would fail. Should this |
| 2849 |
|
| 2850 |
|
| 2851 |
|
| 2852 |
<span class="grey">Eastlake, et al. Standards Track [Page 51]</span></pre> |
| 2853 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-52" ></span> |
| 2854 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2855 |
|
| 2856 |
|
| 2857 |
problem arise in the application, it can be solved by either |
| 2858 |
canonicalizing the document before the XPath transform to physically |
| 2859 |
remove the comments or by matching the node based on the parent |
| 2860 |
element's string value (e.g., by using the expression |
| 2861 |
self::text()[string(parent::e)="Hello, world!"]). |
| 2862 |
|
| 2863 |
The primary purpose of this transform is to ensure that only |
| 2864 |
specifically defined changes to the input XML document are permitted |
| 2865 |
after the signature is affixed. This is done by omitting precisely |
| 2866 |
those nodes that are allowed to change once the signature is affixed, |
| 2867 |
and including all other input nodes in the output. It is the |
| 2868 |
responsibility of the XPath expression author to include all nodes |
| 2869 |
whose change could affect the interpretation of the transform output |
| 2870 |
in the application context. |
| 2871 |
|
| 2872 |
An important scenario would be a document requiring two enveloped |
| 2873 |
signatures. Each signature must omit itself from its own digest |
| 2874 |
calculations, but it is also necessary to exclude the second |
| 2875 |
signature element from the digest calculations of the first signature |
| 2876 |
so that adding the second signature does not break the first |
| 2877 |
signature. |
| 2878 |
|
| 2879 |
The XPath transform establishes the following evaluation context for |
| 2880 |
each node of the input node-set: |
| 2881 |
|
| 2882 |
* A context node equal to a node of the input node-set. |
| 2883 |
* A context position, initialized to 1. |
| 2884 |
* A context size, initialized to 1. |
| 2885 |
* A library of functions equal to the function set defined in |
| 2886 |
[<a href="#ref-XPath">XPath</a>] plus a function named here. |
| 2887 |
* A set of variable bindings. No means for initializing these is |
| 2888 |
defined. Thus, the set of variable bindings used when |
| 2889 |
evaluating the XPath expression is empty, and use of a variable |
| 2890 |
reference in the XPath expression results in an error. |
| 2891 |
* The set of namespace declarations in scope for the XPath |
| 2892 |
expression. |
| 2893 |
|
| 2894 |
As a result of the context node setting, the XPath expressions |
| 2895 |
appearing in this transform will be quite similar to those used in |
| 2896 |
[<a href="#ref-XSLT">XSLT</a>], except that the size and position are always 1 to reflect the |
| 2897 |
fact that the transform is automatically visiting every node (in |
| 2898 |
XSLT, one recursively calls the command apply-templates to visit the |
| 2899 |
nodes of the input tree). |
| 2900 |
|
| 2901 |
The function here() is defined as follows: |
| 2902 |
|
| 2903 |
Function: node-set here() |
| 2904 |
|
| 2905 |
|
| 2906 |
|
| 2907 |
|
| 2908 |
<span class="grey">Eastlake, et al. Standards Track [Page 52]</span></pre> |
| 2909 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-53" ></span> |
| 2910 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2911 |
|
| 2912 |
|
| 2913 |
The here function returns a node-set containing the attribute or |
| 2914 |
processing instruction node or the parent element of the text node |
| 2915 |
that directly bears the XPath expression. This expression results in |
| 2916 |
an error if the containing XPath expression does not appear in the |
| 2917 |
same XML document against which the XPath expression is being |
| 2918 |
evaluated. |
| 2919 |
|
| 2920 |
As an example, consider creating an enveloped signature (a Signature |
| 2921 |
element that is a descendant of an element being signed). Although |
| 2922 |
the signed content should not be changed after signing, the elements |
| 2923 |
within the Signature element are changing (e.g., the digest value |
| 2924 |
must be put inside the DigestValue and the SignatureValue must be |
| 2925 |
subsequently calculated). One way to prevent these changes from |
| 2926 |
invalidating the digest value in DigestValue is to add an XPath |
| 2927 |
Transform that omits all Signature elements and their descendants. |
| 2928 |
For example, |
| 2929 |
|
| 2930 |
<Document> |
| 2931 |
... |
| 2932 |
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> |
| 2933 |
<SignedInfo> |
| 2934 |
... |
| 2935 |
<Reference URI=""> |
| 2936 |
<Transforms> |
| 2937 |
<Transform |
| 2938 |
Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> |
| 2939 |
<XPath xmlns:dsig="&dsig;"> |
| 2940 |
not(ancestor-or-self::dsig:Signature) |
| 2941 |
</XPath> |
| 2942 |
</Transform> |
| 2943 |
</Transforms> |
| 2944 |
<DigestMethod |
| 2945 |
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> |
| 2946 |
<DigestValue></DigestValue> |
| 2947 |
</Reference> |
| 2948 |
</SignedInfo> |
| 2949 |
<SignatureValue></SignatureValue> |
| 2950 |
</Signature> |
| 2951 |
... |
| 2952 |
</Document> |
| 2953 |
|
| 2954 |
Due to the null Reference URI in this example, the XPath transform |
| 2955 |
input node-set contains all nodes in the entire parse tree starting |
| 2956 |
at the root node (except the comment nodes). For each node in this |
| 2957 |
node-set, the node is included in the output node-set except if the |
| 2958 |
node or one of its ancestors, has a tag of Signature that is in the |
| 2959 |
namespace given by the replacement text for the entity &dsig;. |
| 2960 |
|
| 2961 |
|
| 2962 |
|
| 2963 |
|
| 2964 |
<span class="grey">Eastlake, et al. Standards Track [Page 53]</span></pre> |
| 2965 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-54" ></span> |
| 2966 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 2967 |
|
| 2968 |
|
| 2969 |
A more elegant solution uses the here function to omit only the |
| 2970 |
Signature containing the XPath Transform, thus allowing enveloped |
| 2971 |
signatures to sign other signatures. In the example above, use the |
| 2972 |
XPath element: |
| 2973 |
|
| 2974 |
<XPath xmlns:dsig="&dsig;"> |
| 2975 |
count(ancestor-or-self::dsig:Signature | |
| 2976 |
here()/ancestor::dsig:Signature[1]) > |
| 2977 |
count(ancestor-or-self::dsig:Signature)</XPath> |
| 2978 |
|
| 2979 |
Since the XPath equality operator converts node sets to string values |
| 2980 |
before comparison, we must instead use the XPath union operator (|). |
| 2981 |
For each node of the document, the predicate expression is true if |
| 2982 |
and only if the node-set containing the node and its Signature |
| 2983 |
element ancestors does not include the enveloped Signature element |
| 2984 |
containing the XPath expression (the union does not produce a larger |
| 2985 |
set if the enveloped Signature element is in the node-set given by |
| 2986 |
ancestor-or-self::Signature). |
| 2987 |
|
| 2988 |
<span class="h4"><a class="selflink" id="section-6.6.4" href="#section-6.6.4">6.6.4</a> Enveloped Signature Transform</span> |
| 2989 |
|
| 2990 |
Identifier: |
| 2991 |
<a href="http://www.w3.org/2000/09/xmldsig#enveloped-signature">http://www.w3.org/2000/09/xmldsig#enveloped-signature</a> |
| 2992 |
|
| 2993 |
An enveloped signature transform T removes the whole Signature |
| 2994 |
element containing T from the digest calculation of the Reference |
| 2995 |
element containing T. The entire string of characters used by an XML |
| 2996 |
processor to match the Signature with the XML production element is |
| 2997 |
removed. The output of the transform is equivalent to the output |
| 2998 |
that would result from replacing T with an XPath transform containing |
| 2999 |
the following XPath parameter element: |
| 3000 |
|
| 3001 |
<XPath xmlns:dsig="&dsig;"> |
| 3002 |
count(ancestor-or-self::dsig:Signature | |
| 3003 |
here()/ancestor::dsig:Signature[1]) > |
| 3004 |
count(ancestor-or-self::dsig:Signature)</XPath> |
| 3005 |
|
| 3006 |
The input and output requirements of this transform are identical to |
| 3007 |
those of the XPath transform, but may only be applied to a node-set |
| 3008 |
from its parent XML document. Note that it is not necessary to use |
| 3009 |
an XPath expression evaluator to create this transform. However, |
| 3010 |
this transform MUST produce output in exactly the same manner as the |
| 3011 |
XPath transform parameterized by the XPath expression above. |
| 3012 |
|
| 3013 |
<span class="h4"><a class="selflink" id="section-6.6.5" href="#section-6.6.5">6.6.5</a> XSLT Transform</span> |
| 3014 |
|
| 3015 |
Identifier: |
| 3016 |
<a href="http://www.w3.org/TR/1999/REC-xslt-19991116">http://www.w3.org/TR/1999/REC-xslt-19991116</a> |
| 3017 |
|
| 3018 |
|
| 3019 |
|
| 3020 |
<span class="grey">Eastlake, et al. Standards Track [Page 54]</span></pre> |
| 3021 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-55" ></span> |
| 3022 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3023 |
|
| 3024 |
|
| 3025 |
The normative specification for XSL Transformations is [<a href="#ref-XSLT">XSLT</a>]. |
| 3026 |
Specification of a namespace-qualified stylesheet element, which MUST |
| 3027 |
be the sole child of the Transform element, indicates that the |
| 3028 |
specified style sheet should be used. Whether this instantiates in- |
| 3029 |
line processing of local XSLT declaration within the resource is |
| 3030 |
determined by the XSLT processing model; the ordered application of |
| 3031 |
multiple stylesheet may require multiple Transforms. No special |
| 3032 |
provision is made for the identification of a remote stylesheet at a |
| 3033 |
given URI because it can be communicated via an xsl:include or |
| 3034 |
xsl:import within the stylesheet child of the Transform. |
| 3035 |
|
| 3036 |
This transform requires an octet stream as input. If the actual |
| 3037 |
input is an XPath node-set, then the signature application should |
| 3038 |
attempt to convert it to octets (apply Canonical XML]) as described |
| 3039 |
in the Reference Processing Model (<a href="#section-4.3.3.2">section 4.3.3.2</a>). |
| 3040 |
|
| 3041 |
The output of this transform is an octet stream. The processing |
| 3042 |
rules for the XSL style sheet or transform element are stated in the |
| 3043 |
XSLT specification [<a href="#ref-XSLT">XSLT</a>]. We RECOMMEND that XSLT transform authors |
| 3044 |
use an output method of xml for XML and HTML. As XSLT |
| 3045 |
implementations do not produce consistent serializations of their |
| 3046 |
output, we further RECOMMEND inserting a transform after the XSLT |
| 3047 |
transform to canonicalize the output. These steps will help to |
| 3048 |
ensure interoperability of the resulting signatures among |
| 3049 |
applications that support the XSLT transform. Note that if the |
| 3050 |
output is actually HTML, then the result of these steps is logically |
| 3051 |
equivalent [XHTML]. |
| 3052 |
|
| 3053 |
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. XML Canonicalization and Syntax Constraint Considerations</span> |
| 3054 |
|
| 3055 |
Digital signatures only work if the verification calculations are |
| 3056 |
performed on exactly the same bits as the signing calculations. If |
| 3057 |
the surface representation of the signed data can change between |
| 3058 |
signing and verification, then some way to standardize the changeable |
| 3059 |
aspect must be used before signing and verification. For example, |
| 3060 |
even for simple ASCII text there are at least three widely used line |
| 3061 |
ending sequences. If it is possible for signed text to be modified |
| 3062 |
from one line ending convention to another between the time of |
| 3063 |
signing and signature verification, then the line endings need to be |
| 3064 |
canonicalized to a standard form before signing and verification or |
| 3065 |
the signatures will break. |
| 3066 |
|
| 3067 |
XML is subject to surface representation changes and to processing |
| 3068 |
which discards some surface information. For this reason, XML |
| 3069 |
digital signatures have a provision for indicating canonicalization |
| 3070 |
methods in the signature so that a verifier can use the same |
| 3071 |
canonicalization as the signer. |
| 3072 |
|
| 3073 |
|
| 3074 |
|
| 3075 |
|
| 3076 |
<span class="grey">Eastlake, et al. Standards Track [Page 55]</span></pre> |
| 3077 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-56" ></span> |
| 3078 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3079 |
|
| 3080 |
|
| 3081 |
Throughout this specification we distinguish between the |
| 3082 |
canonicalization of a Signature element and other signed XML data |
| 3083 |
objects. It is possible for an isolated XML document to be treated |
| 3084 |
as if it were binary data so that no changes can occur. In that |
| 3085 |
case, the digest of the document will not change and it need not be |
| 3086 |
canonicalized if it is signed and verified as such. However, XML |
| 3087 |
that is read and processed using standard XML parsing and processing |
| 3088 |
techniques is frequently changed such that some of its surface |
| 3089 |
representation information is lost or modified. In particular, this |
| 3090 |
will occur in many cases for the Signature and enclosed SignedInfo |
| 3091 |
elements since they, and possibly an encompassing XML document, will |
| 3092 |
be processed as XML. |
| 3093 |
|
| 3094 |
Similarly, these considerations apply to Manifest, Object, and |
| 3095 |
SignatureProperties elements if those elements have been digested, |
| 3096 |
their DigestValue is to be checked, and they are being processed as |
| 3097 |
XML. |
| 3098 |
|
| 3099 |
The kinds of changes in XML that may need to be canonicalized can be |
| 3100 |
divided into four categories. There are those related to the basic |
| 3101 |
[<a href="#ref-XML" title=" J. Paoli">XML</a>], as described in 7.1 below. There are those related to [<a href="#ref-DOM" title="S. Byrne">DOM</a>], |
| 3102 |
[<a href="#ref-SAX">SAX</a>], or similar processing as described in 7.2 below. Third, there |
| 3103 |
is the possibility of coded character set conversion, such as between |
| 3104 |
UTF-8 and UTF-16, both of which all [<a href="#ref-XML" title=" J. Paoli">XML</a>] compliant processors are |
| 3105 |
required to support, which is described in the paragraph immediately |
| 3106 |
below. And, fourth, there are changes that related to namespace |
| 3107 |
declaration and XML namespace attribute context as described in 7.3 |
| 3108 |
below. |
| 3109 |
|
| 3110 |
Any canonicalization algorithm should yield output in a specific |
| 3111 |
fixed coded character set. All canonicalization algorithms |
| 3112 |
identified in this document use UTF-8 (without a byte order mark |
| 3113 |
(BOM)) and do not provide character normalization. We RECOMMEND that |
| 3114 |
signature applications create XML content (Signature elements and |
| 3115 |
their descendents/content) in Normalization Form C [NFC, NFC- |
| 3116 |
Corrigendum] and check that any XML being consumed is in that form as |
| 3117 |
well; (if not, signatures may consequently fail to validate). |
| 3118 |
Additionally, none of these algorithms provide data type |
| 3119 |
normalization. Applications that normalize data types in varying |
| 3120 |
formats (e.g., (true, false) or (1,0)) may not be able to validate |
| 3121 |
each other's signatures. |
| 3122 |
|
| 3123 |
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a> XML 1.0, Syntax Constraints, and Canonicalization</span> |
| 3124 |
|
| 3125 |
XML 1.0 [<a href="#ref-XML" title=" J. Paoli">XML</a>] defines an interface where a conformant application |
| 3126 |
reading XML is given certain information from that XML and not other |
| 3127 |
information. In particular, |
| 3128 |
|
| 3129 |
|
| 3130 |
|
| 3131 |
|
| 3132 |
<span class="grey">Eastlake, et al. Standards Track [Page 56]</span></pre> |
| 3133 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-57" ></span> |
| 3134 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3135 |
|
| 3136 |
|
| 3137 |
1. line endings are normalized to the single character #xA by |
| 3138 |
dropping #xD characters if they are immediately followed by a #xA |
| 3139 |
and replacing them with #xA in all other cases, |
| 3140 |
2. missing attributes declared to have default values are provided to |
| 3141 |
the application as if present with the default value, |
| 3142 |
3. character references are replaced with the corresponding |
| 3143 |
character, |
| 3144 |
4. entity references are replaced with the corresponding declared |
| 3145 |
entity, |
| 3146 |
5. attribute values are normalized by |
| 3147 |
5.1 replacing character and entity references as above, |
| 3148 |
5.2 replacing occurrences of #x9, #xA, and #xD with #x20 (space) |
| 3149 |
except that the sequence #xD#xA is replaced by a single space, |
| 3150 |
and |
| 3151 |
5.3 if the attribute is not declared to be CDATA, stripping all |
| 3152 |
leading and trailing spaces and replacing all interior runs of |
| 3153 |
spaces with a single space. |
| 3154 |
|
| 3155 |
Note that items (2), (4), and (5.3) depend on the presence of a |
| 3156 |
schema, DTD or similar declarations. The Signature element type is |
| 3157 |
laxly schema valid [<a href="#ref-XML-schema" title="N. Mendelsohn">XML-schema</a>], consequently external XML or even |
| 3158 |
XML within the same document as the signature may be (only) well- |
| 3159 |
formed or from another namespace (where permitted by the signature |
| 3160 |
schema); the noted items may not be present. Thus, a signature with |
| 3161 |
such content will only be verifiable by other signature applications |
| 3162 |
if the following syntax constraints are observed when generating any |
| 3163 |
signed material including the SignedInfo element: |
| 3164 |
|
| 3165 |
1. attributes having default values be explicitly present, |
| 3166 |
2. all entity references (except "amp", "lt", "gt", "apos", "quot", |
| 3167 |
and other character entities not representable in the encoding |
| 3168 |
chosen) be expanded, |
| 3169 |
3. attribute value white space be normalized |
| 3170 |
|
| 3171 |
<span class="h3"><a class="selflink" id="section-7.2" href="#section-7.2">7.2</a> DOM/SAX Processing and Canonicalization</span> |
| 3172 |
|
| 3173 |
In addition to the canonicalization and syntax constraints discussed |
| 3174 |
above, many XML applications use the Document Object Model [<a href="#ref-DOM" title="S. Byrne">DOM</a>] or |
| 3175 |
the Simple API for XML [<a href="#ref-SAX">SAX</a>]. DOM maps XML into a tree structure of |
| 3176 |
nodes and typically assumes it will be used on an entire document |
| 3177 |
with subsequent processing being done on this tree. SAX converts XML |
| 3178 |
into a series of events such as a start tag, content, etc. In either |
| 3179 |
case, many surface characteristics such as the ordering of attributes |
| 3180 |
and insignificant white space within start/end tags is lost. In |
| 3181 |
addition, namespace declarations are mapped over the nodes to which |
| 3182 |
they apply, losing the namespace prefixes in the source text and, in |
| 3183 |
most cases, losing where namespace declarations appeared in the |
| 3184 |
original instance. |
| 3185 |
|
| 3186 |
|
| 3187 |
|
| 3188 |
<span class="grey">Eastlake, et al. Standards Track [Page 57]</span></pre> |
| 3189 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-58" ></span> |
| 3190 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3191 |
|
| 3192 |
|
| 3193 |
If an XML Signature is to be produced or verified on a system using |
| 3194 |
DOM or SAX processing, a canonical method is needed to serialize the |
| 3195 |
relevant part of a DOM tree or sequence of SAX events. XML |
| 3196 |
canonicalization specifications, such as [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>], are based only |
| 3197 |
on information which is preserved by DOM and SAX. For an XML |
| 3198 |
Signature to be verifiable by an implementation using DOM or SAX, not |
| 3199 |
only must the XML 1.0 syntax constraints given in the previous |
| 3200 |
section be followed, but an appropriate XML canonicalization MUST be |
| 3201 |
specified so that the verifier can re-serialize DOM/SAX mediated |
| 3202 |
input into the same octet stream that was signed. |
| 3203 |
|
| 3204 |
<span class="h3"><a class="selflink" id="section-7.3" href="#section-7.3">7.3</a> Namespace Context and Portable Signatures</span> |
| 3205 |
|
| 3206 |
In [<a href="#ref-XPath">XPath</a>] and consequently the Canonical XML data model an element |
| 3207 |
has namespace nodes that correspond to those declarations within the |
| 3208 |
element and its ancestors: |
| 3209 |
|
| 3210 |
"Note: An element E has namespace nodes that represent its |
| 3211 |
namespace declarations as well as any namespace declarations made |
| 3212 |
by its ancestors that have not been overridden in E's |
| 3213 |
declarations, the default namespace if it is non-empty, and the |
| 3214 |
declaration of the prefix xml." [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>] |
| 3215 |
|
| 3216 |
When serializing a Signature element or signed XML data that's the |
| 3217 |
child of other elements using these data models, that Signature |
| 3218 |
element and its children, may contain namespace declarations from its |
| 3219 |
ancestor context. In addition, the Canonical XML and Canonical XML |
| 3220 |
with Comments algorithms import all xml namespace attributes (such as |
| 3221 |
xml:lang) from the nearest ancestor in which they are declared to the |
| 3222 |
apex node of canonicalized XML unless they are already declared at |
| 3223 |
that node. This may frustrate the intent of the signer to create a |
| 3224 |
signature in one context which remains valid in another. For |
| 3225 |
example, given a signature which is a child of B and a grandchild of |
| 3226 |
A: |
| 3227 |
|
| 3228 |
<A xmlns:n1="&foo;"> |
| 3229 |
<B xmlns:n2="&bar;"> |
| 3230 |
<Signature xmlns="&dsig;"> ... |
| 3231 |
<Reference URI="#signme"/> ... |
| 3232 |
</Signature> |
| 3233 |
<C ID="signme" xmlns="&baz;"/> |
| 3234 |
</B> |
| 3235 |
</A> |
| 3236 |
|
| 3237 |
when either the element B or the signed element C is moved into a |
| 3238 |
[<a href="#ref-SOAP" title="G. Kakivaya">SOAP</a>] envelope for transport: |
| 3239 |
|
| 3240 |
|
| 3241 |
|
| 3242 |
|
| 3243 |
|
| 3244 |
<span class="grey">Eastlake, et al. Standards Track [Page 58]</span></pre> |
| 3245 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-59" ></span> |
| 3246 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3247 |
|
| 3248 |
|
| 3249 |
<SOAP:Envelope |
| 3250 |
xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> |
| 3251 |
... |
| 3252 |
<SOAP:Body> |
| 3253 |
<B xmlns:n2="&bar;"> |
| 3254 |
<Signature xmlns="&dsig;"> |
| 3255 |
... |
| 3256 |
</Signature> |
| 3257 |
<C ID="signme" xmlns="&baz;"/> |
| 3258 |
</B> |
| 3259 |
</SOAP:Body> |
| 3260 |
</SOAP:Envelope> |
| 3261 |
|
| 3262 |
The canonical form of the signature in this context will contain new |
| 3263 |
namespace declarations from the SOAP:Envelope context, invalidating |
| 3264 |
the signature. Also, the canonical form will lack namespace |
| 3265 |
declarations it may have originally had from element A's context, |
| 3266 |
also invalidating the signature. To avoid these problems, the |
| 3267 |
application may: |
| 3268 |
|
| 3269 |
1. Rely upon the enveloping application to properly divorce its body |
| 3270 |
(the signature payload) from the context (the envelope) before the |
| 3271 |
signature is validated. Or, |
| 3272 |
2. Use a canonicalization method that "repels/excludes" instead of |
| 3273 |
"attracts" ancestor context. [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>] purposefully attracts |
| 3274 |
such context. |
| 3275 |
|
| 3276 |
<span class="h3"><a class="selflink" id="section-8.0" href="#section-8.0">8.0</a> Security Considerations</span> |
| 3277 |
|
| 3278 |
The XML Signature specification provides a very flexible digital |
| 3279 |
signature mechanism. Implementors must give consideration to their |
| 3280 |
application threat models and to the following factors. |
| 3281 |
|
| 3282 |
<span class="h3"><a class="selflink" id="section-8.1" href="#section-8.1">8.1</a> Transforms</span> |
| 3283 |
|
| 3284 |
A requirement of this specification is to permit signatures to "apply |
| 3285 |
to a part or totality of a XML document." (See [XML-Signature-RD, |
| 3286 |
<a href="#section-3.1.3">section 3.1.3</a>].) The Transforms mechanism meets this requirement by |
| 3287 |
permitting one to sign data derived from processing the content of |
| 3288 |
the identified resource. For instance, applications that wish to |
| 3289 |
sign a form, but permit users to enter a limited field data without |
| 3290 |
invalidating a previous signature on the form might use [<a href="#ref-XPath">XPath</a>] to |
| 3291 |
exclude those portions the user needs to change. Transforms may be |
| 3292 |
arbitrarily specified and may include encoding transforms, |
| 3293 |
canonicalization instructions or even XSLT transformations. Three |
| 3294 |
cautions are raised with respect to this feature in the following |
| 3295 |
sections. |
| 3296 |
|
| 3297 |
|
| 3298 |
|
| 3299 |
|
| 3300 |
<span class="grey">Eastlake, et al. Standards Track [Page 59]</span></pre> |
| 3301 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-60" ></span> |
| 3302 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3303 |
|
| 3304 |
|
| 3305 |
Note, core validation behavior does not confirm that the signed data |
| 3306 |
was obtained by applying each step of the indicated transforms. |
| 3307 |
(Though it does check that the digest of the resulting content |
| 3308 |
matches that specified in the signature.) For example, some |
| 3309 |
applications may be satisfied with verifying an XML signature over a |
| 3310 |
cached copy of already transformed data. Other applications might |
| 3311 |
require that content be freshly dereferenced and transformed. |
| 3312 |
|
| 3313 |
<span class="h4"><a class="selflink" id="section-8.1.1" href="#section-8.1.1">8.1.1</a> Only What is Signed is Secure</span> |
| 3314 |
|
| 3315 |
First, obviously, signatures over a transformed document do not |
| 3316 |
secure any information discarded by transforms: only what is signed |
| 3317 |
is secure. |
| 3318 |
|
| 3319 |
Note that the use of Canonical XML [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>] ensures that all |
| 3320 |
internal entities and XML namespaces are expanded within the content |
| 3321 |
being signed. All entities are replaced with their definitions and |
| 3322 |
the canonical form explicitly represents the namespace that an |
| 3323 |
element would otherwise inherit. Applications that do not |
| 3324 |
canonicalize XML content (especially the SignedInfo element) SHOULD |
| 3325 |
NOT use internal entities and SHOULD represent the namespace |
| 3326 |
explicitly within the content being signed since they cannot rely |
| 3327 |
upon canonicalization to do this for them. Also, users concerned |
| 3328 |
with the integrity of the element type definitions associated with |
| 3329 |
the XML instance being signed may wish to sign those definitions as |
| 3330 |
well (i.e., the schema, DTD, or natural language description |
| 3331 |
associated with the namespace/identifier). |
| 3332 |
|
| 3333 |
Second, an envelope containing signed information is not secured by |
| 3334 |
the signature. For instance, when an encrypted envelope contains a |
| 3335 |
signature, the signature does not protect the authenticity or |
| 3336 |
integrity of unsigned envelope headers nor its ciphertext form, it |
| 3337 |
only secures the plaintext actually signed. |
| 3338 |
|
| 3339 |
<span class="h4"><a class="selflink" id="section-8.1.2" href="#section-8.1.2">8.1.2</a> Only What is 'Seen' Should be Signed</span> |
| 3340 |
|
| 3341 |
Additionally, the signature secures any information introduced by the |
| 3342 |
transform: only what is "seen" (that which is represented to the user |
| 3343 |
via visual, auditory or other media) should be signed. If signing is |
| 3344 |
intended to convey the judgment or consent of a user (an automated |
| 3345 |
mechanism or person), then it is normally necessary to secure as |
| 3346 |
exactly as practical the information that was presented to that user. |
| 3347 |
Note that this can be accomplished by literally signing what was |
| 3348 |
presented, such as the screen images shown a user. However, this may |
| 3349 |
result in data which is difficult for subsequent software to |
| 3350 |
manipulate. Instead, one can sign the data along with whatever |
| 3351 |
filters, style sheets, client profile or other information that |
| 3352 |
affects its presentation. |
| 3353 |
|
| 3354 |
|
| 3355 |
|
| 3356 |
<span class="grey">Eastlake, et al. Standards Track [Page 60]</span></pre> |
| 3357 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-61" ></span> |
| 3358 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3359 |
|
| 3360 |
|
| 3361 |
<span class="h4"><a class="selflink" id="section-8.1.3" href="#section-8.1.3">8.1.3</a> 'See' What is Signed</span> |
| 3362 |
|
| 3363 |
Just as a user should only sign what he or she "sees," persons and |
| 3364 |
automated mechanism that trust the validity of a transformed document |
| 3365 |
on the basis of a valid signature should operate over the data that |
| 3366 |
was transformed (including canonicalization) and signed, not the |
| 3367 |
original pre-transformed data. This recommendation applies to |
| 3368 |
transforms specified within the signature as well as those included |
| 3369 |
as part of the document itself. For instance, if an XML document |
| 3370 |
includes an embedded style sheet [<a href="#ref-XSLT">XSLT</a>] it is the transformed |
| 3371 |
document that should be represented to the user and signed. To meet |
| 3372 |
this recommendation where a document references an external style |
| 3373 |
sheet, the content of that external resource should also be signed |
| 3374 |
via a signature Reference, otherwise the content of that external |
| 3375 |
content might change which alters the resulting document without |
| 3376 |
invalidating the signature. |
| 3377 |
|
| 3378 |
Some applications might operate over the original or intermediary |
| 3379 |
data but should be extremely careful about potential weaknesses |
| 3380 |
introduced between the original and transformed data. This is a |
| 3381 |
trust decision about the character and meaning of the transforms that |
| 3382 |
an application needs to make with caution. Consider a |
| 3383 |
canonicalization algorithm that normalizes character case (lower to |
| 3384 |
upper) or character composition ('e and accent' to 'accented-e'). An |
| 3385 |
adversary could introduce changes that are normalized and |
| 3386 |
consequently inconsequential to signature validity but material to a |
| 3387 |
DOM processor. For instance, by changing the case of a character one |
| 3388 |
might influence the result of an XPath selection. A serious risk is |
| 3389 |
introduced if that change is normalized for signature validation but |
| 3390 |
the processor operates over the original data and returns a different |
| 3391 |
result than intended. |
| 3392 |
|
| 3393 |
As a result: |
| 3394 |
|
| 3395 |
* All documents operated upon and generated by signature |
| 3396 |
applications MUST be in [<a href="#ref-NFC" title="Unicode Normalization Forms. M. Davis">NFC</a>, NFC-Corrigendum] (otherwise |
| 3397 |
intermediate processors might unintentionally break the |
| 3398 |
signature) |
| 3399 |
* Encoding normalizations SHOULD NOT be done as part of a |
| 3400 |
signature transform, or (to state it another way) if |
| 3401 |
normalization does occur, the application SHOULD always "see" |
| 3402 |
(operate over) the normalized form. |
| 3403 |
|
| 3404 |
|
| 3405 |
|
| 3406 |
|
| 3407 |
|
| 3408 |
|
| 3409 |
|
| 3410 |
|
| 3411 |
|
| 3412 |
<span class="grey">Eastlake, et al. Standards Track [Page 61]</span></pre> |
| 3413 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-62" ></span> |
| 3414 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3415 |
|
| 3416 |
|
| 3417 |
<span class="h3"><a class="selflink" id="section-8.2" href="#section-8.2">8.2</a> Check the Security Model</span> |
| 3418 |
|
| 3419 |
This specification uses public key signatures and keyed hash |
| 3420 |
authentication codes. These have substantially different security |
| 3421 |
models. Furthermore, it permits user specified algorithms which may |
| 3422 |
have other models. |
| 3423 |
|
| 3424 |
With public key signatures, any number of parties can hold the public |
| 3425 |
key and verify signatures while only the parties with the private key |
| 3426 |
can create signatures. The number of holders of the private key |
| 3427 |
should be minimized and preferably be one. Confidence by verifiers |
| 3428 |
in the public key they are using and its binding to the entity or |
| 3429 |
capabilities represented by the corresponding private key is an |
| 3430 |
important issue, usually addressed by certificate or online authority |
| 3431 |
systems. |
| 3432 |
|
| 3433 |
Keyed hash authentication codes, based on secret keys, are typically |
| 3434 |
much more efficient in terms of the computational effort required but |
| 3435 |
have the characteristic that all verifiers need to have possession of |
| 3436 |
the same key as the signer. Thus any verifier can forge signatures. |
| 3437 |
|
| 3438 |
This specification permits user provided signature algorithms and |
| 3439 |
keying information designators. Such user provided algorithms may |
| 3440 |
have different security models. For example, methods involving |
| 3441 |
biometrics usually depend on a physical characteristic of the |
| 3442 |
authorized user that can not be changed the way public or secret keys |
| 3443 |
can be and may have other security model differences. |
| 3444 |
|
| 3445 |
<span class="h3"><a class="selflink" id="section-8.3" href="#section-8.3">8.3</a> Algorithms, Key Lengths, Certificates, Etc.</span> |
| 3446 |
|
| 3447 |
The strength of a particular signature depends on all links in the |
| 3448 |
security chain. This includes the signature and digest algorithms |
| 3449 |
used, the strength of the key generation [<a href="#ref-RANDOM" title=""Randomness Recommendations for Security"">RANDOM</a>] and the size of the |
| 3450 |
key, the security of key and certificate authentication and |
| 3451 |
distribution mechanisms, certificate chain validation policy, |
| 3452 |
protection of cryptographic processing from hostile observation and |
| 3453 |
tampering, etc. |
| 3454 |
|
| 3455 |
Care must be exercised by applications in executing the various |
| 3456 |
algorithms that may be specified in an XML signature and in the |
| 3457 |
processing of any "executable content" that might be provided to such |
| 3458 |
algorithms as parameters, such as XSLT transforms. The algorithms |
| 3459 |
specified in this document will usually be implemented via a trusted |
| 3460 |
library, but even there perverse parameters might cause unacceptable |
| 3461 |
processing or memory demand. Even more care may be warranted with |
| 3462 |
application defined algorithms. |
| 3463 |
|
| 3464 |
|
| 3465 |
|
| 3466 |
|
| 3467 |
|
| 3468 |
<span class="grey">Eastlake, et al. Standards Track [Page 62]</span></pre> |
| 3469 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-63" ></span> |
| 3470 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3471 |
|
| 3472 |
|
| 3473 |
The security of an overall system will also depend on the security |
| 3474 |
and integrity of its operating procedures, its personnel, and on the |
| 3475 |
administrative enforcement of those procedures. All the factors |
| 3476 |
listed in this section are important to the overall security of a |
| 3477 |
system; however, most are beyond the scope of this specification. |
| 3478 |
|
| 3479 |
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. Schema, DTD, Data Model, and Valid Examples</span> |
| 3480 |
|
| 3481 |
XML Signature Schema Instance |
| 3482 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-core-schema.xsd">http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-core-</a> |
| 3483 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-core-schema.xsd">schema.xsd</a> |
| 3484 |
Valid XML schema instance based on the 20001024 Schema/DTD |
| 3485 |
[XML-Schema]. |
| 3486 |
|
| 3487 |
XML Signature DTD |
| 3488 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-core-schema.dtd">http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-core-</a> |
| 3489 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-core-schema.dtd">schema.dtd</a> |
| 3490 |
|
| 3491 |
RDF Data Model |
| 3492 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-datamodel-20000112.gif">http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-datamodel-</a> |
| 3493 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/xmldsig-datamodel-20000112.gif">20000112.gif</a> |
| 3494 |
|
| 3495 |
XML Signature Object Example |
| 3496 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/signature-example.xml">http://www.w3.org/Signature/Drafts/xmldsig-core/signature-example.xml</a> |
| 3497 |
A cryptographical fabricated XML example that includes foreign |
| 3498 |
content and validates under the schema, it also uses schemaLocation |
| 3499 |
to aid automated schema fetching and validation. |
| 3500 |
|
| 3501 |
RSA XML Signature Example |
| 3502 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/signature-example-rsa.xml">http://www.w3.org/Signature/Drafts/xmldsig-core/signature-example-</a> |
| 3503 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/signature-example-rsa.xml">rsa.xml</a> |
| 3504 |
An XML Signature example with generated cryptographic values by |
| 3505 |
Merlin Hughes and validated by Gregor Karlinger. |
| 3506 |
|
| 3507 |
DSA XML Signature Example |
| 3508 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/signature-example-dsa.xml">http://www.w3.org/Signature/Drafts/xmldsig-core/signature-example-</a> |
| 3509 |
<a href="http://www.w3.org/Signature/Drafts/xmldsig-core/signature-example-dsa.xml">dsa.xml</a> |
| 3510 |
Similar to above but uses DSA. |
| 3511 |
|
| 3512 |
<span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. Definitions</span> |
| 3513 |
|
| 3514 |
Authentication Code (Protected Checksum) |
| 3515 |
A value generated from the application of a shared key to a |
| 3516 |
message via a cryptographic algorithm such that it has the |
| 3517 |
properties of message authentication (and integrity) but not |
| 3518 |
signer authentication. Equivalent to protected checksum, "A |
| 3519 |
|
| 3520 |
|
| 3521 |
|
| 3522 |
|
| 3523 |
|
| 3524 |
<span class="grey">Eastlake, et al. Standards Track [Page 63]</span></pre> |
| 3525 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-64" ></span> |
| 3526 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3527 |
|
| 3528 |
|
| 3529 |
checksum that is computed for a data object by means that protect |
| 3530 |
against active attacks that would attempt to change the checksum |
| 3531 |
to make it match changes made to the data object." [<a href="#ref-SEC" title=""Internet Security Glossary"">SEC</a>] |
| 3532 |
|
| 3533 |
Authentication, Message |
| 3534 |
The property, given an authentication code/protected checksum, |
| 3535 |
that tampering with both the data and checksum, so as to introduce |
| 3536 |
changes while seemingly preserving integrity, are still detected. |
| 3537 |
"A signature should identify what is signed, making it |
| 3538 |
impracticable to falsify or alter either the signed matter or the |
| 3539 |
signature without detection." [Digital Signature Guidelines, ABA]. |
| 3540 |
Authentication, Signer |
| 3541 |
The property of the identity of the signer is as claimed. "A |
| 3542 |
signature should indicate who signed a document, message or |
| 3543 |
record, and should be difficult for another person to produce |
| 3544 |
without authorization." [Digital Signature Guidelines, ABA] Note, |
| 3545 |
signer authentication is an application decision (e.g., does the |
| 3546 |
signing key actually correspond to a specific identity) that is |
| 3547 |
supported by, but out of the scope of, this specification. |
| 3548 |
Checksum |
| 3549 |
"A value that (a) is computed by a function that is dependent on |
| 3550 |
the contents of a data object and (b) is stored or transmitted |
| 3551 |
together with the object, for the purpose of detecting changes in |
| 3552 |
the data." [<a href="#ref-SEC" title=""Internet Security Glossary"">SEC</a>] |
| 3553 |
Core |
| 3554 |
The syntax and processing defined by this specification, including |
| 3555 |
core validation. We use this term to distinguish other markup, |
| 3556 |
processing, and applications semantics from our own. |
| 3557 |
Data Object (Content/Document) |
| 3558 |
The actual binary/octet data being operated on (transformed, |
| 3559 |
digested, or signed) by an application -- frequently an HTTP |
| 3560 |
entity [<a href="#ref-HTTP" title=""Hypertext Transfer Protocol -- HTTP/1.1"">HTTP</a>]. Note that the proper noun Object designates a |
| 3561 |
specific XML element. Occasionally we refer to a data object as a |
| 3562 |
document or as a resource's content. The term element content is |
| 3563 |
used to describe the data between XML start and end tags [<a href="#ref-XML" title=" J. Paoli">XML</a>]. |
| 3564 |
The term XML document is used to describe data objects which |
| 3565 |
conform to the XML specification [<a href="#ref-XML" title=" J. Paoli">XML</a>]. |
| 3566 |
Integrity |
| 3567 |
"The property that data has not been changed, destroyed, or lost |
| 3568 |
in an unauthorized or accidental manner." [<a href="#ref-SEC" title=""Internet Security Glossary"">SEC</a>] A simple checksum |
| 3569 |
can provide integrity from incidental changes in the data; message |
| 3570 |
authentication is similar but also protects against an active |
| 3571 |
attack to alter the data whereby a change in the checksum is |
| 3572 |
introduced so as to match the change in the data. |
| 3573 |
Object |
| 3574 |
An XML Signature element wherein arbitrary (non-core) data may be |
| 3575 |
placed. An Object element is merely one type of digital data (or |
| 3576 |
document) that can be signed via a Reference. |
| 3577 |
|
| 3578 |
|
| 3579 |
|
| 3580 |
<span class="grey">Eastlake, et al. Standards Track [Page 64]</span></pre> |
| 3581 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-65" ></span> |
| 3582 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3583 |
|
| 3584 |
|
| 3585 |
Resource |
| 3586 |
"A resource can be anything that has identity. Familiar examples |
| 3587 |
include an electronic document, an image, a service (e.g., |
| 3588 |
'today's weather report for Los Angeles'), and a collection of |
| 3589 |
other resources.... The resource is the conceptual mapping to an |
| 3590 |
entity or set of entities, not necessarily the entity which |
| 3591 |
corresponds to that mapping at any particular instance in time. |
| 3592 |
Thus, a resource can remain constant even when its content---the |
| 3593 |
entities to which it currently corresponds---changes over time, |
| 3594 |
provided that the conceptual mapping is not changed in the |
| 3595 |
process." [<a href="#ref-URI" title=""Uniform Resource Identifiers (URI): Generic Syntax"">URI</a>] In order to avoid a collision of the term entity |
| 3596 |
within the URI and XML specifications, we use the term data |
| 3597 |
object, content or document to refer to the actual bits/octets |
| 3598 |
being operated upon. |
| 3599 |
Signature |
| 3600 |
Formally speaking, a value generated from the application of a |
| 3601 |
private key to a message via a cryptographic algorithm such that |
| 3602 |
it has the properties of integrity, message authentication and/or |
| 3603 |
signer authentication. (However, we sometimes use the term |
| 3604 |
signature generically such that it encompasses Authentication Code |
| 3605 |
values as well, but we are careful to make the distinction when |
| 3606 |
the property of signer authentication is relevant to the |
| 3607 |
exposition.) A signature may be (non-exclusively) described as |
| 3608 |
detached, enveloping, or enveloped. |
| 3609 |
Signature, Application |
| 3610 |
An application that implements the MANDATORY (REQUIRED/MUST) |
| 3611 |
portions of this specification; these conformance requirements are |
| 3612 |
over application behavior, the structure of the Signature element |
| 3613 |
type and its children (including SignatureValue) and the specified |
| 3614 |
algorithms. |
| 3615 |
Signature, Detached |
| 3616 |
The signature is over content external to the Signature element, |
| 3617 |
and can be identified via a URI or transform. Consequently, the |
| 3618 |
signature is "detached" from the content it signs. This |
| 3619 |
definition typically applies to separate data objects, but it also |
| 3620 |
includes the instance where the Signature and data object reside |
| 3621 |
within the same XML document but are sibling elements. |
| 3622 |
Signature, Enveloping |
| 3623 |
The signature is over content found within an Object element of |
| 3624 |
the signature itself. The Object (or its content) is identified |
| 3625 |
via a Reference (via a URI fragment identifier or transform). |
| 3626 |
Signature, Enveloped |
| 3627 |
The signature is over the XML content that contains the signature |
| 3628 |
as an element. The content provides the root XML document |
| 3629 |
element. Obviously, enveloped signatures must take care not to |
| 3630 |
include their own value in the calculation of the SignatureValue. |
| 3631 |
|
| 3632 |
|
| 3633 |
|
| 3634 |
|
| 3635 |
|
| 3636 |
<span class="grey">Eastlake, et al. Standards Track [Page 65]</span></pre> |
| 3637 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-66" ></span> |
| 3638 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3639 |
|
| 3640 |
|
| 3641 |
Transform |
| 3642 |
The processing of a data from its source to its derived form. |
| 3643 |
Typical transforms include XML Canonicalization, XPath, and XSLT. |
| 3644 |
Validation, Core |
| 3645 |
The core processing requirements of this specification requiring |
| 3646 |
signature validation and SignedInfo reference validation. |
| 3647 |
Validation, Reference |
| 3648 |
The hash value of the identified and transformed content, |
| 3649 |
specified by Reference, matches its specified DigestValue. |
| 3650 |
Validation, Signature |
| 3651 |
The SignatureValue matches the result of processing SignedInfo |
| 3652 |
with CanonicalizationMethod and SignatureMethod as specified in |
| 3653 |
Core Validation (<a href="#section-3.2">section 3.2</a>). |
| 3654 |
Validation, Trust/Application |
| 3655 |
The application determines that the semantics associated with a |
| 3656 |
signature are valid. For example, an application may validate the |
| 3657 |
time stamps or the integrity of the signer key -- though this |
| 3658 |
behavior is external to this core specification. |
| 3659 |
|
| 3660 |
|
| 3661 |
|
| 3662 |
|
| 3663 |
|
| 3664 |
|
| 3665 |
|
| 3666 |
|
| 3667 |
|
| 3668 |
|
| 3669 |
|
| 3670 |
|
| 3671 |
|
| 3672 |
|
| 3673 |
|
| 3674 |
|
| 3675 |
|
| 3676 |
|
| 3677 |
|
| 3678 |
|
| 3679 |
|
| 3680 |
|
| 3681 |
|
| 3682 |
|
| 3683 |
|
| 3684 |
|
| 3685 |
|
| 3686 |
|
| 3687 |
|
| 3688 |
|
| 3689 |
|
| 3690 |
|
| 3691 |
|
| 3692 |
<span class="grey">Eastlake, et al. Standards Track [Page 66]</span></pre> |
| 3693 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-67" ></span> |
| 3694 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3695 |
|
| 3696 |
|
| 3697 |
Appendix: Changes from <a href="./rfc3075">RFC 3075</a> |
| 3698 |
|
| 3699 |
Numerous minor editorial changes were made. In addition, the |
| 3700 |
following substantive changes have occurred based on interoperation |
| 3701 |
experience or other considerations: |
| 3702 |
|
| 3703 |
1. Minor but incompatible changes in the representation of DSA keys. |
| 3704 |
In particular, the optionality of several fields was changed and |
| 3705 |
two fields were re-ordered. |
| 3706 |
|
| 3707 |
2. Minor change in the X509Data KeyInfo structure to allow multiple |
| 3708 |
CRLs to be grouped with certificates and other X509 information. |
| 3709 |
Previously CRLs had to occur singly and each in a separate |
| 3710 |
X509Data structure. |
| 3711 |
|
| 3712 |
3. Incompatible change in the type of PGPKeyID, which had previously |
| 3713 |
been string, to the more correct base64Binary since it is actually |
| 3714 |
a binary quantity. |
| 3715 |
|
| 3716 |
4. Several warnings have been added. Of particular note, because it |
| 3717 |
reflects a problem actually encountered in use and is the only |
| 3718 |
warning added that has its own little section, is the warning of |
| 3719 |
canonicalization problems when the namespace context of signed |
| 3720 |
material changes. |
| 3721 |
|
| 3722 |
References |
| 3723 |
|
| 3724 |
[<a id="ref-ABA">ABA</a>] Digital Signature Guidelines. |
| 3725 |
<a href="http://www.abanet.org/scitech/ec/isc/dsgfree.html">http://www.abanet.org/scitech/ec/isc/dsgfree.html</a> |
| 3726 |
|
| 3727 |
[<a id="ref-DOM">DOM</a>] Document Object Model (DOM) Level 1 Specification. |
| 3728 |
W3C Recommendation. V. Apparao, S. Byrne, M. |
| 3729 |
Champion, S. Isaacs, I. Jacobs, A. Le Hors, G. |
| 3730 |
Nicol, J. Robie, R. Sutor, C. Wilson, L. Wood. |
| 3731 |
October 1998. |
| 3732 |
<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/">http://www.w3.org/TR/1998/REC-DOM-Level-1-</a> |
| 3733 |
<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/">19981001/</a> |
| 3734 |
|
| 3735 |
[<a id="ref-DSS">DSS</a>] FIPS PUB 186-2 . Digital Signature Standard (DSS). |
| 3736 |
U.S. Department of Commerce/National Institute of |
| 3737 |
Standards and Technology. |
| 3738 |
<a href="http://csrc.nist.gov/publications/fips/fips186-2/fips186-2.pdf">http://csrc.nist.gov/publications/fips/fips186-</a> |
| 3739 |
<a href="http://csrc.nist.gov/publications/fips/fips186-2/fips186-2.pdf">2/fips186-2.pdf</a> |
| 3740 |
|
| 3741 |
[<a id="ref-HMAC">HMAC</a>] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: |
| 3742 |
Keyed-Hashing for Message Authentication", <a href="./rfc2104">RFC</a> |
| 3743 |
<a href="./rfc2104">2104</a>, February 1997. |
| 3744 |
|
| 3745 |
|
| 3746 |
|
| 3747 |
|
| 3748 |
<span class="grey">Eastlake, et al. Standards Track [Page 67]</span></pre> |
| 3749 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-68" ></span> |
| 3750 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3751 |
|
| 3752 |
|
| 3753 |
[<a id="ref-HTTP">HTTP</a>] Fielding, R. Gettys, J., Mogul, J., Frystyk, H., |
| 3754 |
Masinter, L., Leach, P. and T. Berners-Lee, |
| 3755 |
"Hypertext Transfer Protocol -- HTTP/1.1", <a href="./rfc2616">RFC</a> |
| 3756 |
<a href="./rfc2616">2616</a>, June 1999. |
| 3757 |
|
| 3758 |
[<a id="ref-KEYWORDS">KEYWORDS</a>] Bradner, S., "Key words for use in RFCs to |
| 3759 |
Indicate Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, |
| 3760 |
March 1997. |
| 3761 |
|
| 3762 |
[<a id="ref-LDAP-DN">LDAP-DN</a>] Wahl, M., Kille, S. and T. Howes, "Lightweight |
| 3763 |
Directory Access Protocol (v3): UTF-8 String |
| 3764 |
Representation of Distinguished Names", <a href="./rfc2253">RFC 2253</a>, |
| 3765 |
December 1997. |
| 3766 |
|
| 3767 |
[<a id="ref-MD5">MD5</a>] Rivest, R., "The MD5 Message-Digest Algorithm", |
| 3768 |
<a href="./rfc1321">RFC 1321</a>, April 1992. |
| 3769 |
|
| 3770 |
[<a id="ref-MIME">MIME</a>] Freed, N. and N. Borenstein, "Multipurpose |
| 3771 |
Internet Mail Extensions (MIME) Part One: Format |
| 3772 |
of Internet Message Bodies", <a href="./rfc2045">RFC 2045</a>, November |
| 3773 |
1996. |
| 3774 |
|
| 3775 |
[<a id="ref-NFC">NFC</a>] TR15, Unicode Normalization Forms. M. Davis, M. |
| 3776 |
Drst. Revision 18: November 1999. |
| 3777 |
<a href="http://www.unicode.org/unicode/reports/tr15/tr15-18.html">http://www.unicode.org/unicode/reports/tr15/tr15-</a> |
| 3778 |
<a href="http://www.unicode.org/unicode/reports/tr15/tr15-18.html">18.html</a>. NFC-Corrigendum Normalization |
| 3779 |
Corrigendum. The Unicode Consortium. |
| 3780 |
<a href="http://www.unicode.org/unicode/uni2errata/Normalization_Corrigendum.html">http://www.unicode.org/unicode/uni2errata/</a> |
| 3781 |
<a href="http://www.unicode.org/unicode/uni2errata/Normalization_Corrigendum.html">Normalization_Corrigendum.html</a>. |
| 3782 |
|
| 3783 |
[<a id="ref-PGP">PGP</a>] Callas, J., Donnerhacke, L., Finney, H. and R. |
| 3784 |
Thayer, "OpenPGP Message Format", <a href="./rfc2440">RFC 2440</a>, |
| 3785 |
November 1998. |
| 3786 |
|
| 3787 |
[<a id="ref-RANDOM">RANDOM</a>] Eastlake, 3rd, D., Crocker, S. and J. Schiller, |
| 3788 |
"Randomness Recommendations for Security", <a href="./rfc1750">RFC</a> |
| 3789 |
<a href="./rfc1750">1750</a>, December 1994. |
| 3790 |
|
| 3791 |
[<a id="ref-RDF">RDF</a>] Resource Description Framework (RDF) Schema |
| 3792 |
Specification 1.0. W3C Candidate Recommendation. |
| 3793 |
D. Brickley, R.V. Guha. March 2000. |
| 3794 |
<a href="http://www.w3.org/TR/2000/CR-rdf-schema-20000327/Resource">http://www.w3.org/TR/2000/CR-rdf-schema-20000327/</a> |
| 3795 |
<a href="http://www.w3.org/TR/2000/CR-rdf-schema-20000327/Resource">Resource</a> Description Framework (RDF) Model and |
| 3796 |
Syntax Specification. W3C Recommendation. O. |
| 3797 |
Lassila, R. Swick. February 1999. |
| 3798 |
<a href="http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/">http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/</a> |
| 3799 |
|
| 3800 |
|
| 3801 |
|
| 3802 |
|
| 3803 |
|
| 3804 |
<span class="grey">Eastlake, et al. Standards Track [Page 68]</span></pre> |
| 3805 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-69" ></span> |
| 3806 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3807 |
|
| 3808 |
|
| 3809 |
[<a id="ref-1363">1363</a>] IEEE 1363: Standard Specifications for Public Key |
| 3810 |
Cryptography. August 2000. |
| 3811 |
|
| 3812 |
[<a id="ref-PKCS1">PKCS1</a>] Kaliski, B. and J. Staddon, "PKCS #1: RSA |
| 3813 |
Cryptography Specifications Version 2.0", <a href="./rfc2437">RFC</a> |
| 3814 |
<a href="./rfc2437">2437</a>, October 1998. |
| 3815 |
|
| 3816 |
[<a id="ref-SAX">SAX</a>] SAX: The Simple API for XML. D. Megginson, et al. |
| 3817 |
May 1998. <a href="http://www.megginson.com/SAX/index.html">http://www.megginson.com/SAX/index.html</a> |
| 3818 |
(THIS PAGE OUT OF DATE; GO TO www.saxproject.org) |
| 3819 |
|
| 3820 |
[<a id="ref-SEC">SEC</a>] Shirey, R., "Internet Security Glossary", FYI 36, |
| 3821 |
<a href="./rfc2828">RFC 2828</a>, May 2000. |
| 3822 |
|
| 3823 |
[<a id="ref-SHA-1">SHA-1</a>] FIPS PUB 180-1. Secure Hash Standard. U.S. |
| 3824 |
Department of Commerce/National Institute of |
| 3825 |
Standards and Technology. |
| 3826 |
<a href="http://csrc.nist.gov/publications/fips/fips180-1/fip180-1.txt">http://csrc.nist.gov/publications/fips/fips180-</a> |
| 3827 |
<a href="http://csrc.nist.gov/publications/fips/fips180-1/fip180-1.txt">1/fip180-1.txt</a> |
| 3828 |
|
| 3829 |
[<a id="ref-SOAP">SOAP</a>] Simple Object Access Protocol (SOAP) Version 1.1. |
| 3830 |
W3C Note. D. Box, D. Ehnebuske, G. Kakivaya, A. |
| 3831 |
Layman, N. Mendelsohn, H. Frystyk Nielsen, S. |
| 3832 |
Thatte, D. Winer. May 2001. |
| 3833 |
<a href="http://www.w3.org/TR/2000/NOTE-SOAP-20000508/">http://www.w3.org/TR/2000/NOTE-SOAP-20000508/</a> |
| 3834 |
|
| 3835 |
[<a id="ref-Unicode">Unicode</a>] The Unicode Consortium. The Unicode Standard. |
| 3836 |
<a href="http://www.unicode.org/unicode/standard/standard.html">http://www.unicode.org/unicode/standard/</a> |
| 3837 |
<a href="http://www.unicode.org/unicode/standard/standard.html">standard.html</a> |
| 3838 |
|
| 3839 |
[<a id="ref-UTF-16">UTF-16</a>] Hoffman, P. and F. Yergeau, "UTF-16, an encoding |
| 3840 |
of ISO 10646", <a href="./rfc2781">RFC 2781</a>, February 2000. |
| 3841 |
|
| 3842 |
[<a id="ref-UTF-8">UTF-8</a>] Yergeau, R., "UTF-8, a transformation format of |
| 3843 |
ISO 10646", <a href="./rfc2279">RFC 2279</a>, January 1998. |
| 3844 |
|
| 3845 |
[<a id="ref-URI">URI</a>] Berners-Lee, T., Fielding, R. and L. Masinter, |
| 3846 |
"Uniform Resource Identifiers (URI): Generic |
| 3847 |
Syntax", <a href="./rfc2396">RFC 2396</a>, August 1998. |
| 3848 |
|
| 3849 |
[<a id="ref-URI-Literal">URI-Literal</a>] Hinden, R., Carpenter, B. and L. Masinter, "Format |
| 3850 |
for Literal IPv6 Addresses in URL's", <a href="./rfc2732">RFC 2732</a>, |
| 3851 |
December 1999. |
| 3852 |
|
| 3853 |
|
| 3854 |
|
| 3855 |
|
| 3856 |
|
| 3857 |
|
| 3858 |
|
| 3859 |
|
| 3860 |
<span class="grey">Eastlake, et al. Standards Track [Page 69]</span></pre> |
| 3861 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-70" ></span> |
| 3862 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3863 |
|
| 3864 |
|
| 3865 |
[<a id="ref-URL">URL</a>] Berners-Lee, T., Masinter, L. and M. McCahill, |
| 3866 |
"Uniform Resource Locators (URL)", <a href="./rfc1738">RFC 1738</a>, |
| 3867 |
December 1994. |
| 3868 |
|
| 3869 |
[<a id="ref-URN">URN</a>] Moats, R., "URN Syntax", <a href="./rfc2141">RFC 2141</a>, May 1997. |
| 3870 |
|
| 3871 |
[<a id="ref-X509v3">X509v3</a>] ITU-T Recommendation X.509 version 3 (1997). |
| 3872 |
"Information Technology - Open Systems |
| 3873 |
Interconnection - The Directory Authentication |
| 3874 |
Framework" ISO/IEC 9594-8:1997. |
| 3875 |
|
| 3876 |
[XHTML 1.0] XHTML(tm) 1.0: The Extensible Hypertext Markup |
| 3877 |
Language. W3C Recommendation. S. Pemberton, D. |
| 3878 |
Raggett, et al. January 2000. |
| 3879 |
<a href="http://www.w3.org/TR/2000/REC-xhtml1-20000126/">http://www.w3.org/TR/2000/REC-xhtml1-20000126/</a> |
| 3880 |
|
| 3881 |
[<a id="ref-XLink">XLink</a>] XML Linking Language. W3C Recommendation. S. |
| 3882 |
DeRose, E. Maler, D. Orchard. June 2001. |
| 3883 |
<a href="http://www.w3.org/TR/2000/REC-xlink-20010627/">http://www.w3.org/TR/2000/REC-xlink-20010627/</a> |
| 3884 |
|
| 3885 |
[<a id="ref-XML">XML</a>] Extensible Markup Language (XML) 1.0 (Second |
| 3886 |
Edition). W3C Recommendation. T. Bray, E. Maler, |
| 3887 |
J. Paoli, C. M. Sperberg-McQueen. October 2000. |
| 3888 |
<a href="http://www.w3.org/TR/2000/REC-xml-20001006">http://www.w3.org/TR/2000/REC-xml-20001006</a> |
| 3889 |
|
| 3890 |
[<a id="ref-XML-C14N">XML-C14N</a>] Boyer, J., "Canonical XML Version 1.0", <a href="./rfc3076">RFC 3076</a>, |
| 3891 |
March 2001. |
| 3892 |
|
| 3893 |
[<a id="ref-XML-Japanese">XML-Japanese</a>] XML Japanese Profile. W3C Note. M. Murata April |
| 3894 |
2000 <a href="http://www.w3.org/TR/2000/NOTE-japanese-xml-20000414/">http://www.w3.org/TR/2000/NOTE-japanese-xml-</a> |
| 3895 |
<a href="http://www.w3.org/TR/2000/NOTE-japanese-xml-20000414/">20000414/</a> |
| 3896 |
|
| 3897 |
[<a id="ref-XML-MT">XML-MT</a>] Whitehead, E. and M. Murata, "XML Media Types", |
| 3898 |
<a href="./rfc2376">RFC 2376</a>, July 1998. |
| 3899 |
|
| 3900 |
[<a id="ref-XML-ns">XML-ns</a>] Namespaces in XML. W3C Recommendation. T. Bray, D. |
| 3901 |
Hollander, A. Layman. January 1999. |
| 3902 |
<a href="http://www.w3.org/TR/1999/REC-xml-names-19990114">http://www.w3.org/TR/1999/REC-xml-names-19990114</a> |
| 3903 |
|
| 3904 |
|
| 3905 |
|
| 3906 |
|
| 3907 |
|
| 3908 |
|
| 3909 |
|
| 3910 |
|
| 3911 |
|
| 3912 |
|
| 3913 |
|
| 3914 |
|
| 3915 |
|
| 3916 |
<span class="grey">Eastlake, et al. Standards Track [Page 70]</span></pre> |
| 3917 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-71" ></span> |
| 3918 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3919 |
|
| 3920 |
|
| 3921 |
[<a id="ref-XML-schema">XML-schema</a>] XML Schema Part 1: Structures. W3C Recommendation. |
| 3922 |
D. Beech, M. Maloney, N. Mendelsohn, H. Thompson. |
| 3923 |
May 2001. <a href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">http://www.w3.org/TR/2001/REC-</a> |
| 3924 |
<a href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">xmlschema-1-20010502/</a> XML Schema Part 2: Datatypes |
| 3925 |
W3C Recommendation. P. Biron, A. Malhotra. May |
| 3926 |
2001. <a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">http://www.w3.org/TR/2001/REC-xmlschema-2-</a> |
| 3927 |
<a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">20010502/</a> |
| 3928 |
|
| 3929 |
[<a id="ref-XML-Signature-RD">XML-Signature-RD</a>] Reagle, J., "XML Signature Requirements", <a href="./rfc2807">RFC</a> |
| 3930 |
<a href="./rfc2807">2807</a>, July 2000. |
| 3931 |
|
| 3932 |
[<a id="ref-XPath">XPath</a>] XML Path Language (XPath) Version 1.0. W3C |
| 3933 |
Recommendation. J. Clark, S. DeRose. October 1999. |
| 3934 |
<a href="http://www.w3.org/TR/1999/REC-xpath-19991116">http://www.w3.org/TR/1999/REC-xpath-19991116</a> |
| 3935 |
|
| 3936 |
[<a id="ref-XPointer">XPointer</a>] XML Pointer Language (XPointer). W3C Working |
| 3937 |
Draft. S. DeRose, R. Daniel, E. Maler. January |
| 3938 |
2001. <a href="http://www.w3.org/TR/2001/WD-xptr-20010108">http://www.w3.org/TR/2001/WD-xptr-20010108</a> |
| 3939 |
|
| 3940 |
[<a id="ref-XSL">XSL</a>] Extensible Stylesheet Language (XSL). W3C Proposed |
| 3941 |
Recommendation. S. Adler, A. Berglund, J. Caruso, |
| 3942 |
S. Deach, P. Grosso, E. Gutentag, A. Milowski, S. |
| 3943 |
Parnell, J. Richman, S. Zilles. August 2001. |
| 3944 |
<a href="http://www.w3.org/TR/2001/PR-xsl-20010828/">http://www.w3.org/TR/2001/PR-xsl-20010828/</a> |
| 3945 |
|
| 3946 |
[<a id="ref-XSLT">XSLT</a>] XSL Transforms (XSLT) Version 1.0. W3C |
| 3947 |
Recommendation. J. Clark. November 1999. |
| 3948 |
<a href="http://www.w3.org/TR/1999/REC-xslt-19991116.html">http://www.w3.org/TR/1999/REC-xslt-19991116.html</a> |
| 3949 |
|
| 3950 |
|
| 3951 |
|
| 3952 |
|
| 3953 |
|
| 3954 |
|
| 3955 |
|
| 3956 |
|
| 3957 |
|
| 3958 |
|
| 3959 |
|
| 3960 |
|
| 3961 |
|
| 3962 |
|
| 3963 |
|
| 3964 |
|
| 3965 |
|
| 3966 |
|
| 3967 |
|
| 3968 |
|
| 3969 |
|
| 3970 |
|
| 3971 |
|
| 3972 |
<span class="grey">Eastlake, et al. Standards Track [Page 71]</span></pre> |
| 3973 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-72" ></span> |
| 3974 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 3975 |
|
| 3976 |
|
| 3977 |
Authors' Addresses |
| 3978 |
|
| 3979 |
Donald E. Eastlake 3rd |
| 3980 |
Motorola, 20 Forbes Boulevard |
| 3981 |
Mansfield, MA 02048 USA |
| 3982 |
|
| 3983 |
Phone: 1-508-851-8280 |
| 3984 |
EMail: [email protected] |
| 3985 |
|
| 3986 |
|
| 3987 |
Joseph M. Reagle Jr., W3C |
| 3988 |
Massachusetts Institute of Technology |
| 3989 |
Laboratory for Computer Science |
| 3990 |
NE43-350, 545 Technology Square |
| 3991 |
Cambridge, MA 02139 |
| 3992 |
|
| 3993 |
Phone: +1.617.258.7621 |
| 3994 |
EMail: [email protected] |
| 3995 |
|
| 3996 |
|
| 3997 |
David Solo |
| 3998 |
Citigroup |
| 3999 |
909 Third Ave, 16th Floor |
| 4000 |
NY, NY 10043 USA |
| 4001 |
|
| 4002 |
Phone +1-212-559-2900 |
| 4003 |
EMail: [email protected] |
| 4004 |
|
| 4005 |
|
| 4006 |
|
| 4007 |
|
| 4008 |
|
| 4009 |
|
| 4010 |
|
| 4011 |
|
| 4012 |
|
| 4013 |
|
| 4014 |
|
| 4015 |
|
| 4016 |
|
| 4017 |
|
| 4018 |
|
| 4019 |
|
| 4020 |
|
| 4021 |
|
| 4022 |
|
| 4023 |
|
| 4024 |
|
| 4025 |
|
| 4026 |
|
| 4027 |
|
| 4028 |
<span class="grey">Eastlake, et al. Standards Track [Page 72]</span></pre> |
| 4029 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-73" ></span> |
| 4030 |
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span> |
| 4031 |
|
| 4032 |
|
| 4033 |
Full Copyright Statement |
| 4034 |
|
| 4035 |
Copyright (c) 2002 The Internet Society & W3C (MIT, INRIA, Keio), All |
| 4036 |
Rights Reserved. |
| 4037 |
|
| 4038 |
This document and translations of it may be copied and furnished to |
| 4039 |
others, and derivative works that comment on or otherwise explain it |
| 4040 |
or assist in its implementation may be prepared, copied, published |
| 4041 |
and distributed, in whole or in part, without restriction of any |
| 4042 |
kind, provided that the above copyright notice and this paragraph are |
| 4043 |
included on all such copies and derivative works. However, this |
| 4044 |
document itself may not be modified in any way, such as by removing |
| 4045 |
the copyright notice or references to the Internet Society or other |
| 4046 |
Internet organizations, except as needed for the purpose of |
| 4047 |
developing Internet standards in which case the procedures for |
| 4048 |
copyrights defined in the Internet Standards process must be |
| 4049 |
followed, or as required to translate it into languages other than |
| 4050 |
English. |
| 4051 |
|
| 4052 |
The limited permissions granted above are perpetual and will not be |
| 4053 |
revoked by the Internet Society or its successors or assigns. |
| 4054 |
|
| 4055 |
This document and the information contained herein is provided on an |
| 4056 |
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING |
| 4057 |
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING |
| 4058 |
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION |
| 4059 |
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF |
| 4060 |
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. |
| 4061 |
|
| 4062 |
Acknowledgement |
| 4063 |
|
| 4064 |
Funding for the RFC Editor function is currently provided by the |
| 4065 |
Internet Society. |
| 4066 |
|
| 4067 |
|
| 4068 |
|
| 4069 |
|
| 4070 |
|
| 4071 |
|
| 4072 |
|
| 4073 |
|
| 4074 |
|
| 4075 |
|
| 4076 |
|
| 4077 |
|
| 4078 |
|
| 4079 |
|
| 4080 |
|
| 4081 |
|
| 4082 |
|
| 4083 |
|
| 4084 |
Eastlake, et al. Standards Track [Page 73] |
| 4085 |
</pre> |