XML Enc 1.1 schema
[shibboleth/cpp-xmltooling.git] / schemas / xenc-schema.xsd
1 <?xml version="1.0" encoding="utf-8"?>
2 <schema xmlns='http://www.w3.org/2001/XMLSchema' version='1.0'
3         xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'
4         xmlns:ds='http://www.w3.org/2000/09/xmldsig#'
5         targetNamespace='http://www.w3.org/2001/04/xmlenc#'
6         elementFormDefault='qualified'>
7
8   <import namespace='http://www.w3.org/2000/09/xmldsig#'
9           schemaLocation='xmldsig-core-schema.xsd'/>
10
11   <complexType name='EncryptedType' abstract='true'>
12     <sequence>
13       <element name='EncryptionMethod' type='xenc:EncryptionMethodType'
14        minOccurs='0'/>
15       <element ref='ds:KeyInfo' minOccurs='0'/>
16       <element ref='xenc:CipherData'/>
17       <element ref='xenc:EncryptionProperties' minOccurs='0'/>
18     </sequence>
19     <attribute name='Id' type='ID' use='optional'/>
20     <attribute name='Type' type='anyURI' use='optional'/>
21     <attribute name='MimeType' type='string' use='optional'/>
22     <attribute name='Encoding' type='anyURI' use='optional'/>
23   </complexType>
24   
25   <complexType name='EncryptionMethodType' mixed='true'>
26     <sequence>
27       <element name='KeySize' minOccurs='0' type='xenc:KeySizeType'/>
28       <element name='OAEPparams' minOccurs='0' type='base64Binary'/>
29       <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
30     </sequence>
31     <attribute name='Algorithm' type='anyURI' use='required'/>
32   </complexType>
33
34     <simpleType name='KeySizeType'>
35       <restriction base="integer"/>
36     </simpleType>
37
38   <element name='CipherData' type='xenc:CipherDataType'/>
39   <complexType name='CipherDataType'>
40      <choice>
41        <element name='CipherValue' type='base64Binary'/>
42        <element ref='xenc:CipherReference'/>
43      </choice>
44     </complexType>
45
46    <element name='CipherReference' type='xenc:CipherReferenceType'/>
47    <complexType name='CipherReferenceType'>
48        <choice>
49          <element name='Transforms' type='xenc:TransformsType' minOccurs='0'/>
50        </choice>
51        <attribute name='URI' type='anyURI' use='required'/>
52    </complexType>
53
54      <complexType name='TransformsType'>
55        <sequence>
56          <element ref='ds:Transform' maxOccurs='unbounded'/>
57        </sequence>
58      </complexType>
59
60
61   <element name='EncryptedData' type='xenc:EncryptedDataType'/>
62   <complexType name='EncryptedDataType'>
63     <complexContent>
64       <extension base='xenc:EncryptedType'>
65        </extension>
66     </complexContent>
67   </complexType>
68
69   <!-- Children of ds:KeyInfo -->
70
71   <element name='EncryptedKey' type='xenc:EncryptedKeyType'/>
72   <complexType name='EncryptedKeyType'>
73     <complexContent>
74       <extension base='xenc:EncryptedType'>
75         <sequence>
76           <element ref='xenc:ReferenceList' minOccurs='0'/>
77           <element name='CarriedKeyName' type='string' minOccurs='0'/>
78         </sequence>
79         <attribute name='Recipient' type='string'
80          use='optional'/>
81       </extension>
82     </complexContent>
83   </complexType>
84
85     <element name="AgreementMethod" type="xenc:AgreementMethodType"/>
86     <complexType name="AgreementMethodType" mixed="true">
87       <sequence>
88         <element name="KA-Nonce" minOccurs="0" type="base64Binary"/>
89         <!-- <element ref="ds:DigestMethod" minOccurs="0"/> -->
90         <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
91         <element name="OriginatorKeyInfo" minOccurs="0" type="ds:KeyInfoType"/>
92         <element name="RecipientKeyInfo" minOccurs="0" type="ds:KeyInfoType"/>
93       </sequence>
94       <attribute name="Algorithm" type="anyURI" use="required"/>
95     </complexType>
96
97   <!-- End Children of ds:KeyInfo -->
98
99   <element name='ReferenceList'>
100     <complexType>
101       <choice minOccurs='1' maxOccurs='unbounded'>
102         <element name='DataReference' type='xenc:ReferenceType'/>
103         <element name='KeyReference' type='xenc:ReferenceType'/>
104       </choice>
105     </complexType>
106   </element>
107
108   <complexType name='ReferenceType'>
109     <sequence>
110       <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
111     </sequence>
112     <attribute name='URI' type='anyURI' use='required'/>
113   </complexType>
114
115
116   <element name='EncryptionProperties' type='xenc:EncryptionPropertiesType'/>
117   <complexType name='EncryptionPropertiesType'>
118     <sequence>
119       <element ref='xenc:EncryptionProperty' maxOccurs='unbounded'/>
120     </sequence>
121     <attribute name='Id' type='ID' use='optional'/>
122   </complexType>
123
124     <element name='EncryptionProperty' type='xenc:EncryptionPropertyType'/>
125     <complexType name='EncryptionPropertyType' mixed='true'>
126       <choice maxOccurs='unbounded'>
127         <any namespace='##other' processContents='lax'/>
128       </choice>
129       <attribute name='Target' type='anyURI' use='optional'/>
130       <attribute name='Id' type='ID' use='optional'/>
131       <anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/>
132     </complexType>
133
134   <element name="DHKeyValue" type="xenc:DHKeyValueType"/>
135   <complexType name="DHKeyValueType">
136     <sequence>
137       <sequence minOccurs="0">
138         <element name="P" type="ds:CryptoBinary"/>
139         <element name="Q" type="ds:CryptoBinary"/>
140         <element name="Generator" type="ds:CryptoBinary"/>
141       </sequence>
142       <element name="Public" type="ds:CryptoBinary"/>
143       <sequence minOccurs="0">
144         <element name="seed" type="ds:CryptoBinary"/>
145         <element name="pgenCounter" type="ds:CryptoBinary"/>
146       </sequence>
147     </sequence>
148   </complexType>
149   
150 </schema>
151