LibItsPki_Templates.ttcn 23.8 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
/**
 *  @author   ETSI / STF545
 *  @version  $URL$
 *            $Id$
 *  @desc     Module containing templates for IT PKI Protocol
 *  @copyright   ETSI Copyright Notification
 *               No part may be reproduced except as authorized by written permission.
 *               The copyright and the foregoing restriction extend to reproduction in all media.
 *               All rights reserved.
 *
 */
module LibItsPki_Templates {
garciay's avatar
garciay committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  
  // LibCommon
  import from LibCommon_BasicTypesAndValues all;
  import from LibCommon_DataStrings all;
  
  // LibItsCommon
  import from LibItsCommon_TypesAndValues all;
  import from LibItsCommon_Functions all;
  import from LibItsCommon_TypesAndValues all;
  import from LibItsCommon_ASN1_NamedNumbers all;
  
  // LibIts
  import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
  import from IEEE1609dot2 language "ASN.1:1997" all;
  import from EtsiTs102941BaseTypes language "ASN.1:1997" all;
  import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all;
29
  import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all;
30
  import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all;
31
  import from EtsiTs102941MessagesCa language "ASN.1:1997" all;
garciay's avatar
garciay committed
32
33
34
35
  import from EtsiTs103097Module language "ASN.1:1997" all;
  
  // LibItsSecurity
  import from LibItsSecurity_Templates all;
36

37
38
39
  // LibItsPki
  import from LibItsPki_TypesAndValues all;

garciay's avatar
garciay committed
40
41
42
  template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_request_signed_for_pop(
                                                                                       in template (value) InnerEcRequestSignedForPop p_inner_ec_request_signed_for_pop
                                                                                       ) := {
43
    version := PkiProtocolVersion,
garciay's avatar
garciay committed
44
45
46
47
48
49
50
51
    content := {
      enrolmentRequest := p_inner_ec_request_signed_for_pop
    }
  } // End of template m_etsiTs102941Data_inner_ec_request_signed_for_pop
  
  template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_response(
                                                                         in template (value) InnerEcResponse p_inner_ec_response
                                                                         ) := {
52
    version := PkiProtocolVersion,
garciay's avatar
garciay committed
53
54
55
56
57
    content := {
      enrolmentResponse := p_inner_ec_response
    }
  } // End of template m_etsiTs102941Data_inner_ec_response

58
  template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_request(
59
                                                                        in template (value) InnerAtRequest p_inner_at_request
60
61
62
                                                                        ) := {
    version := PkiProtocolVersion,
    content := {
63
      authorizationRequest := p_inner_at_request
64
65
66
67
68
69
70
71
72
73
74
75
    }
  } // End of template m_etsiTs102941Data_inner_at_request
  
  template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_response(
                                                                         in template (value) InnerAtResponse p_inner_at_response
                                                                         ) := {
    version := PkiProtocolVersion,
    content := {
      authorizationResponse := p_inner_at_response
    }
  } // End of template m_etsiTs102941Data_inner_at_response
  
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
  template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_request(
                                                                                        in template (value) AuthorizationValidationRequest p_authorization_validation_request
                                                                                        ) := {
    version := PkiProtocolVersion,
    content := {
      authorizationValidationRequest := p_authorization_validation_request
    }
  } // End of template m_etsiTs102941Data_authorization_validation_request
  
