Git init
[external/xmlsec1.git] / tests / merlin-xmldsig-twenty-three / signature.tmpl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE Envelope [
3   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
4   <!ENTITY c14n 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>
5   <!ENTITY xpath 'http://www.w3.org/TR/1999/REC-xpath-19991116'>
6   <!ENTITY xslt 'http://www.w3.org/TR/1999/REC-xslt-19991116'>
7   <!ATTLIST Notaries Id ID #IMPLIED>
8 ]>
9 <!-- Preamble -->
10 <Envelope xmlns:foo="http://example.org/foo" xmlns="http://example.org/usps">
11   <DearSir>foo</DearSir>
12   <Body>bar</Body>
13   <YoursSincerely>
14     <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="signature">
15       <SignedInfo>
16         <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
17         <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
18         <Reference URI="http://www.w3.org/TR/xml-stylesheet">
19           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
20           <DigestValue></DigestValue>
21         </Reference>
22         <Reference URI="http://www.w3.org/Signature/2002/04/xml-stylesheet.b64">
23           <Transforms>
24             <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
25           </Transforms>
26           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
27           <DigestValue></DigestValue>
28         </Reference>
29         <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-1">
30           <Transforms>
31             <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
32               <XPath>
33                 self::text()
34               </XPath>
35             </Transform>
36           </Transforms>
37           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
38           <DigestValue></DigestValue>
39         </Reference>
40         <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-2">
41           <Transforms>
42             <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64" />
43           </Transforms>
44           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
45           <DigestValue></DigestValue>
46         </Reference>
47         <Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#manifest-1">
48           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
49           <DigestValue></DigestValue>
50         </Reference>
51         <Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#signature-properties-1">
52           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
53           <DigestValue></DigestValue>
54         </Reference>
55         <Reference URI="">
56           <Transforms>
57             <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
58           </Transforms>
59           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
60           <DigestValue></DigestValue>
61         </Reference>
62         <Reference URI="">
63           <Transforms>
64             <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
65             <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
66           </Transforms>
67           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
68           <DigestValue></DigestValue>
69         </Reference>
70         <Reference URI="#xpointer(/)">
71           <Transforms>
72             <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
73           </Transforms>
74           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
75           <DigestValue></DigestValue>
76         </Reference>
77         <Reference URI="#xpointer(/)">
78           <Transforms>
79             <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
80             <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
81           </Transforms>
82           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
83           <DigestValue></DigestValue>
84         </Reference>
85         <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
86           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
87           <DigestValue></DigestValue>
88         </Reference>
89         <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#object-3">
90           <Transforms>
91             <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
92           </Transforms>
93           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
94           <DigestValue></DigestValue>
95         </Reference>
96         <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
97           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
98           <DigestValue></DigestValue>
99         </Reference>
100         <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="#xpointer(id('object-3'))">
101           <Transforms>
102             <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
103           </Transforms>
104           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
105           <DigestValue></DigestValue>
106         </Reference>
107         <Reference Id="reference-1" URI="#manifest-reference-1">
108           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
109           <DigestValue></DigestValue>
110         </Reference>
111         <Reference Id="reference-2" URI="#reference-1">
112           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
113           <DigestValue></DigestValue>
114         </Reference>
115         <Reference URI="#reference-2">
116           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
117           <DigestValue></DigestValue>
118         </Reference>
119         <Reference Type="http://www.w3.org/2000/09/xmldsig#Object" URI="">
120           <Transforms>
121             <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
122               <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
123                 ancestor-or-self::dsig:SignedInfo
124                   and
125                 count(ancestor-or-self::dsig:Reference |
126                       here()/ancestor::dsig:Reference[1]) &gt;
127                 count(ancestor-or-self::dsig:Reference)
128                   or
129                 count(ancestor-or-self::node() |
130                       id('notaries')) =
131                 count(ancestor-or-self::node())
132               </XPath>
133             </Transform>
134           </Transforms>
135           <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
136           <DigestValue></DigestValue>
137         </Reference>
138       </SignedInfo>
139       <SignatureValue>
140       </SignatureValue>
141       <KeyInfo>
142         <RetrievalMethod Type="http://www.w3.org/2000/09/xmldsig#X509Data" URI="#object-4">
143           <Transforms>
144             <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
145               <XPath xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
146                 ancestor-or-self::dsig:X509Data
147               </XPath>
148             </Transform>
149           </Transforms>
150         </RetrievalMethod>
151       </KeyInfo>
152       <Object Id="object-1" MimeType="text/plain">I am the text.</Object>
153       <Object Encoding="http://www.w3.org/2000/09/xmldsig#base64" Id="object-2" MimeType="text/plain">SSBhbSB0aGUgdGV4dC4=</Object>
154       <Object Id="object-3">
155         <NonCommentandus xmlns=""><!-- Commentandum --></NonCommentandus>
156       </Object>
157       <Object>
158         <Manifest Id="manifest-1">
159           <Reference Id="manifest-reference-1" URI="http://www.w3.org/TR/xml-stylesheet">
160             <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
161             <DigestValue></DigestValue>
162           </Reference>
163           <Reference URI="#reference-1">
164             <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
165             <DigestValue></DigestValue>
166           </Reference>
167           <Reference URI="#notaries">
168             <Transforms>
169               <Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
170                 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" exclude-result-prefixes="foo" version="1.0">
171                   <xsl:output encoding="UTF-8" indent="no" method="xml" />
172                   <xsl:template match="/">
173                     <html>
174                       <head>
175                         <title>Notaries</title>
176                       </head>
177                       <body>
178                         <table>
179                           <xsl:for-each select="Notaries/Notary">
180                             <tr>
181                               <th>
182                                 <xsl:value-of select="@name" />
183                               </th>
184                             </tr>
185                           </xsl:for-each>
186                         </table>
187                       </body>
188                     </html>
189                   </xsl:template>
190                 </xsl:stylesheet>
191               </Transform>
192               <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
193             </Transforms>
194             <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
195             <DigestValue></DigestValue>
196           </Reference>
197         </Manifest>
198       </Object>
199       <Object>
200         <SignatureProperties Id="signature-properties-1">
201           <SignatureProperty Target="#signature">
202             <SignerAddress xmlns="urn:demo"><IP>192.168.21.138</IP></SignerAddress>
203           </SignatureProperty>
204         </SignatureProperties>
205       </Object>
206       <Object Id="object-4">
207         <X509Data>
208           <X509Certificate>
209 MIIEdDCCBB6gAwIBAgIJANaOuOCRgiz5MA0GCSqGSIb3DQEBBQUAMIHIMQswCQYD
210 VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTE9MDsGA1UEChM0WE1MIFNlY3Vy
211 aXR5IExpYnJhcnkgKGh0dHA6Ly93d3cuYWxla3NleS5jb20veG1sc2VjKTEqMCgG
212 A1UECxMhVGVzdCBTZWNvbmQgTGV2ZWwgUlNBIENlcnRpZmljYXRlMRYwFAYDVQQD
213 Ew1BbGVrc2V5IFNhbmluMSEwHwYJKoZIhvcNAQkBFhJ4bWxzZWNAYWxla3NleS5j
214 b20wHhcNMDUwNzEwMDIzMTU5WhcNMTUwNzA4MDIzMTU5WjCBxzELMAkGA1UEBhMC
215 VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExPTA7BgNVBAoTNFhNTCBTZWN1cml0eSBM
216 aWJyYXJ5IChodHRwOi8vd3d3LmFsZWtzZXkuY29tL3htbHNlYykxKTAnBgNVBAsT
217 IFRlc3QgVGhpcmQgTGV2ZWwgRFNBIENlcnRpZmljYXRlMRYwFAYDVQQDEw1BbGVr
218 c2V5IFNhbmluMSEwHwYJKoZIhvcNAQkBFhJ4bWxzZWNAYWxla3NleS5jb20wgfAw
219 gagGByqGSM44BAEwgZwCQQDIMfw6P79Fcw0hrxYKq3ePh7wmevc95UjfF2JHQJBX
220 Jb9XFBa5LRy71lzh/OYMH4oh4giiFVRVBCW9HpZqOTNJAhUAlEOrmqjJG3tfjU49
221 XjJuM3AXNskCQAUzwzmbp53bZ+bzDcOU6UGh3Ig/TFdLGXYevs3tiZaFLa//EYF+
222 l5Tdsr3NQpGRRf4arXvXPZyIJhYYHJVk7OMDQwACQDonSDDJk3VaIfdVHPnOitRq
223 V5XPFfMDksNb0WelnZdl/qokl9eaU+8uiH7LtsU0QYX9lE8kTplcUdD0bxjDYJ2j
224 ggFTMIIBTzAMBgNVHRMEBTADAQH/MCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdl
225 bmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUpVifKXAtGkJHRAParmenuvcp
226 ZT4wgfEGA1UdIwSB6TCB5oAU/uTsUyTwlZXHELXhRLVdOWVa436hgcKkgb8wgbwx
227 CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMT0wOwYDVQQKEzRYTUwg
228 U2VjdXJpdHkgTGlicmFyeSAoaHR0cDovL3d3dy5hbGVrc2V5LmNvbS94bWxzZWMp
229 MR4wHAYDVQQLExVUZXN0IFJvb3QgQ2VydGlmaWNhdGUxFjAUBgNVBAMTDUFsZWtz
230 ZXkgU2FuaW4xITAfBgkqhkiG9w0BCQEWEnhtbHNlY0BhbGVrc2V5LmNvbYIJANaO
231 uOCRgiz4MA0GCSqGSIb3DQEBBQUAA0EAJB9Kc4/Z0hTwiDYR5fXVPyzAjD+BeChR
232 F14ztWl1Ol6REWFRbIGfEz3XDgCHCiocM8ExXi7zn26R072cdBz7+w==
233           </X509Certificate>
234         </X509Data>
235       </Object>
236     </Signature>
237   </YoursSincerely>
238   <PostScript>bar</PostScript>
239   <Notaries xmlns="" Id="notaries">
240     <Notary name="Great, A. T." />
241     <Notary name="Hun, A. T." />
242   </Notaries>
243   <!-- Commentary -->
244 </Envelope>
245 <!-- Postamble -->