-
Notifications
You must be signed in to change notification settings - Fork 375
/
pki.xsd
360 lines (333 loc) · 17.5 KB
/
pki.xsd
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
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://pki-factory.nowina.lu/pki-factory"
xmlns="http://pki-factory.nowina.lu/pki-factory"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation>This schema is used to build a JAXB PKI with provided the configuration.</xs:documentation>
</xs:annotation>
<xs:complexType name="pki">
<xs:annotation>
<xs:documentation>The root element of the PKI factory</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="certificate" type="CertificateType" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>A single certificate token representation</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the PKI</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="organization" type="xs:string">
<xs:annotation>
<xs:documentation>Organization name where PKI is created</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="country" type="xs:string">
<xs:annotation>
<xs:documentation>Country name where PKI is created</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="pki" type="pki"/>
<xs:complexType name="CertificateType">
<xs:annotation>
<xs:documentation>Contains configuration of a single certificate token</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="serialNumber" type="xs:long">
<xs:annotation>
<xs:documentation>A serial number of the certificate</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="subject" type="xs:string">
<xs:annotation>
<xs:documentation>A common name of the certificate</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="organization" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>The organization name of the certificate's owner.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="country" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>The two-letter code of a country of the certificate's owner.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="pseudo" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>A pseudonym of the certificate</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="issuer" type="EntityKey">
<xs:annotation>
<xs:documentation>The issuer certificate identifier. Shall be defined by a serial number and an issuer's common name. For self-signed certificates, shall contain the information about the certificate itself.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="crossCertificate" type="EntityKey" minOccurs="0">
<xs:annotation>
<xs:documentation>Cross-certificate with the same key pair as the current certificate. Shall be bi-directional link. Shall be defined by a serial number and an issuer's common name.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ocspResponder" type="EntityKey" minOccurs="0">
<xs:annotation>
<xs:documentation>Delegated OCSP Responder certificate. May be defined for CA certificates. Shall be defined by a serial number and an issuer's common name.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="notBefore" type="DateDefinitionType">
<xs:annotation>
<xs:documentation>Defines the notBefore field value of the certificate.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="notAfter" type="DateDefinitionType">
<xs:annotation>
<xs:documentation>Defines the notAfter field value of the certificate.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="keyAlgo" type="KeyAlgo">
<xs:annotation>
<xs:documentation>Configuration of a key pair linked to the certificate.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="digestAlgo" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>Digest Algorithm to be used on other certificate creation. NOTE: shall be defined in cases, when there is a need to encryption algorithm keys, such as for certificates with Ed448 or Ed25519 algorithms.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="keyUsages" minOccurs="0">
<xs:annotation>
<xs:documentation>A list of key usages for the certificate.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="keyUsage" type="KeyUsageBit" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>A single KeyUsage value bit.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="extendedKeyUsages" minOccurs="0">
<xs:annotation>
<xs:documentation>A list of extended key usages for the certificate.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="extendedKeyUsage" type="xs:string" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>A single ExtendedKeyUsage OID.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="certificatePolicies" minOccurs="0">
<xs:annotation>
<xs:documentation>Contains a list of certificate policies to be defined within the corresponding certificate's extension.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="certificatePolicy" type="xs:string" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Certificate policy's OID.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ca" type="emptyType" minOccurs="0">
<xs:annotation>
<xs:documentation>Defines whether the certificate is a CA certificate. Adds BasicConstraints.cA extension.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ocspNoCheck" type="emptyType" minOccurs="0">
<xs:annotation>
<xs:documentation>Defines whether the certificate should contain ocsp-no-check extension.</xs:documentation>
</xs:annotation>
</xs:element>
<!-- QC_COMPLIANCE("qc-compliance", "0.4.0.1862.1.1") -->
<!-- QC_LIMIT_VALUE("qc-limit-value","0.4.0.1862.1.2") -->
<!-- QC_RETENTION_PERIOD("qc-retention-period", "0.4.0.1862.1.3") -->
<!-- QC_SSCD("qc-sscd", "0.4.0.1862.1.4") -->
<!-- QC_PDS("qc-pds", "0.4.0.1862.1.5") -->
<xs:element name="qcStatementIds" minOccurs="0">
<xs:annotation>
<xs:documentation>List of QcStatement's to be added within a certificate.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="qcStatement" type="xs:string" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>QcStatement OID.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- QCT_ESIGN("qc-type-esign", "0.4.0.1862.1.6.1") -->
<!-- QCT_ESEAL("qc-type-eseal", "0.4.0.1862.1.6.2") -->
<!-- QCT_WEB("qc-type-web", "0.4.0.1862.1.6.3") -->
<xs:element name="qcTypes" minOccurs="0">
<xs:annotation>
<xs:documentation>List of QcType's to be added within a certificate. NOTE: the corresponding QcStatement will be added automatically, when this value is defined.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="qcType" type="xs:string" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>QcType OID.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="qcCClegislation" minOccurs="0">
<xs:annotation>
<xs:documentation>List of QcCClegoislation country codes to be added within a certificate. NOTE: the corresponding QcStatement will be added automatically, when this value is defined.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="CountryName" type="xs:string" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Two-letter country code identifier.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="crl" type="EntityKey" minOccurs="0">
<xs:annotation>
<xs:documentation>Defines certificate to issue CRL. If not present, no CRL distribution point will be defined within the certificate.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ocsp" type="EntityKey" minOccurs="0">
<xs:annotation>
<xs:documentation>Defines certificate to issue OCSP responses. If not present, no OCSP access point will be defined within the certificate.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="caIssuers" type="EntityKey" minOccurs="0">
<xs:annotation>
<xs:documentation>Defines certificate to issue the Authority Information Access caIssuers. If not present, no Authority Information Access caIssuers will be defined within the certificate.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="trustAnchor" type="emptyType" minOccurs="0">
<xs:annotation>
<xs:documentation>Defines whether the certificate should be recognized as a trust anchor within the PKI.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="revocation" type="RevocationType" minOccurs="0">
<xs:annotation>
<xs:documentation>Contains status information for a revoked certificate.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="KeyUsageBit" final="restriction">
<xs:annotation>
<xs:documentation>Defines the KeyUsage bit.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="digitalSignature" />
<xs:enumeration value="nonRepudiation" />
<xs:enumeration value="keyEncipherment" />
<xs:enumeration value="dataEncipherment" />
<xs:enumeration value="keyAgreement" />
<xs:enumeration value="keyCertSign" />
<xs:enumeration value="crlSign" />
<xs:enumeration value="encipherOnly" />
<xs:enumeration value="decipherOnly" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="emptyType">
<xs:annotation>
<xs:documentation>An element for unambiguous definition of TRUE values.</xs:documentation>
</xs:annotation>
<xs:sequence/>
</xs:complexType>
<xs:complexType name="DateDefinitionType">
<xs:annotation>
<xs:documentation>Defines a date value.</xs:documentation>
</xs:annotation>
<xs:attribute name="year" type="xs:int" use="optional"/>
<xs:attribute name="month" type="xs:int" use="optional"/>
<xs:attribute name="day" type="xs:int" use="optional"/>
</xs:complexType>
<xs:complexType name="RevocationType">
<xs:annotation>
<xs:documentation>Contains revocation status information for a revoked certificate.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="DateDefinitionType">
<xs:attribute name="reason" type="RevocationReason">
<xs:annotation>
<xs:documentation>The revocation reason.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="KeyAlgo">
<xs:annotation>
<xs:documentation>Configuration of a certificate's key pair.</xs:documentation>
</xs:annotation>
<xs:attribute name="encryption" type="xs:string">
<xs:annotation>
<xs:documentation>The encryption algorithm name.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="length" type="xs:int" use="optional">
<xs:annotation>
<xs:documentation>The key length.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="pss" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>Defines whether Mask Generation Function (PSS) should be used. The value is used on other certificates creation.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- If serial number is defined, the parameter works as a primary key (combination of issuer's name + serial number) -->
<!-- In other case, the string value defines the target certificate name -->
<xs:complexType name="EntityKey">
<xs:annotation>
<xs:documentation>Represents a identifier uniquely identifying a certificate within the PKI. Contains a serial number and issuer's common name of the certificate.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:annotation>
<xs:documentation>Subject name of the certificate's issuer certificate.</xs:documentation>
</xs:annotation>
<xs:extension base="xs:string">
<xs:attribute name="serialNumber" type="xs:long" use="optional">
<xs:annotation>
<xs:documentation>Serial number of the target certificate.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="RevocationReason" final="restriction">
<xs:annotation>
<xs:documentation>Revocation reason value.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="unspecified"/>
<xs:enumeration value="keyCompromise"/>
<xs:enumeration value="cACompromise"/>
<xs:enumeration value="affiliationChanged"/>
<xs:enumeration value="superseded"/>
<xs:enumeration value="cessationOfOperation"/>
<xs:enumeration value="certificateHold"/>
<!-- <xs:enumeration value="unknown" />-->
<xs:enumeration value="removeFromCRL"/>
<xs:enumeration value="privilegeWithdrawn"/>
<xs:enumeration value="aACompromise"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>