  template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_response(
                                                                         in template (value) AuthorizationValidationResponse p_authorization_validation_response
                                                                         ) := {
    version := PkiProtocolVersion,
    content := {
      authorizationValidationResponse := p_authorization_validation_response
    }
  } // End of template m_etsiTs102941Data_authorization_validation_response
  
garciay's avatar
garciay committed
94
95
96
97
98
99
100
101
102
103
  template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage(
                                                                        template (present) EncryptedData p_encryptedData := ?
                                                                        ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_enrolmentRequestMessage
  
  template (present) EnrolmentResponseMessage mw_enrolmentResponseMessage(
                                                                         template (present) EncryptedData p_encryptedData := ?
                                                                         ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_enrolmentResponseMessage

104
105
106
107
  template (value) EtsiTs103097Data m_authorizationValidationRequestMessage(
                                                                            in template (value) EncryptedData p_encryptedData
                                                                            ) modifies m_etsiTs103097Data_encrypted := {
  } // End of template m_authorizationValidationRequestMessage
garciay's avatar
garciay committed
108
  
Yann Garcia's avatar
Yann Garcia committed
109
110
111
112
113
  template (present) EtsiTs103097Data mw_authorizationValidationResponseMessage(
                                                                                template (present) EncryptedData p_encryptedData := ?
                                                                                ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_authorizationValidationResponseMessage
  
114
115
116
117
118
  template (value) AuthorizationRequestMessage m_authorizationRequestMessage(
                                                                             in template (value) EncryptedData p_encryptedData
                                                                             ) modifies m_etsiTs103097Data_encrypted := {
  } // End of template m_authorizationRequestMessage
  
garciay's avatar
garciay committed
119
120
121
122
123
  template (present) AuthorizationRequestMessage mw_authorizationRequestMessage(
                                                                                template (present) EncryptedData p_encryptedData := ?
                                                                                ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_authorizationRequestMessage
  
124
  template (value) AuthorizationResponseMessage m_authorizationResponseMessage(
125
126
                                                                               in template (value) EncryptedData p_encryptedData
                                                                               ) modifies m_etsiTs103097Data_encrypted := {
127
  } // End of template m_authorizationResponseMessage
garciay's avatar
garciay committed
128
  
garciay's avatar
garciay committed
129
130
131
132
133
  template (present) AuthorizationResponseMessage mw_authorizationResponseMessage(
                                                                                  template (present) EncryptedData p_encryptedData := ?
                                                                                  ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_authorizationResponseMessage
  
garciay's avatar
garciay committed
134
135
136
137
138
139
  template (value) EtsiTs102941DataContent m_enrolmentRequest(
                                                              in template (value) InnerEcRequestSignedForPop p_enrolmentRequest
                                                              ) := {
    enrolmentRequest := p_enrolmentRequest
  } // End of template m_enrolmentRequest
  
140
141
142
143
144
145
146
147
148
149
150
  template (present) EtsiTs102941DataContent mw_enrolmentRequest(
                                                                 template (present) InnerEcRequestSignedForPop p_enrolmentRequest := ?
                                                                 ) := {
  enrolmentRequest := p_enrolmentRequest
  } // End of template mw_enrolmentRequest

  template (present) InnerEcRequestSignedForPop mw_innerEcRequestSignedForPop(
                                                                              template (present) SignedData p_signedData := ?
                                                                              ) modifies mw_etsiTs103097Data_signed := {
  } // End of template mw_innerEcRequestSignedForPop
  
garciay's avatar
garciay committed
151
152
153
154
155
156
  template (present) EtsiTs102941DataContent mw_enrolmentResponse(
                                                                  template (present) InnerEcResponse p_enrolmentResponse := ?
                                                                  ) := {
    enrolmentResponse := p_enrolmentResponse
  } // End of template mw_enrolmentResponse
  
157
158
159
160
161
162
163
164
165
166
167
168
  template (value) EtsiTs102941DataContent m_authorizationRequest(
                                                                  in template (value) InnerAtRequest p_authorizationRequest
                                                                  ) := {
    authorizationRequest := p_authorizationRequest
  } // End of template m_authorizationRequest
  
  template (present) EtsiTs102941DataContent mw_authorizationResponse(
                                                                      template (present) InnerAtResponse p_authorizationResponse := ?
                                                                      ) := {
    authorizationResponse := p_authorizationResponse
  } // End of template mw_authorizationResponse
  
169
170
171
172
173
174
  template (present) EtsiTs102941DataContent mw_authorizationValidationResponse(
                                                                                template (present) AuthorizationValidationResponse p_authorization_alidation_response := ?
                                                                                ) := {
    authorizationValidationResponse := p_authorization_alidation_response
  } // End of template mw_authorizationValidationResponse
  
garciay's avatar
garciay committed
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
  template (value) InnerEcRequest m_innerEcRequest(
                                                   in template (value) charstring p_itsId,
                                                   in template (value) PublicKeys p_publicKeys,
                                                   in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes
                                                   ) := {
    itsId                      := p_itsId,
    certificateFormat          := 1,
    publicKeys                 := p_publicKeys,
    requestedSubjectAttributes := p_requestedSubjectAttributes
  } // End of template m_innerEcRequest
  
  template (present) InnerEcRequest mw_innerEcRequest(
                                                      template (present) charstring p_itsId := ?,
                                                      template (present) PublicKeys p_publicKeys := ?,
                                                      template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ?
                                                      ) := {
    itsId                      := p_itsId,
    certificateFormat          := 1,
    publicKeys                 := p_publicKeys,
    requestedSubjectAttributes := p_requestedSubjectAttributes
  } // End of template mw_innerEcRequest
  
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
  template (value) InnerAtRequest m_innerAtRequest(
                                                   in template (value) PublicKeys p_publicKeys,
                                                   in template (value) Oct32 p_hmacKey,
                                                   in template (value) SharedAtRequest p_sharedAtRequest,
                                                   in template (value) EcSignature p_ecSignature
                                                   ) := {
    publicKeys      := p_publicKeys,
    hmacKey         := p_hmacKey,
    sharedAtRequest := p_sharedAtRequest,
    ecSignature     := p_ecSignature
  } // End of template m_innerAtRequest
  
  template (present) InnerAtRequest mw_innerAtRequest(
                                                      template (present) PublicKeys p_publicKeys := ?,
                                                      template (present) Oct32 p_hmacKey := ?,
                                                      template (present) SharedAtRequest p_sharedAtRequest := ?,
                                                      template (present) EcSignature p_ecSignature := ?
                                                      ) := {
    publicKeys      := p_publicKeys,
    hmacKey         := p_hmacKey,
    sharedAtRequest := p_sharedAtRequest,
    ecSignature     := p_ecSignature
  } // End of template mw_innerAtRequest
  
garciay's avatar
garciay committed
221
222
223
224
225
226
227
  template (omit) PublicKeys m_publicKeys(
                                          in template (value) PublicVerificationKey p_verificationKey,
                                          in template (omit) PublicEncryptionKey p_encryptionKey := omit
                                          ) := {
  verificationKey := p_verificationKey,
  encryptionKey   := p_encryptionKey
  } // End of template m_publicKeys
228
  
garciay's avatar
garciay committed
229
230
231
232
233
234
235
  template PublicKeys mw_publicKeys(
                                    template (present) PublicVerificationKey p_verificationKey := ?,
                                    template PublicEncryptionKey p_encryptionKey := *
                                    ) := {
  verificationKey := p_verificationKey,
  encryptionKey   := p_encryptionKey
  } // End of template mw_publicKeys
236
  
garciay's avatar
garciay committed
237
238
239
240
241
242
  template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes(
                                                                              in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                              in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                              in template (omit) GeographicRegion p_region := omit,
                                                                              in template (omit) SubjectAssurance p_assuranceLevel := omit
                                                                              ) := {
Yann Garcia's avatar
Yann Garcia committed
243
  id                       := { none_ := NULL },
garciay's avatar
garciay committed
244
245
246
247
248
249
  validityPeriod       := p_validityPeriod,
  region               := p_region,
  assuranceLevel       := p_assuranceLevel,
  appPermissions       := p_appPermissions,
  certIssuePermissions := omit
  } // End of template m_certificateSubjectAttributes
250
  
garciay's avatar
garciay committed
251
252
253
254
255
256
257
258
  template (value) InnerEcResponse m_innerEcResponse_ok(
                                                        in template (value) Oct16 p_requestHash,
                                                        in template (value) EtsiTs103097Certificate p_certificate
                                                        ) := {
  requestHash  := p_requestHash,
  responseCode := ok,
  certificate  := p_certificate
  } // End of template m_innerEcResponse_ok
259
  
garciay's avatar
garciay committed
260
261
262
263
264
265
266
267
  template (present) InnerEcResponse mw_innerEcResponse_ok(
                                                           template (present) Oct16 p_requestHash := ?,
                                                           template (present) EtsiTs103097Certificate p_certificate := ?
                                                           ) := {
  requestHash  := p_requestHash,
  responseCode := ok,
  certificate  := p_certificate
  } // End of template mw_innerEcResponse_ok
268
  
garciay's avatar
garciay committed
269
270
271
272
273
274
275
276
  template (value) InnerEcResponse m_innerEcResponse_ko(
                                                        in template (value) Oct16 p_requestHash,
                                                        in template (value) EnrolmentResponseCode p_responseCode
                                                        ) := {
  requestHash  := p_requestHash,
  responseCode := p_responseCode,
  certificate  := omit
  } // End of template m_innerEcResponse_ko
277
  
garciay's avatar
garciay committed
278
279
280
281
282
283
  template (present) InnerEcResponse mw_innerEcResponse_ko(
                                                           template (present) Oct16 p_requestHash := ?,
                                                           template (present) EnrolmentResponseCode p_responseCode := complement(ok)
                                                           ) := {
  requestHash  := p_requestHash,
  responseCode := p_responseCode,
284
  certificate  := omit
garciay's avatar
garciay committed
285
286
  } // End of template mw_innerEcResponse_ko
  
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
  template (value) InnerAtResponse m_innerAtResponse_ok(
                                                        in template (value) Oct16 p_requestHash,
                                                        in template (value) EtsiTs103097Certificate p_certificate
                                                        ) := {
  requestHash  := p_requestHash,
  responseCode := ok,
  certificate  := p_certificate
  } // End of template m_innerAtResponse_ok
  
  template (present) InnerAtResponse mw_innerAtResponse_ok(
                                                           template (present) Oct16 p_requestHash := ?,
                                                           template (present) EtsiTs103097Certificate p_certificate := ?
                                                           ) := {
  requestHash  := p_requestHash,
  responseCode := ok,
  certificate  := p_certificate
  } // End of template mw_innerAtResponse_ok
garciay's avatar
garciay committed
304
  
305
306
307
308
309
310
311
312
  template (present) InnerAtResponse mw_innerAtResponse_ko(
                                                           template (present) Oct16 p_requestHash := ?,
                                                           template (present) AuthorizationResponseCode p_responseCode := complement(ok)
                                                           ) := {
  requestHash  := p_requestHash,
  responseCode := p_responseCode,
  certificate  := omit
  } // End of template mw_innerAtResponse_ko
garciay's avatar
garciay committed
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
  template (value) AuthorizationValidationRequest m_authorizationValidationRequest(
                                                                                   in template (value) SharedAtRequest p_sharedAtRequest,
                                                                                   in template (value) EcSignature p_ecSignature
                                                                                   ) := {
    sharedAtRequest := p_sharedAtRequest,
    ecSignature     := p_ecSignature
  } // End of template m_authorizationValidationRequest
  
  template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ok(
                                                                                           template (present) Oct16 p_requestHash := ?,
                                                                                           template (present) CertificateSubjectAttributes p_confirmedSubjectAttributes := ?
                                                                                           ) := {
    requestHash                := p_requestHash,
    responseCode               := ok,
    confirmedSubjectAttributes := p_confirmedSubjectAttributes
  } // End of template mw_authorizationValidationResponse_ok
  
  template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ko(
                                                                                           template (present) Oct16 p_requestHash := ?
                                                                                           ) := {
    requestHash                := p_requestHash,
    responseCode               := complement(ok),
    confirmedSubjectAttributes := omit
  } // End of template mw_authorizationValidationResponse_ko
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

  template (value) SharedAtRequest m_shared_at_request(
                                                       in template (value) HashedId8 p_eaId,
                                                       in template (value) Oct16 p_keyTag,
                                                       in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes
                                                       ) := {
    eaId                       := p_eaId,
    keyTag                     := p_keyTag,
    certificateFormat          := 1,
    requestedSubjectAttributes := p_requestedSubjectAttributes
  } // End of template m_shared_at_request
  
  template (present) SharedAtRequest mw_shared_at_request(
                                                          template (present) HashedId8 p_eaId := ?,
                                                          template (present) Oct16 p_keyTag := ?,
                                                          template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ?
                                                       ) := {
    eaId                       := p_eaId,
    keyTag                     := p_keyTag,
    certificateFormat          := 1,
    requestedSubjectAttributes := p_requestedSubjectAttributes
  } // End of template mw_shared_at_request

  template (value) EcSignature m_ec_signature(
                                              in template (value) EtsiTs103097Data p_encryptedEcSignature
                                              ) := {
    encryptedEcSignature := p_encryptedEcSignature
  } // End of template m_ec_signature
  
  template (present) EcSignature mw_ec_signature(
                                                 template (present) EtsiTs103097Data p_encryptedEcSignature := ?
                                              ) := {
    encryptedEcSignature := p_encryptedEcSignature
  } // End of template mw_ec_signature

  template (value) EcSignature m_ec_signature_ext_payload(
                                                          in template (value) EtsiTs103097Data p_ecSignature
                                                          ) := {
    ecSignature := p_ecSignature
  } // End of template m_ec_signature_ext_payload
  
  template (present) EcSignature mw_ec_signature_ext_payload(
                                                             template (present) EtsiTs103097Data p_ecSignature := ?
                                                             ) := {
    ecSignature := p_ecSignature
  } // End of template mw_ec_signature_ext_payload



  template (omit) CertificateSubjectAttributes m_certificate_subject_attributes(
                                                                                in template (omit) CertificateId p_id := omit,
                                                                                in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                                in template (omit) GeographicRegion p_region := omit,
                                                                                in template (omit) SubjectAssurance p_assuranceLevel := omit,
                                                                                in template (omit) SequenceOfPsidSsp p_appPermissions := omit,
                                                                                in template (omit) SequenceOfPsidGroupPermissions p_certIssuePermissions := omit
                                                                                ) := {
    id                   := p_id,
    validityPeriod       := p_validityPeriod,
    region               := p_region,
    assuranceLevel       := p_assuranceLevel,
    appPermissions       := p_appPermissions,
    certIssuePermissions := p_certIssuePermissions
  } // End of template m_certificate_subject_attributes
402
  
garciay's avatar
garciay committed
403
} // End of module LibItsPki_Templates