aboutsummaryrefslogtreecommitdiff
path: root/schemas/relaxng/myrpki.rng
blob: 3beafe8f49e2176c7f801b284abe3376c6da5a9c (plain) (blame)
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
  $Id: myrpki.rnc 5876 2014-06-26 19:00:12Z sra $
  
  RelaxNG schema for MyRPKI XML messages.
  
  This message protocol is on its way out, as we're in the process of
  moving on from the user interface model that produced it, but even
  after we finish replacing it we'll still need the schema for a while
  to validate old messages when upgrading.
  
  libxml2 (including xmllint) only groks the XML syntax of RelaxNG, so
  run the compact syntax through trang to get XML syntax.
  
  Copyright (C) 2009-2011  Internet Systems Consortium ("ISC")
  
  Permission to use, copy, modify, and distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
-->
<grammar ns="http://www.hactrn.net/uris/rpki/myrpki/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <define name="version">
    <value>2</value>
  </define>
  <define name="base64">
    <data type="base64Binary">
      <param name="maxLength">512000</param>
    </data>
  </define>
  <define name="object_handle">
    <data type="string">
      <param name="maxLength">255</param>
      <param name="pattern">[\-_A-Za-z0-9]+</param>
    </data>
  </define>
  <define name="pubd_handle">
    <data type="string">
      <param name="maxLength">255</param>
      <param name="pattern">[\-_A-Za-z0-9/]+</param>
    </data>
  </define>
  <define name="uri">
    <data type="anyURI">
      <param name="maxLength">4096</param>
    </data>
  </define>
  <define name="asn">
    <data type="positiveInteger"/>
  </define>
  <define name="asn_list">
    <data type="string">
      <param name="maxLength">512000</param>
      <param name="pattern">[\-,0-9]+</param>
    </data>
  </define>
  <define name="ipv4_list">
    <data type="string">
      <param name="maxLength">512000</param>
      <param name="pattern">[\-,0-9/.]+</param>
    </data>
  </define>
  <define name="ipv6_list">
    <data type="string">
      <param name="maxLength">512000</param>
      <param name="pattern">[\-,0-9/:a-fA-F]+</param>
    </data>
  </define>
  <define name="timestamp">
    <data type="dateTime">
      <param name="pattern">.*Z</param>
    </data>
  </define>
  <!--
    Message formate used between configure_resources and
    configure_daemons.
  -->
  <start combine="choice">
    <element name="myrpki">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <attribute name="handle">
        <ref name="object_handle"/>
      </attribute>
      <optional>
        <attribute name="service_uri">
          <ref name="uri"/>
        </attribute>
      </optional>
      <zeroOrMore>
        <element name="roa_request">
          <attribute name="asn">
            <ref name="asn"/>
          </attribute>
          <attribute name="v4">
            <ref name="ipv4_list"/>
          </attribute>
          <attribute name="v6">
            <ref name="ipv6_list"/>
          </attribute>
        </element>
      </zeroOrMore>
      <zeroOrMore>
        <element name="child">
          <attribute name="handle">
            <ref name="object_handle"/>
          </attribute>
          <attribute name="valid_until">
            <ref name="timestamp"/>
          </attribute>
          <optional>
            <attribute name="asns">
              <ref name="asn_list"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="v4">
              <ref name="ipv4_list"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="v6">
              <ref name="ipv6_list"/>
            </attribute>
          </optional>
          <optional>
            <element name="bpki_certificate">
              <ref name="base64"/>
            </element>
          </optional>
        </element>
      </zeroOrMore>
      <zeroOrMore>
        <element name="parent">
          <attribute name="handle">
            <ref name="object_handle"/>
          </attribute>
          <optional>
            <attribute name="service_uri">
              <ref name="uri"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="myhandle">
              <ref name="object_handle"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="sia_base">
              <ref name="uri"/>
            </attribute>
          </optional>
          <optional>
            <element name="bpki_cms_certificate">
              <ref name="base64"/>
            </element>
          </optional>
        </element>
      </zeroOrMore>
      <zeroOrMore>
        <element name="repository">
          <attribute name="handle">
            <ref name="object_handle"/>
          </attribute>
          <optional>
            <attribute name="service_uri">
              <ref name="uri"/>
            </attribute>
          </optional>
          <optional>
            <element name="bpki_certificate">
              <ref name="base64"/>
            </element>
          </optional>
        </element>
      </zeroOrMore>
      <optional>
        <element name="bpki_ca_certificate">
          <ref name="base64"/>
        </element>
      </optional>
      <optional>
        <element name="bpki_crl">
          <ref name="base64"/>
        </element>
      </optional>
      <optional>
        <element name="bpki_bsc_certificate">
          <ref name="base64"/>
        </element>
      </optional>
      <optional>
        <element name="bpki_bsc_pkcs10">
          <ref name="base64"/>
        </element>
      </optional>
    </element>
  </start>
  <!-- Format of an identity.xml file. -->
  <start combine="choice">
    <element name="identity">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <attribute name="handle">
        <ref name="object_handle"/>
      </attribute>
      <element name="bpki_ta">
        <ref name="base64"/>
      </element>
    </element>
  </start>
  <!--
    Format of <authorization/> element used in referrals.  The Base64
    text is a <referral/> (q. v.) element signed with CMS.
  -->
  <define name="authorization">
    <element name="authorization">
      <attribute name="referrer">
        <ref name="pubd_handle"/>
      </attribute>
      <ref name="base64"/>
    </element>
  </define>
  <!-- Format of <contact_info/> element used in referrals. -->
  <define name="contact_info">
    <element name="contact_info">
      <optional>
        <attribute name="uri">
          <ref name="uri"/>
        </attribute>
      </optional>
      <data type="string"/>
    </element>
  </define>
  <!-- Variant payload portion of a <repository/> element. -->
  <define name="repository_payload">
    <choice>
      <attribute name="type">
        <value>none</value>
      </attribute>
      <attribute name="type">
        <value>offer</value>
      </attribute>
      <group>
        <attribute name="type">
          <value>referral</value>
        </attribute>
        <ref name="authorization"/>
        <ref name="contact_info"/>
      </group>
    </choice>
  </define>
  <!-- <parent/> element (response from configure_child). -->
  <start combine="choice">
    <element name="parent">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <optional>
        <attribute name="valid_until">
          <ref name="timestamp"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="service_uri">
          <ref name="uri"/>
        </attribute>
      </optional>
      <attribute name="child_handle">
        <ref name="object_handle"/>
      </attribute>
      <attribute name="parent_handle">
        <ref name="object_handle"/>
      </attribute>
      <element name="bpki_resource_ta">
        <ref name="base64"/>
      </element>
      <element name="bpki_child_ta">
        <ref name="base64"/>
      </element>
      <optional>
        <element name="repository">
          <ref name="repository_payload"/>
        </element>
      </optional>
    </element>
  </start>
  <!--
    <repository/> element, types offer and referral
    (input to configure_publication_client).
  -->
  <start combine="choice">
    <element name="repository">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <attribute name="handle">
        <ref name="object_handle"/>
      </attribute>
      <attribute name="parent_handle">
        <ref name="object_handle"/>
      </attribute>
      <ref name="repository_payload"/>
      <element name="bpki_client_ta">
        <ref name="base64"/>
      </element>
    </element>
  </start>
  <!--
    <repository/> element, confirmation type (output of
    configure_publication_client).
  -->
  <start combine="choice">
    <element name="repository">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <attribute name="type">
        <value>confirmed</value>
      </attribute>
      <attribute name="parent_handle">
        <ref name="object_handle"/>
      </attribute>
      <attribute name="client_handle">
        <ref name="pubd_handle"/>
      </attribute>
      <attribute name="service_uri">
        <ref name="uri"/>
      </attribute>
      <attribute name="sia_base">
        <ref name="uri"/>
      </attribute>
      <element name="bpki_server_ta">
        <ref name="base64"/>
      </element>
      <element name="bpki_client_ta">
        <ref name="base64"/>
      </element>
      <optional>
        <ref name="authorization"/>
      </optional>
      <optional>
        <ref name="contact_info"/>
      </optional>
    </element>
  </start>
  <!--
    <referral/> element.  This is the entirety of a separate message
    which is signed with CMS then included ase the Base64 content of an
    <authorization/> element in the main message.
  -->
  <start combine="choice">
    <element name="referral">
      <attribute name="version">
        <ref name="version"/>
      </attribute>
      <attribute name="authorized_sia_base">
        <ref name="uri"/>
      </attribute>
      <ref name="base64"/>
    </element>
  </start>
</grammar>
<!--
  Local Variables:
  indent-tabs-mode: nil
  comment-start: "# "
  comment-start-skip: "#[ \t]*"
  End:
-->