-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRFC 3275_ (Extensible Markup Language) XML-Signature Syntax and Processing.html
More file actions
4251 lines (3129 loc) · 208 KB
/
Copy pathRFC 3275_ (Extensible Markup Language) XML-Signature Syntax and Processing.html
File metadata and controls
4251 lines (3129 loc) · 208 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="index,follow" />
<meta name="creator" content="rfchandler version 0.2" />
<meta name="citation_author" content="D. Eastlake 3rd"/>
<meta name="citation_author" content="J. Reagle"/>
<meta name="citation_author" content="D. Solo"/>
<meta name="citation_publication_date" content="March, 2002"/>
<meta name="citation_title" content=" (Extensible Markup Language) XML-Signature Syntax and Processing "/>
<meta name="citation_doi" content="10.17487/RFC3275"/>
<meta name="citation_issn" content="2070-1721"/>
<meta name="citation_technical_report_number" content="rfc3275"/>
<meta name="citation_pdf_url" content="https://www.rfc-editor.org/rfc/pdfrfc/rfc3275.txt.pdf"/>
<title>RFC 3275: (Extensible Markup Language) XML-Signature Syntax and Processing </title>
<style type="text/css">
@media only screen
and (min-width: 992px)
and (max-width: 1199px) {
body { font-size: 14pt; }
div.content { width: 96ex; margin: 0 auto; }
}
@media only screen
and (min-width: 768px)
and (max-width: 991px) {
body { font-size: 14pt; }
div.content { width: 96ex; margin: 0 auto; }
}
@media only screen
and (min-width: 480px)
and (max-width: 767px) {
body { font-size: 11pt; }
div.content { width: 96ex; margin: 0 auto; }
}
@media only screen
and (max-width: 479px) {
body { font-size: 8pt; }
div.content { width: 96ex; margin: 0 auto; }
}
@media only screen
and (min-device-width : 375px)
and (max-device-width : 667px) {
body { font-size: 9.5pt; }
div.content { width: 96ex; margin: 0; }
}
@media only screen
and (min-device-width: 1200px) {
body { font-size: 10pt; margin: 0 4em; }
div.content { width: 96ex; margin: 0; }
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-weight: bold;
/* line-height: 0pt; */
display: inline;
white-space: pre;
font-family: monospace;
font-size: 1em;
font-weight: bold;
}
pre {
font-size: 1em;
margin-top: 0px;
margin-bottom: 0px;
}
.pre {
white-space: pre;
font-family: monospace;
}
.header{
font-weight: bold;
}
.newpage {
page-break-before: always;
}
.invisible {
text-decoration: none;
color: white;
}
a.selflink {
color: black;
text-decoration: none;
}
@media print {
body {
font-family: monospace;
font-size: 10.5pt;
}
h1, h2, h3, h4, h5, h6 {
font-size: 1em;
}
a:link, a:visited {
color: inherit;
text-decoration: none;
}
.noprint {
display: none;
}
}
@media screen {
.grey, .grey a:link, .grey a:visited {
color: #777;
}
.docinfo {
background-color: #EEE;
}
.top {
border-top: 7px solid #EEE;
}
.bgwhite { background-color: white; }
.bgred { background-color: #F44; }
.bggrey { background-color: #666; }
.bgbrown { background-color: #840; }
.bgorange { background-color: #FA0; }
.bgyellow { background-color: #EE0; }
.bgmagenta{ background-color: #F4F; }
.bgblue { background-color: #66F; }
.bgcyan { background-color: #4DD; }
.bggreen { background-color: #4F4; }
.legend { font-size: 90%; }
.cplate { font-size: 70%; border: solid grey 1px; }
}
</style>
<!--[if IE]>
<style>
body {
font-size: 13px;
margin: 10px 10px;
}
</style>
<![endif]--> <script type="text/javascript"><!--
function addHeaderTags() {
var spans = document.getElementsByTagName("span");
for (var i=0; i < spans.length; i++) {
var elem = spans[i];
if (elem) {
var level = elem.getAttribute("class");
if (level == "h1" || level == "h2" || level == "h3" || level == "h4" || level == "h5" || level == "h6") {
elem.innerHTML = "<"+level+">"+elem.innerHTML+"</"+level+">";
}
}
}
}
var legend_html = "Colour legend:<br /> <table> <tr><td>Unknown:</td> <td><span class='cplate bgwhite'> </span></td></tr> <tr><td>Draft:</td> <td><span class='cplate bgred'> </span></td></tr> <tr><td>Informational:</td> <td><span class='cplate bgorange'> </span></td></tr> <tr><td>Experimental:</td> <td><span class='cplate bgyellow'> </span></td></tr> <tr><td>Best Common Practice:</td> <td><span class='cplate bgmagenta'> </span></td></tr> <tr><td>Proposed Standard:</td> <td><span class='cplate bgblue'> </span></td></tr> <tr><td>Draft Standard (old designation):</td> <td><span class='cplate bgcyan'> </span></td></tr> <tr><td>Internet Standard:</td> <td><span class='cplate bggreen'> </span></td></tr> <tr><td>Historic:</td> <td><span class='cplate bggrey'> </span></td></tr> <tr><td>Obsolete:</td> <td><span class='cplate bgbrown'> </span></td></tr> </table>";
function showElem(id) {
var elem = document.getElementById(id);
elem.innerHTML = eval(id+"_html");
elem.style.visibility='visible';
}
function hideElem(id) {
var elem = document.getElementById(id);
elem.style.visibility='hidden';
elem.innerHTML = "";
}
// -->
</script></head>
<body>
<span class="pre noprint docinfo">[<a href="https://www.rfc-editor.org" title="RFC Editor">RFC Home</a>] [<a href="/rfc/rfc3275.txt">TEXT</a>|<a href="/rfc/pdfrfc/rfc3275.txt.pdf">PDF</a>|<a href="/rfc/rfc3275.html">HTML</a>] [<a href='https://datatracker.ietf.org/doc/rfc3275' title='IETF Datatracker information for this document'>Tracker</a>] [<a href="https://datatracker.ietf.org/ipr/search/?rfc=3275&submit=rfc" title="IPR disclosures related to this document">IPR</a>] [<a class="boldtext" href="/errata/rfc3275" target="_blank">Errata</a>] [<a href='https://www.rfc-editor.org/info/rfc3275' title='Info page'>Info page</a>] </span><br/><span class="pre noprint docinfo"> </span><br /><span class="pre noprint docinfo"> DRAFT STANDARD</span><br /><span class="pre noprint docinfo"> <span style='color: #C00;'>Errata Exist</span></span><pre>Network Working Group D. Eastlake 3rd
Request for Comments: 3275 Motorola
Obsoletes: <a href="./rfc3075">3075</a> J. Reagle
Category: Standards Track W3C
D. Solo
Citigroup
March 2002
(Extensible Markup Language) XML-Signature Syntax and Processing
Status of this Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (c) 2002 The Internet Society & W3C (MIT, INRIA, Keio), All
Rights Reserved.
Abstract
This document specifies XML (Extensible Markup Language) digital
signature processing rules and syntax. XML Signatures provide
integrity, message authentication, and/or signer authentication
services for data of any type, whether located within the XML that
includes the signature or elsewhere.
Table of Contents
<a href="#section-1">1</a>. Introduction................................................... <a href="#page-3">3</a>
<a href="#section-1.1">1.1</a> Editorial and Conformance Conventions......................... <a href="#page-4">4</a>
<a href="#section-1.2">1.2</a> Design Philosophy............................................. <a href="#page-4">4</a>
<a href="#section-1.3">1.3</a> Versions, Namespaces and Identifiers.......................... <a href="#page-4">4</a>
<a href="#section-1.4">1.4</a> Acknowledgements.............................................. <a href="#page-6">6</a>
<a href="#section-1.5">1.5</a> W3C Status.................................................... <a href="#page-6">6</a>
<a href="#section-2">2</a>. Signature Overview and Examples................................ <a href="#page-7">7</a>
2.1 Simple Example (Signature, SignedInfo, Methods, and References) 8
<a href="#section-2.1.1">2.1.1</a> More on Reference........................................... <a href="#page-9">9</a>
<a href="#section-2.2">2.2</a> Extended Example (Object and SignatureProperty)............... <a href="#page-10">10</a>
<a href="#section-2.3">2.3</a> Extended Example (Object and Manifest)........................ <a href="#page-12">12</a>
<a href="#section-3.0">3.0</a> Processing Rules.............................................. <a href="#page-13">13</a>
<a href="#section-3.1">3.1</a> Core Generation............................................... <a href="#page-13">13</a>
<a href="#section-3.1.1">3.1.1</a> Reference Generation........................................ <a href="#page-13">13</a>
<span class="grey">Eastlake, et al. Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
<a href="#section-3.1.2">3.1.2</a> Signature Generation........................................ <a href="#page-13">13</a>
<a href="#section-3.2">3.2</a> Core Validation............................................... <a href="#page-14">14</a>
<a href="#section-3.2.1">3.2.1</a> Reference Validation........................................ <a href="#page-14">14</a>
<a href="#section-3.2.2">3.2.2</a> Signature Validation........................................ <a href="#page-15">15</a>
<a href="#section-4.0">4.0</a> Core Signature Syntax......................................... <a href="#page-15">15</a>
<a href="#section-4.0.1">4.0.1</a> The ds:CryptoBinary Simple Type............................. <a href="#page-17">17</a>
<a href="#section-4.1">4.1</a> The Signature element......................................... <a href="#page-17">17</a>
<a href="#section-4.2">4.2</a> The SignatureValue Element.................................... <a href="#page-18">18</a>
<a href="#section-4.3">4.3</a> The SignedInfo Element........................................ <a href="#page-18">18</a>
<a href="#section-4.3.1">4.3.1</a> The CanonicalizationMethod Element.......................... <a href="#page-19">19</a>
<a href="#section-4.3.2">4.3.2</a> The SignatureMethod Element................................. <a href="#page-21">21</a>
<a href="#section-4.3.3">4.3.3</a> The Reference Element....................................... <a href="#page-21">21</a>
<a href="#section-4.3.3.1">4.3.3.1</a> The URI Attribute......................................... <a href="#page-22">22</a>
<a href="#section-4.3.3.2">4.3.3.2</a> The Reference Processing Model............................ <a href="#page-23">23</a>
<a href="#section-4.3.3.3">4.3.3.3</a> Same-Document URI-References.............................. <a href="#page-25">25</a>
<a href="#section-4.3.3.4">4.3.3.4</a> The Transforms Element.................................... <a href="#page-26">26</a>
<a href="#section-4.3.3.5">4.3.3.5</a> The DigestMethod Element.................................. <a href="#page-28">28</a>
<a href="#section-4.3.3.6">4.3.3.6</a> The DigestValue Element................................... <a href="#page-28">28</a>
<a href="#section-4.4">4.4</a> The KeyInfo Element........................................... <a href="#page-29">29</a>
<a href="#section-4.4.1">4.4.1</a> The KeyName Element......................................... <a href="#page-31">31</a>
<a href="#section-4.4.2">4.4.2</a> The KeyValue Element........................................ <a href="#page-31">31</a>
<a href="#section-4.4.2.1">4.4.2.1</a> The DSAKeyValue Element................................... <a href="#page-32">32</a>
<a href="#section-4.4.2.2">4.4.2.2</a> The RSAKeyValue Element................................... <a href="#page-33">33</a>
<a href="#section-4.4.3">4.4.3</a> The RetrievalMethod Element................................. <a href="#page-34">34</a>
<a href="#section-4.4.4">4.4.4</a> The X509Data Element........................................ <a href="#page-35">35</a>
<a href="#section-4.4.5">4.4.5</a> The PGPData Element......................................... <a href="#page-38">38</a>
<a href="#section-4.4.6">4.4.6</a> The SPKIData Element........................................ <a href="#page-39">39</a>
<a href="#section-4.4.7">4.4.7</a> The MgmtData Element........................................ <a href="#page-40">40</a>
<a href="#section-4.5">4.5</a> The Object Element............................................ <a href="#page-40">40</a>
<a href="#section-5.0">5.0</a> Additional Signature Syntax................................... <a href="#page-42">42</a>
<a href="#section-5.1">5.1</a> The Manifest Element.......................................... <a href="#page-42">42</a>
<a href="#section-5.2">5.2</a> The SignatureProperties Element............................... <a href="#page-43">43</a>
<a href="#section-5.3">5.3</a> Processing Instructions in Signature Elements................. <a href="#page-44">44</a>
<a href="#section-5.4">5.4</a> Comments in Signature Elements................................ <a href="#page-44">44</a>
<a href="#section-6.0">6.0</a> Algorithms.................................................... <a href="#page-44">44</a>
<a href="#section-6.1">6.1</a> Algorithm Identifiers and Implementation Requirements......... <a href="#page-44">44</a>
<a href="#section-6.2">6.2</a> Message Digests............................................... <a href="#page-46">46</a>
<a href="#section-6.2.1">6.2.1</a> SHA-1....................................................... <a href="#page-46">46</a>
<a href="#section-6.3">6.3</a> Message Authentication Codes.................................. <a href="#page-46">46</a>
<a href="#section-6.3.1">6.3.1</a> HMAC........................................................ <a href="#page-46">46</a>
<a href="#section-6.4">6.4</a> Signature Algorithms.......................................... <a href="#page-47">47</a>
<a href="#section-6.4.1">6.4.1</a> DSA......................................................... <a href="#page-47">47</a>
<a href="#section-6.4.2">6.4.2</a> PKCS1 (RSA-SHA1)............................................ <a href="#page-48">48</a>
<a href="#section-6.5">6.5</a> Canonicalization Algorithms................................... <a href="#page-49">49</a>
<a href="#section-6.5.1">6.5.1</a> Canonical XML............................................... <a href="#page-49">49</a>
<a href="#section-6.6">6.6</a> Transform Algorithms.......................................... <a href="#page-50">50</a>
<a href="#section-6.6.1">6.6.1</a> Canonicalization............................................ <a href="#page-50">50</a>
<a href="#section-6.6.2">6.6.2</a> Base64...................................................... <a href="#page-50">50</a>
<span class="grey">Eastlake, et al. Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
<a href="#section-6.6.3">6.6.3</a> XPath Filtering............................................. <a href="#page-51">51</a>
<a href="#section-6.6.4">6.6.4</a> Enveloped Signature Transform............................... <a href="#page-54">54</a>
<a href="#section-6.6.5">6.6.5</a> XSLT Transform.............................................. <a href="#page-54">54</a>
<a href="#section-7">7</a>. XML Canonicalization and Syntax Constraint Considerations...... <a href="#page-55">55</a>
<a href="#section-7.1">7.1</a> XML 1.0, Syntax Constraints, and Canonicalization............. <a href="#page-56">56</a>
<a href="#section-7.2">7.2</a> DOM/SAX Processing and Canonicalization....................... <a href="#page-57">57</a>
<a href="#section-7.3">7.3</a> Namespace Context and Portable Signatures..................... <a href="#page-58">58</a>
<a href="#section-8.0">8.0</a> Security Considerations....................................... <a href="#page-59">59</a>
<a href="#section-8.1">8.1</a> Transforms.................................................... <a href="#page-59">59</a>
<a href="#section-8.1.1">8.1.1</a> Only What is Signed is Secure............................... <a href="#page-60">60</a>
<a href="#section-8.1.2">8.1.2</a> Only What is 'Seen' Should be Signed........................ <a href="#page-60">60</a>
<a href="#section-8.1.3">8.1.3</a> 'See' What is Signed........................................ <a href="#page-61">61</a>
<a href="#section-8.2">8.2</a> Check the Security Model...................................... <a href="#page-62">62</a>
<a href="#section-8.3">8.3</a> Algorithms, Key Lengths, Certificates, Etc.................... <a href="#page-62">62</a>
<a href="#section-9">9</a>. Schema, DTD, Data Model, and Valid Examples.................... <a href="#page-63">63</a>
<a href="#section-10">10</a>. Definitions................................................... <a href="#page-63">63</a>
Appendix: Changes from <a href="./rfc3075">RFC 3075</a>................................... <a href="#page-67">67</a>
References........................................................ <a href="#page-67">67</a>
Authors' Addresses................................................ <a href="#page-72">72</a>
Full Copyright Statement.......................................... <a href="#page-73">73</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
This document specifies XML syntax and processing rules for creating
and representing digital signatures. XML Signatures can be applied
to any digital content (data object), including XML. An XML
Signature may be applied to the content of one or more resources.
Enveloped or enveloping signatures are over data within the same XML
document as the signature; detached signatures are over data external
to the signature element. More specifically, this specification
defines an XML signature element type and an XML signature
application; conformance requirements for each are specified by way
of schema definitions and prose respectively. This specification
also includes other useful types that identify methods for
referencing collections of resources, algorithms, and keying and
management information.
The XML Signature is a method of associating a key with referenced
data (octets); it does not normatively specify how keys are
associated with persons or institutions, nor the meaning of the data
being referenced and signed. Consequently, while this specification
is an important component of secure XML applications, it itself is
not sufficient to address all application security/trust concerns,
particularly with respect to using signed XML (or other data formats)
as a basis of human-to-human communication and agreement. Such an
application must specify additional key, algorithm, processing and
rendering requirements. For further information, please see Security
Considerations (<a href="#section-8">section 8</a>).
<span class="grey">Eastlake, et al. Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a> Editorial and Conformance Conventions</span>
For readability, brevity, and historic reasons this document uses the
term "signature" to generally refer to digital authentication values
of all types. Obviously, the term is also strictly used to refer to
authentication values that are based on public keys and that provide
signer authentication. When specifically discussing authentication
values based on symmetric secret key codes we use the terms
authenticators or authentication codes. (See Check the Security
Model, <a href="#section-8.3">section 8.3</a>.)
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>].
The schema definition is normative.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
specification are to be interpreted as described in <a href="./rfc2119">RFC2119</a>
[<a href="#ref-KEYWORDS" title=""Key words for use in RFCs to Indicate Requirement Levels"">KEYWORDS</a>]:
"they MUST only be used where it is actually required for
interoperation or to limit behavior which has potential for
causing harm (e.g., limiting retransmissions)"
Consequently, we use these capitalized key words to unambiguously
specify requirements over protocol and application features and
behavior that affect the interoperability and security of
implementations. These key words are not used (capitalized) to
describe XML grammar; schema definitions unambiguously describe such
requirements and we wish to reserve the prominence of these terms for
the natural language descriptions of protocols and features. For
instance, an XML attribute might be described as being "optional."
Compliance with the Namespaces in XML specification [<a href="#ref-XML-ns" title="D. Hollander">XML-ns</a>] is
described as "REQUIRED."
<span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a> Design Philosophy</span>
The design philosophy and requirements of this specification are
addressed in the XML-Signature Requirements document [XML-Signature-
RD].
<span class="h3"><a class="selflink" id="section-1.3" href="#section-1.3">1.3</a> Versions, Namespaces and Identifiers</span>
No provision is made for an explicit version number in this syntax.
If a future version is needed, it will use a different namespace.
The XML namespace [<a href="#ref-XML-ns" title="D. Hollander">XML-ns</a>] URI that MUST be used by implementations
of this (dated) specification is:
xmlns="http://www.w3.org/2000/09/xmldsig#"
<span class="grey">Eastlake, et al. Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
This namespace is also used as the prefix for algorithm identifiers
used by this specification. While applications MUST support XML and
XML namespaces, the use of internal entities [<a href="#ref-XML" title=" J. Paoli">XML</a>] or our "dsig" XML
namespace prefix and defaulting/scoping conventions are OPTIONAL; we
use these facilities to provide compact and readable examples.
This specification uses Uniform Resource Identifiers [<a href="#ref-URI" title=""Uniform Resource Identifiers (URI): Generic Syntax"">URI</a>] to
identify resources, algorithms, and semantics. The URI in the
namespace declaration above is also used as a prefix for URIs under
the control of this specification. For resources not under the
control of this specification, we use the designated Uniform Resource
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
normative external specification. If an external specification has
not allocated itself a Uniform Resource Identifier we allocate an
identifier under our own namespace. For instance:
SignatureProperties is identified and defined by this specification's
namespace:
<a href="http://www.w3.org/2000/09/xmldsig#SignatureProperties">http://www.w3.org/2000/09/xmldsig#SignatureProperties</a>
XSLT is identified and defined by an external URI
<a href="http://www.w3.org/TR/1999/REC-xslt-19991116">http://www.w3.org/TR/1999/REC-xslt-19991116</a>
SHA1 is identified via this specification's namespace and defined via
a normative reference
<a href="http://www.w3.org/2000/09/xmldsig#sha1">http://www.w3.org/2000/09/xmldsig#sha1</a>
FIPS PUB 180-1. Secure Hash Standard. U.S. Department of
Commerce/National Institute of Standards and Technology.
Finally, in order to provide for terse namespace declarations we
sometimes use XML internal entities [<a href="#ref-XML" title=" J. Paoli">XML</a>] within URIs. For instance:
<?xml version='1.0'?>
<!DOCTYPE Signature SYSTEM
"xmldsig-core-schema.dtd" [ <!ENTITY dsig
"<a href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>"> ]>
<Signature xmlns="&dsig;" Id="MyFirstSignature">
<SignedInfo>
...
<span class="grey">Eastlake, et al. Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
<span class="h3"><a class="selflink" id="section-1.4" href="#section-1.4">1.4</a> Acknowledgements</span>
The contributions of the following Working Group members to this
specification are gratefully acknowledged:
* Mark Bartel, Accelio (Author)
* John Boyer, PureEdge (Author)
* Mariano P. Consens, University of Waterloo
* John Cowan, Reuters Health
* Donald Eastlake 3rd, Motorola (Chair, Author/Editor)
* Barb Fox, Microsoft (Author)
* Christian Geuer-Pollmann, University Siegen
* Tom Gindin, IBM
* Phillip Hallam-Baker, VeriSign Inc
* Richard Himes, US Courts
* Merlin Hughes, Baltimore
* Gregor Karlinger, IAIK TU Graz
* Brian LaMacchia, Microsoft (Author)
* Peter Lipp, IAIK TU Graz
* Joseph Reagle, W3C (Chair, Author/Editor)
* Ed Simon, XMLsec (Author)
* David Solo, Citigroup (Author/Editor)
* Petteri Stenius, DONE Information, Ltd
* Raghavan Srinivas, Sun
* Kent Tamura, IBM
* Winchel Todd Vincent III, GSU
* Carl Wallace, Corsec Security, Inc.
* Greg Whitehead, Signio Inc.
As are the Last Call comments from the following:
* Dan Connolly, W3C
* Paul Biron, Kaiser Permanente, on behalf of the XML Schema WG.
* Martin J. Duerst, W3C; and Masahiro Sekiguchi, Fujitsu; on
behalf of the Internationalization WG/IG.
* Jonathan Marsh, Microsoft, on behalf of the Extensible
Stylesheet Language WG.
<span class="h3"><a class="selflink" id="section-1.5" href="#section-1.5">1.5</a> W3C Status</span>
The World Wide Web Consortium Recommendation corresponding to
this RFC is at:
<a href="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/">http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/</a>
<span class="grey">Eastlake, et al. Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Signature Overview and Examples</span>
This section provides an overview and examples of XML digital
signature syntax. The specific processing is given in Processing
Rules (<a href="#section-3">section 3</a>). The formal syntax is found in Core Signature
Syntax (<a href="#section-4">section 4</a>) and Additional Signature Syntax (<a href="#section-5">section 5</a>).
In this section, an informal representation and examples are used to
describe the structure of the XML signature syntax. This
representation and examples may omit attributes, details and
potential features that are fully explained later.
XML Signatures are applied to arbitrary digital content (data
objects) via an indirection. Data objects are digested, the
resulting value is placed in an element (with other information) and
that element is then digested and cryptographically signed. XML
digital signatures are represented by the Signature element which has
the following structure (where "?" denotes zero or one occurrence;
"+" denotes one or more occurrences; and "*" denotes zero or more
occurrences):
<Signature ID?>
<SignedInfo>
<CanonicalizationMethod/>
<SignatureMethod/>
(<Reference URI? >
(<Transforms>)?
<DigestMethod>
<DigestValue>
</Reference>)+
</SignedInfo>
<SignatureValue>
(<KeyInfo>)?
(<Object ID?>)*
</Signature>
Signatures are related to data objects via URIs [<a href="#ref-URI" title=""Uniform Resource Identifiers (URI): Generic Syntax"">URI</a>]. Within an XML
document, signatures are related to local data objects via fragment
identifiers. Such local data can be included within an enveloping
signature or can enclose an enveloped signature. Detached signatures
are over external network resources or local data objects that reside
within the same XML document as sibling elements; in this case, the
signature is neither enveloping (signature is parent) nor enveloped
attribute (signature is child). Since a Signature element (and its
Id value/name) may co-exist or be combined with other elements (and
their IDs) within a single XML document, care should be taken in
choosing names such that there are no subsequent collisions that
violate the ID uniqueness validity constraint [<a href="#ref-XML" title=" J. Paoli">XML</a>].
<span class="grey">Eastlake, et al. Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
<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>
The following example is a detached signature of the content of the
HTML4 in XML specification.
[<a id="ref-s01">s01</a>] <Signature Id="MyFirstSignature"
xmlns="http://www.w3.org/2000/09/xmldsig#">
[s02] <SignedInfo>
[<a href="#ref-s03">s03</a>] <CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
[<a href="#ref-s04">s04</a>] <SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/>
[<a href="#ref-s05">s05</a>] <Reference
URI="http://www.w3.org/TR/2000/REC-xhtml1-20000126/">
[s06] <Transforms>
[s07] <Transform
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
[s08] </Transforms>
[s09] <DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
[s10] <DigestValue>j6lwx3rvEPO0vKtMup4NbeVu8nk=</DigestValue>
[s11] </Reference>
[s12] </SignedInfo>
[s13] <SignatureValue>MC0CFFrVLtRlk=...</SignatureValue>
[s14] <KeyInfo>
[s15a] <KeyValue>
[s15b] <DSAKeyValue>
[s15c] <P>...</P><Q>...</Q><G>...</G><Y>...</Y>
[s15d] </DSAKeyValue>
[s15e] </KeyValue>
[s16] </KeyInfo>
[s17] </Signature>
[<a id="ref-s02-12">s02-12</a>] The required SignedInfo element is the information that is
actually signed. Core validation of SignedInfo consists of two
mandatory processes: validation of the signature over SignedInfo and
validation of each Reference digest within SignedInfo. Note that the
algorithms used in calculating the SignatureValue are also included
in the signed information while the SignatureValue element is outside
SignedInfo.
[<a id="ref-s03">s03</a>] The CanonicalizationMethod is the algorithm that is used to
canonicalize the SignedInfo element before it is digested as part of
the signature operation. Note that this example, and all examples in
this specification, are not in canonical form.
<span class="grey">Eastlake, et al. Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
[<a id="ref-s04">s04</a>] The SignatureMethod is the algorithm that is used to convert
the canonicalized SignedInfo into the SignatureValue. It is a
combination of a digest algorithm and a key dependent algorithm and
possibly other algorithms such as padding, for example RSA-SHA1. The
algorithm names are signed to resist attacks based on substituting a
weaker algorithm. To promote application interoperability we specify
a set of signature algorithms that MUST be implemented, though their
use is at the discretion of the signature creator. We specify
additional algorithms as RECOMMENDED or OPTIONAL for implementation;
the design also permits arbitrary user specified algorithms.
[<a id="ref-s05-11">s05-11</a>] Each Reference element includes the digest method and
resulting digest value calculated over the identified data object.
It may also include transformations that produced the input to the
digest operation. A data object is signed by computing its digest
value and a signature over that value. The signature is later
checked via reference and signature validation.
[<a id="ref-s14-16">s14-16</a>] KeyInfo indicates the key to be used to validate the
signature. Possible forms for identification include certificates,
key names, and key agreement algorithms and information -- we define
only a few. KeyInfo is optional for two reasons. First, the signer
may not wish to reveal key information to all document processing
parties. Second, the information may be known within the
application's context and need not be represented explicitly. Since
KeyInfo is outside of SignedInfo, if the signer wishes to bind the
keying information to the signature, a Reference can easily identify
and include the KeyInfo as part of the signature.
<span class="h4"><a class="selflink" id="section-2.1.1" href="#section-2.1.1">2.1.1</a> More on Reference</span>
[<a id="ref-s05">s05</a>] <Reference
URI="http://www.w3.org/TR/2000/REC-xhtml1-20000126/">
[s06] <Transforms>
[s07] <Transform
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
[s08] </Transforms>
[s09] <DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
[s10] <DigestValue>j6lwx3rvEPO0vKtMup4NbeVu8nk=</DigestValue>
[s11] </Reference>
[<a id="ref-s05">s05</a>] The optional URI attribute of Reference identifies the data
object to be signed. This attribute may be omitted on at most one
Reference in a Signature. (This limitation is imposed in order to
ensure that references and objects may be matched unambiguously.)
<span class="grey">Eastlake, et al. Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
[<a id="ref-s05-08">s05-08</a>] This identification, along with the transforms, is a
description provided by the signer on how they obtained the signed
data object in the form it was digested (i.e., the digested content).
The verifier may obtain the digested content in another method so
long as the digest verifies. In particular, the verifier may obtain
the content from a different location such as a local store, as
opposed to that specified in the URI.
[<a id="ref-s06-08">s06-08</a>] Transforms is an optional ordered list of processing steps
that were applied to the resource's content before it was digested.
Transforms can include operations such as canonicalization,
encoding/decoding (including compression/inflation), XSLT, XPath, XML
schema validation, or XInclude. XPath transforms permit the signer
to derive an XML document that omits portions of the source document.
Consequently those excluded portions can change without affecting
signature validity. For example, if the resource being signed
encloses the signature itself, such a transform must be used to
exclude the signature value from its own computation. If no
Transforms element is present, the resource's content is digested
directly. While the Working Group has specified mandatory (and
optional) canonicalization and decoding algorithms, user specified
transforms are permitted.
[<a id="ref-s09-10">s09-10</a>] DigestMethod is the algorithm applied to the data after
Transforms is applied (if specified) to yield the DigestValue. The
signing of the DigestValue is what binds a resources content to the
signer's key.
<span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a> Extended Example (Object and SignatureProperty)</span>
This specification does not address mechanisms for making statements
or assertions. Instead, this document defines what it means for
something to be signed by an XML Signature (integrity, message
authentication, and/or signer authentication). Applications that
wish to represent other semantics must rely upon other technologies,
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
foo:assuredby attribute within its own markup to reference a
Signature element. Consequently, it's the application that must
understand and know how to make trust decisions given the validity of
the signature and the meaning of assuredby syntax. We also define a
SignatureProperties element type for the inclusion of assertions
about the signature itself (e.g., signature semantics, the time of
signing or the serial number of hardware used in cryptographic
processes). Such assertions may be signed by including a Reference
for the SignatureProperties in SignedInfo. While the signing
application should be very careful about what it signs (it should
understand what is in the SignatureProperty) a receiving application
has no obligation to understand that semantic (though its parent
<span class="grey">Eastlake, et al. Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
trust engine may wish to). Any content about the signature
generation may be located within the SignatureProperty element. The
mandatory Target attribute references the Signature element to which
the property applies.
Consider the preceding example with an additional reference to a
local Object that includes a SignatureProperty element. (Such a
signature would not only be detached [p02] but enveloping [p03].)
[ ] <Signature Id="MySecondSignature" ...>
[p01] <SignedInfo>
[ ] ...
[p02] <Reference URI="http://www.w3.org/TR/xml-stylesheet/">
[ ] ...
[p03] <Reference URI="#AMadeUpTimeStamp"
[<a href="#ref-p04">p04</a>]
Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties">
[p05] <DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
[p06] <DigestValue>k3453rvEPO0vKtMup4NbeVu8nk=</DigestValue>
[p07] </Reference>
[p08] </SignedInfo>
[p09] ...
[<a href="#ref-p10">p10</a>] <Object>
[p11] <SignatureProperties>
[p12] <SignatureProperty Id="AMadeUpTimeStamp"
Target="#MySecondSignature">
[p13] <timestamp xmlns="http://www.ietf.org/rfcXXXX.txt">
[p14] <date>19990908</date>
[p15] <time>14:34:34:34</time>
[p16] </timestamp>
[p17] </SignatureProperty>
[p18] </SignatureProperties>
[p19] </Object>
[p20]</Signature>
[<a id="ref-p04">p04</a>] The optional Type attribute of Reference provides information
about the resource identified by the URI. In particular, it can
indicate that it is an Object, SignatureProperty, or Manifest
element. This can be used by applications to initiate special
processing of some Reference elements. References to an XML data
element within an Object element SHOULD identify the actual element
pointed to. Where the element content is not XML (perhaps it is
binary or encoded data) the reference should identify the Object and
the Reference Type, if given, SHOULD indicate Object. Note that Type
is advisory and no action based on it or checking of its correctness
is required by core behavior.
<span class="grey">Eastlake, et al. Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
[<a id="ref-p10">p10</a>] Object is an optional element for including data objects within
the signature element or elsewhere. The Object can be optionally
typed and/or encoded.
[<a id="ref-p11-18">p11-18</a>] Signature properties, such as time of signing, can be
optionally signed by identifying them from within a Reference.
(These properties are traditionally called signature "attributes"
although that term has no relationship to the XML term "attribute".)
<span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a> Extended Example (Object and Manifest)</span>
The Manifest element is provided to meet additional requirements not
directly addressed by the mandatory parts of this specification. Two
requirements and the way the Manifest satisfies them follow.
First, applications frequently need to efficiently sign multiple data
objects even where the signature operation itself is an expensive
public key signature. This requirement can be met by including
multiple Reference elements within SignedInfo since the inclusion of
each digest secures the data digested. However, some applications
may not want the core validation behavior associated with this
approach because it requires every Reference within SignedInfo to
undergo reference validation -- the DigestValue elements are checked.
These applications may wish to reserve reference validation decision
logic to themselves. For example, an application might receive a
signature valid SignedInfo element that includes three Reference
elements. If a single Reference fails (the identified data object
when digested does not yield the specified DigestValue) the signature
would fail core validation. However, the application may wish to
treat the signature over the two valid Reference elements as valid or
take different actions depending on which fails. To accomplish this,
SignedInfo would reference a Manifest element that contains one or
more Reference elements (with the same structure as those in
SignedInfo). Then, reference validation of the Manifest is under
application control.
Second, consider an application where many signatures (using
different keys) are applied to a large number of documents. An
inefficient solution is to have a separate signature (per key)
repeatedly applied to a large SignedInfo element (with many
References); this is wasteful and redundant. A more efficient
solution is to include many references in a single Manifest that is
then referenced from multiple Signature elements.
The example below includes a Reference that signs a Manifest found
within the Object element.
<span class="grey">Eastlake, et al. Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
[ ] ...
[m01] <Reference URI="#MyFirstManifest"
[m02] Type="http://www.w3.org/2000/09/xmldsig#Manifest">
[m03] <DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
[m04] <DigestValue>345x3rvEPO0vKtMup4NbeVu8nk=</DigestValue>
[m05] </Reference>
[ ] ...
[m06] <Object>
[m07] <Manifest Id="MyFirstManifest">
[m08] <Reference>
[m09] ...
[m10] </Reference>
[m11] <Reference>
[m12] ...
[m13] </Reference>
[m14] </Manifest>
[m15] </Object>
<span class="h3"><a class="selflink" id="section-3.0" href="#section-3.0">3.0</a> Processing Rules</span>
The sections below describe the operations to be performed as part of
signature generation and validation.
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a> Core Generation</span>
The REQUIRED steps include the generation of Reference elements and
the SignatureValue over SignedInfo.
<span class="h4"><a class="selflink" id="section-3.1.1" href="#section-3.1.1">3.1.1</a> Reference Generation</span>
For each data object being signed:
1. Apply the Transforms, as determined by the application, to the
data object.
2. Calculate the digest value over the resulting data object.
3. Create a Reference element, including the (optional)
identification of the data object, any (optional) transform
elements, the digest algorithm and the DigestValue. (Note, it is
the canonical form of these references that are signed in 3.1.2
and validated in 3.2.1.)
<span class="h4"><a class="selflink" id="section-3.1.2" href="#section-3.1.2">3.1.2</a> Signature Generation</span>
1. Create SignedInfo element with SignatureMethod,
CanonicalizationMethod and Reference(s).
2. Canonicalize and then calculate the SignatureValue over SignedInfo
based on algorithms specified in SignedInfo.
<span class="grey">Eastlake, et al. Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
3. Construct the Signature element that includes SignedInfo,
Object(s) (if desired, encoding may be different than that used
for signing), KeyInfo (if required), and SignatureValue.
Note, if the Signature includes same-document references, [<a href="#ref-XML" title=" J. Paoli">XML</a>] or
[<a href="#ref-XML-schema" title="N. Mendelsohn">XML-schema</a>] validation of the document might introduce changes that
break the signature. Consequently, applications should be careful to
consistently process the document or refrain from using external
contributions (e.g., defaults and entities).
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a> Core Validation</span>
The REQUIRED steps of core validation include (1) reference
validation, the verification of the digest contained in each
Reference in SignedInfo, and (2) the cryptographic signature
validation of the signature calculated over SignedInfo.
Note, there may be valid signatures that some signature applications
are unable to validate. Reasons for this include failure to
implement optional parts of this specification, inability or
unwillingness to execute specified algorithms, or inability or
unwillingness to dereference specified URIs (some URI schemes may
cause undesirable side effects), etc.
Comparison of values in reference and signature validation are over
the numeric (e.g., integer) or decoded octet sequence of the value.
Different implementations may produce different encoded digest and
signature values when processing the same resources because of
variances in their encoding, such as accidental white space. But if
one uses numeric or octet comparison (choose one) on both the stated
and computed values these problems are eliminated.
<span class="h4"><a class="selflink" id="section-3.2.1" href="#section-3.2.1">3.2.1</a> Reference Validation</span>
1. Canonicalize the SignedInfo element based on the
CanonicalizationMethod in SignedInfo.
2. For each Reference in SignedInfo:
2.1 Obtain the data object to be digested. (For example, the
signature application may dereference the URI and execute
Transforms provided by the signer in the Reference element, or
it may obtain the content through other means such as a local
cache.)
2.2 Digest the resulting data object using the DigestMethod
specified in its Reference specification.
2.3 Compare the generated digest value against DigestValue in the
SignedInfo Reference; if there is any mismatch, validation
fails.
<span class="grey">Eastlake, et al. Standards Track [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>
Note, SignedInfo is canonicalized in step 1. The application must
ensure that the CanonicalizationMethod has no dangerous side affects,
such as rewriting URIs, (see CanonicalizationMethod (<a href="#section-4.3">section 4.3</a>))
and that it Sees What is Signed, which is the canonical form.
<span class="h4"><a class="selflink" id="section-3.2.2" href="#section-3.2.2">3.2.2</a> Signature Validation</span>
1. Obtain the keying information from KeyInfo or from an external
source.
2. Obtain the canonical form of the SignatureMethod using the
CanonicalizationMethod and use the result (and previously obtained
KeyInfo) to confirm the SignatureValue over the SignedInfo
element.
Note, KeyInfo (or some transformed version thereof) may be signed via
a Reference element. Transformation and validation of this reference
(3.2.1) is orthogonal to Signature Validation which uses the KeyInfo
as parsed.
Additionally, the SignatureMethod URI may have been altered by the
canonicalization of SignedInfo (e.g., absolutization of relative
URIs) and it is the canonical form that MUST be used. However, the
required canonicalization [<a href="#ref-XML-C14N" title=""Canonical XML Version 1.0"">XML-C14N</a>] of this specification does not
change URIs.
<span class="h3"><a class="selflink" id="section-4.0" href="#section-4.0">4.0</a> Core Signature Syntax</span>
The general structure of an XML signature is described in Signature
Overview (<a href="#section-2">section 2</a>). This section provides detailed syntax of the
core signature features. Features described in this section are
mandatory to implement unless otherwise indicated. The syntax is
defined via DTDs and [XML-Schema] with the following XML preamble,
declaration, and internal entity.
<span class="grey">Eastlake, et al. Standards Track [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc3275">RFC 3275</a> XML-Signature Syntax and Processing March 2002</span>