aboutsummaryrefslogtreecommitdiffstats
path: root/library/euicc/RSPDefinitions.asn
blob: 56dd1afcffcd02b91a18b8a7117e97a2e2f7666b (plain)
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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
--Version V2.5
RSPDefinitions {joint-iso-itu-t(2) international-organizations(23) gsma(146) rsp(1)
asn1modules(1) sgp22v2(2)}
DEFINITIONS
AUTOMATIC TAGS
EXTENSIBILITY IMPLIED ::=
BEGIN

IMPORTS Certificate, CertificateList, Time FROM PKIX1Explicit88 {iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-pkix1-explicit(18)}
SubjectKeyIdentifier FROM PKIX1Implicit88 {iso(1) identified-organization(3) dod(6)
internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-pkix1-implicit(19)}
UICCCapability FROM PEDefinitions {joint-iso-itu-t(2) international-organizations(23) tca(143) euicc-profile(1) spec-version(1) version-three(3)};
-- The UICCCapability import module version is defined in section 5.7.8

id-rsp OBJECT IDENTIFIER ::= {joint-iso-itu-t(2) international-organizations(23)
gsma(146) rsp(1)}

-- Basic types, for size constraints
Octet8 ::= OCTET STRING (SIZE(8))
Octet4 ::= OCTET STRING (SIZE(4))
Octet16 ::= OCTET STRING (SIZE(16))
OctetTo16 ::= OCTET STRING (SIZE(1..16))
Octet32 ::= OCTET STRING (SIZE(32))
Octet1 ::= OCTET STRING(SIZE(1))
Octet2 ::= OCTET STRING (SIZE(2))
VersionType ::= OCTET STRING(SIZE(3)) -- major/minor/revision version are coded as binary value on byte 1/2/3, e.g. '02 00 0C' for v2.0.12.
-- If revision is not used (e.g. v2.1), byte 3 SHALL be set to '00'.
Iccid ::= [APPLICATION 26] OCTET STRING (SIZE(10)) -- ICCID as coded in EFiccid, corresponding tag is '5A'
RemoteOpId ::= [2] INTEGER {installBoundProfilePackage(1)}
TransactionId ::= OCTET STRING (SIZE(1..16))

-- Definition of EUICCInfo1 --------------------------
GetEuiccInfo1Request ::= [32] SEQUENCE { -- Tag 'BF20'
}

EUICCInfo1 ::= [32] SEQUENCE { -- Tag 'BF20'
   svn [2] VersionType,    -- GSMA SGP.22 version supported (SVN)
   euiccCiPKIdListForVerification [9] SEQUENCE OF SubjectKeyIdentifier, -- List of CI Public Key Identifiers supported on the eUICC for signature verification
   euiccCiPKIdListForSigning [10] SEQUENCE OF SubjectKeyIdentifier -- List of CI Public Key Identifier supported on the eUICC for signature creation
}

-- Definition of EUICCInfo2 --------------------------
GetEuiccInfo2Request ::= [34] SEQUENCE { -- Tag 'BF22'
}

EUICCInfo2 ::= [34] SEQUENCE { -- Tag 'BF22'
   profileVersion [1] VersionType,      -- Base eUICC Profile package version supported
   svn [2] VersionType,    -- GSMA SGP.22 version supported (SVN)
   euiccFirmwareVer [3] VersionType,    -- eUICC Firmware version
   extCardResource [4] OCTET STRING,    -- Extended Card Resource Information according to ETSI TS 102 226
   uiccCapability [5] UICCCapability,
   ts102241Version [6] VersionType OPTIONAL,
   globalplatformVersion [7] VersionType OPTIONAL,
   rspCapability [8] RspCapability,
   euiccCiPKIdListForVerification [9] SEQUENCE OF SubjectKeyIdentifier, -- List of CI Public Key Identifiers supported on the eUICC for signature verification
   euiccCiPKIdListForSigning [10] SEQUENCE OF SubjectKeyIdentifier, -- List of CI Public Key Identifier supported on the eUICC for signature creation
   euiccCategory [11] INTEGER {
      other(0),
      basicEuicc(1),
      mediumEuicc(2),
      contactlessEuicc(3)
   } OPTIONAL,
   forbiddenProfilePolicyRules [25] PprIds OPTIONAL, -- Tag '99'
   ppVersion VersionType, -- Protection Profile version
   sasAcreditationNumber UTF8String (SIZE(0..64)),
   certificationDataObject [12] CertificationDataObject OPTIONAL,
   treProperties [13] BIT STRING {
     isDiscrete(0),
      isIntegrated(1),
      usesRemoteMemory(2) -- refers to the usage of remote memory protected by the Remote Memory Protection Function described in SGP.21 [4]
   } OPTIONAL,
   treProductReference [14] UTF8String OPTIONAL, -- Platform_Label as defined in GlobalPlatform DLOA specification [57]
   additionalEuiccProfilePackageVersions [15] SEQUENCE OF VersionType OPTIONAL
}

-- Definition of RspCapability
RspCapability ::= BIT STRING {
   additionalProfile(0), -- at least one more Profile can be installed
   crlSupport(1), -- CRL
   rpmSupport(2), -- Remote Profile Management
   testProfileSupport (3), -- support for test profile
  deviceInfoExtensibilitySupport (4), -- support for ASN.1 extensibility in the Device Info
   serviceSpecificDataSupport (5) -- support for Service Specific Data in the Profile Metadata
}

-- Definition of CertificationDataObject
CertificationDataObject ::= SEQUENCE {
   platformLabel UTF8String,     -- Platform_Label as defined in GlobalPlatform DLOA specification [57]
   discoveryBaseURL UTF8String   -- Discovery Base URL of the SE default DLOA Registrar as defined in GlobalPlatform DLOA specification [57]
}

CertificateInfo ::= BIT STRING {
   reserved(0), -- eUICC has a CERT.EUICC.ECDSA in GlobalPlatform format. The use of this bit is deprecated.
   certSigningX509(1),     -- eUICC has a CERT.EUICC.ECDSA in X.509 format
   rfu2(2),
   rfu3(3),
   reserved2(4), -- Handling of Certificate in GlobalPlatform format. The use of this bit is deprecated.
   certVerificationX509(5)-- Handling of Certificate in X.509 format
}


-- Definition of DeviceInfo
DeviceInfo ::= SEQUENCE {
   tac Octet4,
   deviceCapabilities DeviceCapabilities,
   imei Octet8 OPTIONAL
}

DeviceCapabilities ::= SEQUENCE { -- Highest fully supported release for each definition
  -- The device SHALL set all the capabilities it supports
   gsmSupportedRelease VersionType OPTIONAL,
   utranSupportedRelease VersionType OPTIONAL,
   cdma2000onexSupportedRelease VersionType OPTIONAL,
   cdma2000hrpdSupportedRelease VersionType OPTIONAL,
   cdma2000ehrpdSupportedRelease VersionType OPTIONAL,
   eutranEpcSupportedRelease VersionType OPTIONAL,
   contactlessSupportedRelease VersionType OPTIONAL,
   rspCrlSupportedVersion VersionType OPTIONAL,
   nrEpcSupportedRelease VersionType OPTIONAL,
   nr5gcSupportedRelease VersionType OPTIONAL,
   eutran5gcSupportedRelease VersionType OPTIONAL,
  lpaSvn VersionType OPTIONAL, -- Not defined in this version of SGP.22
   catSupportedClasses CatSupportedClasses OPTIONAL, -- Not defined in this version of SGP.22
   euiccFormFactorType EuiccFormFactorType OPTIONAL, -- Not defined in this version of SGP.22
   deviceAdditionalFeatureSupport DeviceAdditionalFeatureSupport OPTIONAL
}

-- Definition of DeviceAdditionalFeatureSupport
DeviceAdditionalFeatureSupport ::= SEQUENCE {
   naiSupport VersionType OPTIONAL -- Device supports Network Access Identifier
}

CatSupportedClasses ::= BIT STRING
EuiccFormFactorType ::= INTEGER


ProfileInfoListRequest ::= [45] SEQUENCE { -- Tag 'BF2D'
   searchCriteria [0] CHOICE {
      isdpAid [APPLICATION 15] OctetTo16, -- AID of the ISD-P, tag '4F'
      iccid Iccid, -- ICCID, tag '5A'
      profileClass [21] ProfileClass -- Tag '95'
   } OPTIONAL,
   tagList [APPLICATION 28] OCTET STRING OPTIONAL -- tag '5C'
}

-- Definition of ProfileInfoList
ProfileInfoListResponse ::= [45] CHOICE { -- Tag 'BF2D'
   profileInfoListOk SEQUENCE OF ProfileInfo,
   profileInfoListError ProfileInfoListError
}

ProfileInfo ::= [PRIVATE 3] SEQUENCE { -- Tag 'E3'
   iccid Iccid OPTIONAL,
   isdpAid [APPLICATION 15] OctetTo16 OPTIONAL, -- AID of the ISD-P containing the Profile, tag '4F'
   profileState [112] ProfileState OPTIONAL, -- Tag '9F70'
   profileNickname [16] UTF8String (SIZE(0..64)) OPTIONAL, -- Tag '90'
   serviceProviderName [17] UTF8String (SIZE(0..32)) OPTIONAL, -- Tag '91'
   profileName [18] UTF8String (SIZE(0..64)) OPTIONAL, -- Tag '92'
   iconType [19] IconType OPTIONAL, -- Tag '93'
   icon [20] OCTET STRING (SIZE(0..1024)) OPTIONAL, -- Tag '94', see condition in ES10c:GetProfilesInfo
   profileClass [21] ProfileClass OPTIONAL, -- Tag '95'
   notificationConfigurationInfo [22] SEQUENCE OF NotificationConfigurationInformation OPTIONAL, -- Tag 'B6'
   profileOwner [23] OperatorId OPTIONAL, -- Tag 'B7'
   dpProprietaryData [24] DpProprietaryData OPTIONAL, -- Tag 'B8'
   profilePolicyRules [25] PprIds OPTIONAL, -- Tag '99'
   serviceSpecificDataStoredInEuicc [34] VendorSpecificExtension OPTIONAL -- Tag 'BF22'
}

PprIds ::= BIT STRING {-- Definition of Profile Policy Rules identifiers
   pprUpdateControl(0), -- defines how to update PPRs via ES6
   ppr1(1), -- Indicator for PPR1 'Disabling of this Profile is not allowed'
   ppr2(2) -- Indicator for PPR2 'Deletion of this Profile is not allowed'
}

OperatorId ::= SEQUENCE {
   mccMnc OCTET STRING (SIZE(3)), -- MCC and MNC coded as defined in 3GPP TS 24.008 [32]
   gid1 OCTET STRING OPTIONAL, -- referring to content of EF GID1 (file identifier '6F3E') as defined in 3GPP TS 31.102 [54]
   gid2 OCTET STRING OPTIONAL -- referring to content of EF GID2 (file identifier '6F3F') as defined in 3GPP TS 31.102 [54]
}

ProfileInfoListError ::= INTEGER {incorrectInputValues(1), undefinedError(127)}

-- Definition of StoreMetadata request

StoreMetadataRequest ::= [37] SEQUENCE { -- Tag 'BF25'
   iccid Iccid,
   serviceProviderName [17] UTF8String (SIZE(0..32)), -- Tag '91'
   profileName [18] UTF8String (SIZE(0..64)), -- Tag '92' (corresponds to 'Short Description' defined in SGP.21 [2])
   iconType [19] IconType OPTIONAL, -- Tag '93' (JPG or PNG)
   icon [20] OCTET STRING (SIZE(0..1024)) OPTIONAL, -- Tag '94'(Data of the icon. Size 64 x 64 pixel. This field SHALL only be present if iconType is present)
   profileClass [21] ProfileClass DEFAULT operational, -- Tag '95'
   notificationConfigurationInfo [22] SEQUENCE OF NotificationConfigurationInformation OPTIONAL,
   profileOwner [23] OperatorId OPTIONAL, -- Tag 'B7'
   profilePolicyRules [25] PprIds OPTIONAL, -- Tag '99'
   serviceSpecificDataStoredInEuicc [34] VendorSpecificExtension OPTIONAL, -- Tag 'BF22'
   serviceSpecificDataNotStoredInEuicc [35] VendorSpecificExtension OPTIONAL -- Tag 'BF23'
}

NotificationEvent ::= BIT STRING {
   notificationInstall(0),
   notificationEnable(1),
   notificationDisable(2),
   notificationDelete(3)
}

NotificationConfigurationInformation ::= SEQUENCE {
   profileManagementOperation NotificationEvent,
   notificationAddress UTF8String -- FQDN to forward the notification
}

OPENTYPE ::= CLASS {
  &typeId OBJECT IDENTIFIER,
  &Type
}

VendorSpecificExtension ::= SEQUENCE OF SEQUENCE {
   vendorOid [0] OPENTYPE.&typeId, -- OID of the vendor who defined this specific extension
   vendorSpecificData [1] OPENTYPE.&Type
}

IconType ::= INTEGER {jpg(0), png(1)}
ProfileState ::= INTEGER {disabled(0), enabled(1)}
ProfileClass ::= INTEGER {test(0), provisioning(1), operational(2)}

-- Definition of UpdateMetadata request
UpdateMetadataRequest ::= [42] SEQUENCE { -- Tag 'BF2A'
   serviceProviderName [17] UTF8String (SIZE(0..32)) OPTIONAL, -- Tag '91'
   profileName [18] UTF8String (SIZE(0..64)) OPTIONAL, -- Tag '92'
   iconType [19] IconType OPTIONAL, -- Tag '93'
   icon [20] OCTET STRING (SIZE(0..1024)) OPTIONAL, -- Tag '94'
   profilePolicyRules [25] PprIds OPTIONAL, -- Tag '99'
   serviceSpecificDataStoredInEuicc [34] VendorSpecificExtension OPTIONAL -- Tag 'BF22'
}

-- Definition of data objects for command PrepareDownload -------------------------
PrepareDownloadRequest ::= [33] SEQUENCE { -- Tag 'BF21'
   smdpSigned2 SmdpSigned2,                    -- Signed information
   smdpSignature2 [APPLICATION 55] OCTET STRING,      -- DP_Sign1, tag '5F37'
   hashCc Octet32 OPTIONAL, -- Hash of confirmation code
   smdpCertificate Certificate    -- CERT.DPpb.ECDSA
}

SmdpSigned2 ::= SEQUENCE {
   transactionId [0] TransactionId,     -- The TransactionID generated by the SM-DP+
   ccRequiredFlag BOOLEAN, --Indicates if the Confirmation Code is required
   bppEuiccOtpk [APPLICATION 73] OCTET STRING OPTIONAL      -- otPK.EUICC.ECKA already used for binding the BPP, tag '5F49'
}

PrepareDownloadResponse ::= [33] CHOICE { -- Tag 'BF21'
   downloadResponseOk PrepareDownloadResponseOk,
   downloadResponseError PrepareDownloadResponseError
}

PrepareDownloadResponseOk ::= SEQUENCE {
   euiccSigned2 EUICCSigned2,     -- Signed information
   euiccSignature2 [APPLICATION 55] OCTET STRING      -- tag '5F37'
}

EUICCSigned2 ::= SEQUENCE {
   transactionId [0] TransactionId,
   euiccOtpk [APPLICATION 73] OCTET STRING,           -- otPK.EUICC.ECKA, tag '5F49'
   hashCc Octet32 OPTIONAL        -- Hash of confirmation code
}

PrepareDownloadResponseError ::= SEQUENCE {
   transactionId [0] TransactionId,
   downloadErrorCode DownloadErrorCode
}

DownloadErrorCode ::= INTEGER {invalidCertificate(1), invalidSignature(2),
unsupportedCurve(3), noSessionContext(4), invalidTransactionId(5),
undefinedError(127)}

-- Definition of data objects for command AuthenticateServer--------------------
AuthenticateServerRequest ::= [56] SEQUENCE { -- Tag 'BF38'
   serverSigned1 ServerSigned1,                       -- Signed information
   serverSignature1 [APPLICATION 55] OCTET STRING,    -- tag ‘5F37’
   euiccCiPKIdToBeUsed SubjectKeyIdentifier,          -- CI Public Key Identifier to be used
   serverCertificate Certificate, -- RSP Server Certificate CERT.XXauth.ECDSA
   ctxParams1 CtxParams1
}

ServerSigned1 ::= SEQUENCE {
   transactionId [0] TransactionId,            -- The Transaction ID generated by the RSP Server
   euiccChallenge [1] Octet16,          -- The eUICC Challenge
   serverAddress [3] UTF8String, -- The RSP Server address
   serverChallenge [4] Octet16          -- The RSP Server Challenge
}

CtxParams1 ::= CHOICE {
   ctxParamsForCommonAuthentication CtxParamsForCommonAuthentication -- New contextual data objects MAY be defined for extensibility
}

CtxParamsForCommonAuthentication ::= SEQUENCE {
   matchingId UTF8String OPTIONAL,-- The MatchingId could be the Activation code token or EventID or empty
   deviceInfo DeviceInfo -- The Device information
}

AuthenticateServerResponse ::= [56] CHOICE { -- Tag 'BF38'
   authenticateResponseOk AuthenticateResponseOk,
   authenticateResponseError AuthenticateResponseError
}

AuthenticateResponseOk ::= SEQUENCE {
   euiccSigned1 EuiccSigned1,            -- Signed information
   euiccSignature1 [APPLICATION 55] OCTET STRING,     --EUICC_Sign1, tag 5F37
   euiccCertificate Certificate, -- eUICC Certificate (CERT.EUICC.ECDSA) signed by the EUM
   eumCertificate Certificate     -- EUM Certificate (CERT.EUM.ECDSA) signed by the requested CI
}

EuiccSigned1 ::= SEQUENCE {
   transactionId [0] TransactionId,
   serverAddress [3] UTF8String,
   serverChallenge [4] Octet16,   -- The RSP Server Challenge
   euiccInfo2 [34] EUICCInfo2,
   ctxParams1 CtxParams1
}

AuthenticateResponseError ::= SEQUENCE {
   transactionId [0] TransactionId,
   authenticateErrorCode AuthenticateErrorCode
}

AuthenticateErrorCode ::= INTEGER {invalidCertificate(1), invalidSignature(2),
unsupportedCurve(3), noSessionContext(4), invalidOid(5), euiccChallengeMismatch(6),
ciPKUnknown(7), undefinedError(127)}

-- Definition of Cancel Session------------------------------
CancelSessionRequest ::= [65] SEQUENCE { -- Tag 'BF41'
   transactionId TransactionId,   -- The TransactionID generated by the RSP Server
   reason CancelSessionReason
}

CancelSessionReason ::= INTEGER {endUserRejection(0), postponed(1), timeout(2),
pprNotAllowed(3), metadataMismatch(4), loadBppExecutionError(5),
undefinedReason(127)}

CancelSessionResponse ::= [65] CHOICE { -- Tag 'BF41'
   cancelSessionResponseOk CancelSessionResponseOk,
   cancelSessionResponseError INTEGER {invalidTransactionId(5),
undefinedError(127)}
}

CancelSessionResponseOk ::= SEQUENCE {
   euiccCancelSessionSigned EuiccCancelSessionSigned,        -- Signed information
   euiccCancelSessionSignature [APPLICATION 55] OCTET STRING -- tag '5F37
}

EuiccCancelSessionSigned ::= SEQUENCE {
   transactionId TransactionId,
   smdpOid OBJECT IDENTIFIER, -- SM-DP+ OID as contained in CERT.DPauth.ECDSA
   reason CancelSessionReason
}

-- Definition of Bound Profile Package --------------------------
BoundProfilePackage ::= [54] SEQUENCE { -- Tag 'BF36'
   initialiseSecureChannelRequest [35] InitialiseSecureChannelRequest, -- Tag 'BF23'
   firstSequenceOf87 [0] SEQUENCE OF [7] OCTET STRING, -- sequence of '87' TLVs
   sequenceOf88 [1] SEQUENCE OF [8] OCTET STRING, -- sequence of '88' TLVs
   secondSequenceOf87 [2] SEQUENCE OF [7] OCTET STRING OPTIONAL, -- sequence of '87' TLVs
   sequenceOf86 [3] SEQUENCE OF [6] OCTET STRING -- sequence of '86' TLVs
}

-- Definition of Get eUICC Challenge --------------------------
GetEuiccChallengeRequest ::= [46] SEQUENCE { -- Tag 'BF2E'
}

GetEuiccChallengeResponse ::= [46] SEQUENCE { -- Tag 'BF2E'
   euiccChallenge Octet16 -- random eUICC challenge
}

-- Definition of Profile Installation Result
ProfileInstallationResult ::= [55] SEQUENCE { -- Tag 'BF37'
   profileInstallationResultData [39] ProfileInstallationResultData,
   euiccSignPIR EuiccSignPIR
}

ProfileInstallationResultData ::= [39] SEQUENCE { -- Tag 'BF27'
   transactionId[0] TransactionId, -- The TransactionID generated by the SM-DP+
   notificationMetadata[47] NotificationMetadata,
   smdpOid OBJECT IDENTIFIER, -- SM-DP+ OID (same value as in CERT.DPpb.ECDSA)
   finalResult [2] CHOICE {
      successResult SuccessResult,
      errorResult ErrorResult
   }
}

EuiccSignPIR ::= [APPLICATION 55] OCTET STRING -- Tag '5F37', eUICC’s signature

SuccessResult ::= SEQUENCE {
   aid [APPLICATION 15] OCTET STRING (SIZE (5..16)), -- AID of ISD-P
   simaResponse OCTET STRING -- contains (multiple) 'EUICCResponse' as defined in [5]
}

ErrorResult ::= SEQUENCE {
   bppCommandId BppCommandId,
   errorReason ErrorReason,
   simaResponse OCTET STRING OPTIONAL -- contains (multiple) 'EUICCResponse' as defined in [5]
}

BppCommandId ::= INTEGER {initialiseSecureChannel(0), configureISDP(1),
storeMetadata(2), storeMetadata2(3), replaceSessionKeys(4), loadProfileElements(5)}

ErrorReason ::= INTEGER {
   incorrectInputValues(1),
   invalidSignature(2),
   invalidTransactionId(3),
   unsupportedCrtValues(4),
   unsupportedRemoteOperationType(5),
   unsupportedProfileClass(6),
   scp03tStructureError(7),
   scp03tSecurityError(8),
   installFailedDueToIccidAlreadyExistsOnEuicc(9),
   installFailedDueToInsufficientMemoryForProfile(10),
   installFailedDueToInterruption(11),
   installFailedDueToPEProcessingError (12),
   installFailedDueToDataMismatch(13),
   testProfileInstallFailedDueToInvalidNaaKey(14),
   pprNotAllowed(15),
   installFailedDueToUnknownError(127)
}

ListNotificationRequest ::= [40] SEQUENCE { -- Tag 'BF28'
    profileManagementOperation [1] NotificationEvent OPTIONAL
}

ListNotificationResponse ::= [40] CHOICE { -- Tag 'BF28'
   notificationMetadataList SEQUENCE OF NotificationMetadata,
   listNotificationsResultError INTEGER {undefinedError(127)}
}

NotificationMetadata ::= [47] SEQUENCE { -- Tag 'BF2F'
   seqNumber [0] INTEGER,
   profileManagementOperation [1] NotificationEvent, /*Only one bit SHALL be set to
1*/
   notificationAddress UTF8String, -- FQDN to forward the notification
   iccid Iccid OPTIONAL
}

-- Definition of Profile Nickname Information
SetNicknameRequest ::= [41] SEQUENCE { -- Tag 'BF29'
   iccid Iccid,
   profileNickname [16] UTF8String (SIZE(0..64))
}

SetNicknameResponse ::= [41] SEQUENCE { -- Tag 'BF29'
   setNicknameResult INTEGER {ok(0), iccidNotFound (1), undefinedError(127)}
}

id-rsp-cert-objects OBJECT IDENTIFIER ::= {         id-rsp cert-objects(2)}

id-rspExt OBJECT IDENTIFIER ::= {id-rsp-cert-objects 0}

id-rspRole OBJECT IDENTIFIER ::= {id-rsp-cert-objects 1}

-- Definition of OIDs for role identification
id-rspRole-ci OBJECT IDENTIFIER ::= {id-rspRole 0}
id-rspRole-euicc OBJECT IDENTIFIER ::= {id-rspRole 1}
id-rspRole-eum OBJECT IDENTIFIER ::= {id-rspRole 2}
id-rspRole-dp-tls OBJECT IDENTIFIER ::= {id-rspRole 3}
id-rspRole-dp-auth OBJECT IDENTIFIER ::= {id-rspRole 4}
id-rspRole-dp-pb OBJECT IDENTIFIER ::= {id-rspRole 5}
id-rspRole-ds-tls OBJECT IDENTIFIER ::= {id-rspRole 6}
id-rspRole-ds-auth OBJECT IDENTIFIER ::= {id-rspRole 7}

--Definition of data objects for InitialiseSecureChannel Request
InitialiseSecureChannelRequest ::= [35] SEQUENCE { -- Tag 'BF23'
   remoteOpId RemoteOpId, -- Remote Operation Type Identifier (value SHALL be set to installBoundProfilePackage)
   transactionId [0] TransactionId, -- The TransactionID generated by the SM-DP+
   controlRefTemplate[6] IMPLICIT ControlRefTemplate, -- Control Reference Template (Key Agreement). Current specification considers a subset of CRT specified in GlobalPlatform Card Specification [8], section 6.4.2.3 for the Mutual Authentication Data Field
   smdpOtpk [APPLICATION 73] OCTET STRING, ---otPK.DP.ECKA as specified in GlobalPlatform Card Specification [8] section 6.4.2.3 for ePK.OCE.ECKA, tag '5F49'
   smdpSign [APPLICATION 55] OCTET STRING -- SM-DP's signature, tag '5F37'
}

ControlRefTemplate ::= SEQUENCE {
   keyType[0] Octet1, -- Key type according to GlobalPlatform Card Specification [8] Table 11-16, AES= '88', Tag '80'
   keyLen[1] Octet1, --Key length in number of bytes. For current specification key length SHALL by 0x10 bytes, Tag '81'
   hostId[4] OctetTo16 -- Host ID value , Tag '84'
}

--Definition of data objects for ConfigureISDPRequest
ConfigureISDPRequest ::= [36] SEQUENCE { -- Tag 'BF24'
   dpProprietaryData [24] DpProprietaryData OPTIONAL -- Tag 'B8'
}

DpProprietaryData ::= SEQUENCE { -- maximum size including tag and length field: 128 bytes
   dpOid OBJECT IDENTIFIER -- OID in the tree of the SM-DP+ that created the Profile
   -- additional data objects defined by the SM-DP+ MAY follow
}

-- Definition of request message for command ReplaceSessionKeys
ReplaceSessionKeysRequest ::= [38] SEQUENCE { -- tag 'BF26'
/*The new initial MAC chaining value*/
   initialMacChainingValue OCTET STRING,
/*New session key value for encryption/decryption (PPK-ENC)*/
   ppkEnc OCTET STRING,
/*New session key value of the session key C-MAC computation/verification (PPK-MAC)*/
   ppkCmac OCTET STRING
}

-- Definition of data objects for RetrieveNotificationsList
RetrieveNotificationsListRequest ::= [43] SEQUENCE { -- Tag 'BF2B'
   searchCriteria CHOICE {
      seqNumber [0] INTEGER,
      profileManagementOperation [1] NotificationEvent
   } OPTIONAL
}

RetrieveNotificationsListResponse ::= [43] CHOICE { -- Tag 'BF2B'
   notificationList SEQUENCE OF PendingNotification,
   notificationsListResultError INTEGER { undefinedError(127)}
}

PendingNotification ::= CHOICE {
   profileInstallationResult [55] ProfileInstallationResult, -- tag 'BF37'
   otherSignedNotification OtherSignedNotification
}

OtherSignedNotification ::= SEQUENCE {
   tbsOtherNotification NotificationMetadata,
   euiccNotificationSignature [APPLICATION 55] OCTET STRING, -- eUICC signature of tbsOtherNotification, Tag '5F37'
   euiccCertificate Certificate, -- eUICC Certificate (CERT.EUICC.ECDSA) signed by the EUM
   eumCertificate Certificate     -- EUM Certificate (CERT.EUM.ECDSA) signed by the requested CI
}

-- Definition of notificationSent
NotificationSentRequest ::= [48] SEQUENCE { -- Tag 'BF30'
   seqNumber [0] INTEGER
}

NotificationSentResponse ::= [48] SEQUENCE { -- Tag 'BF30'
   deleteNotificationStatus INTEGER {ok(0), nothingToDelete(1),
undefinedError(127)}
}

-- Definition of Enable Profile --------------------------
EnableProfileRequest ::= [49] SEQUENCE { -- Tag 'BF31'
   profileIdentifier CHOICE {
      isdpAid [APPLICATION 15] OctetTo16, -- AID, tag '4F'
      iccid Iccid -- ICCID, tag '5A'
   },
   refreshFlag BOOLEAN -- indicating whether REFRESH is required
}

EnableProfileResponse ::= [49] SEQUENCE { -- Tag 'BF31'
   enableResult INTEGER {ok(0), iccidOrAidNotFound (1),
profileNotInDisabledState(2), disallowedByPolicy(3), wrongProfileReenabling(4),
catBusy(5), undefinedError(127)}
}

-- Definition of Disable Profile --------------------------
DisableProfileRequest ::= [50] SEQUENCE { -- Tag 'BF32'
   profileIdentifier CHOICE {
      isdpAid [APPLICATION 15] OctetTo16, -- AID, tag '4F'
      iccid Iccid -- ICCID, tag '5A'
   },
   refreshFlag BOOLEAN -- indicating whether REFRESH is required
}

DisableProfileResponse ::= [50] SEQUENCE { -- Tag 'BF32'
   disableResult INTEGER {ok(0), iccidOrAidNotFound (1),
profileNotInEnabledState(2), disallowedByPolicy(3), catBusy(5),
undefinedError(127)}
}

-- Definition of Delete Profile --------------------------
DeleteProfileRequest ::= [51] CHOICE { -- Tag 'BF33'
   isdpAid [APPLICATION 15] OctetTo16, -- AID, tag '4F'
   iccid Iccid -- ICCID, tag '5A'
}

DeleteProfileResponse ::= [51] SEQUENCE { -- Tag 'BF33'
   deleteResult INTEGER {ok(0), iccidOrAidNotFound (1),
profileNotInDisabledState(2), disallowedByPolicy(3), undefinedError(127)}
}

-- Definition of Memory Reset --------------------------
EuiccMemoryResetRequest ::= [52] SEQUENCE { -- Tag 'BF34'
   resetOptions [2] BIT STRING {
      deleteOperationalProfiles(0),
      deleteFieldLoadedTestProfiles(1),
      resetDefaultSmdpAddress(2)}
}

EuiccMemoryResetResponse ::= [52] SEQUENCE { -- Tag 'BF34'
   resetResult INTEGER {ok(0), nothingToDelete(1), catBusy(5), undefinedError(127)}
}

-- Definition of Get EID --------------------------
GetEuiccDataRequest ::= [62] SEQUENCE { -- Tag 'BF3E'
   tagList [APPLICATION 28] Octet1 -- tag '5C', the value SHALL be set to '5A'
}

GetEuiccDataResponse ::= [62] SEQUENCE { -- Tag 'BF3E'
   eidValue [APPLICATION 26] Octet16 -- tag '5A'
}

-- Definition of Get Rat

GetRatRequest ::= [67] SEQUENCE { -- Tag ' BF43'
   -- No input data
}


GetRatResponse ::= [67] SEQUENCE { -- Tag 'BF43'
   rat RulesAuthorisationTable
}

RulesAuthorisationTable ::= SEQUENCE OF ProfilePolicyAuthorisationRule
ProfilePolicyAuthorisationRule ::= SEQUENCE {
   pprIds PprIds,
   allowedOperators SEQUENCE OF OperatorId,
   pprFlags BIT STRING {consentRequired(0)}
}

-- Definition of data structure containing the list of CRL segments
SegmentedCrlList ::= SEQUENCE OF CertificateList

-- Definition of data structure command for loading a CRL
LoadCRLRequest ::= [53] SEQUENCE { -- Tag 'BF35'
   -- A CRL
   crl CertificateList
}

-- Definition of data structure response for loading a CRL
LoadCRLResponse ::= [53] CHOICE { -- Tag 'BF35'
   loadCRLResponseOk LoadCRLResponseOk,
   loadCRLResponseError LoadCRLResponseError
}

LoadCRLResponseOk ::= SEQUENCE {
   missingParts SEQUENCE OF INTEGER OPTIONAL
}
LoadCRLResponseError ::= INTEGER {invalidSignature(1), invalidCRLFormat(2),
notEnoughMemorySpace(3), verificationKeyNotFound(4), fresherCrlAlreadyLoaded(5),
baseCrlMissing(6), undefinedError(127)}

-- Definition of the extension for Certificate Expiration Date
id-rsp-expDate OBJECT IDENTIFIER ::= {id-rspExt 1}
ExpirationDate ::= Time

-- Definition of the extension id for total partial-CRL number
id-rsp-totalPartialCrlNumber OBJECT IDENTIFIER ::= {id-rspExt 2}
TotalPartialCrlNumber ::= INTEGER

-- Definition of the extension id for the partial-CRL number
id-rsp-partialCrlNumber OBJECT IDENTIFIER ::= {id-rspExt 3}
PartialCrlNumber ::= INTEGER

-- Definition for ES9+ ASN.1 Binding --------------------------
RemoteProfileProvisioningRequest ::= [2] CHOICE { -- Tag 'A2'
   initiateAuthenticationRequest [57] InitiateAuthenticationRequest, -- Tag 'BF39'
   authenticateClientRequest [59] AuthenticateClientRequest, -- Tag 'BF3B'
   getBoundProfilePackageRequest [58] GetBoundProfilePackageRequest, -- Tag 'BF3A'
   cancelSessionRequestEs9 [65] CancelSessionRequestEs9, -- Tag 'BF41'
   handleNotification [61] HandleNotification -- tag 'BF3D'
}

RemoteProfileProvisioningResponse ::= [2] CHOICE { -- Tag 'A2'
   initiateAuthenticationResponse [57] InitiateAuthenticationResponse, -- Tag 'BF39'
   authenticateClientResponseEs9 [59] AuthenticateClientResponseEs9, -- Tag 'BF3B'
   getBoundProfilePackageResponse [58] GetBoundProfilePackageResponse, -- Tag 'BF3A'
   cancelSessionResponseEs9 [65] CancelSessionResponseEs9, -- Tag 'BF41'
   authenticateClientResponseEs11 [64] AuthenticateClientResponseEs11 -- Tag 'BF40'
}

InitiateAuthenticationRequest ::= [57] SEQUENCE { -- Tag 'BF39'
   euiccChallenge [1] Octet16, -- random eUICC challenge
   smdpAddress [3] UTF8String,
   euiccInfo1 EUICCInfo1
}

InitiateAuthenticationResponse ::= [57] CHOICE { -- Tag 'BF39'
   initiateAuthenticationOk InitiateAuthenticationOkEs9,
   initiateAuthenticationError INTEGER {
      invalidDpAddress(1),
      euiccVersionNotSupportedByDp(2),
      ciPKNotSupported(3)
    }
}

InitiateAuthenticationOkEs9 ::= SEQUENCE {
   transactionId [0] TransactionId, -- The TransactionID generated by the SM-DP+
   serverSigned1 ServerSigned1, -- Signed information
   serverSignature1 [APPLICATION 55] OCTET STRING, -- Server_Sign1, tag '5F37'
   euiccCiPKIdToBeUsed SubjectKeyIdentifier, -- The curve CI Public Key to be used as required by ES10b.AuthenticateServer
   serverCertificate Certificate
}

AuthenticateClientRequest ::= [59] SEQUENCE { -- Tag 'BF3B'
   transactionId [0] TransactionId,
   authenticateServerResponse [56] AuthenticateServerResponse -- This is the response from ES10b.AuthenticateServer
}

AuthenticateClientResponseEs9 ::= [59] CHOICE { -- Tag 'BF3B'
   authenticateClientOk AuthenticateClientOk,
   authenticateClientError INTEGER {
      eumCertificateInvalid(1),
      eumCertificateExpired(2),
      euiccCertificateInvalid(3),
      euiccCertificateExpired(4),
      euiccSignatureInvalid(5),
      matchingIdRefused(6),
      eidMismatch(7),
      noEligibleProfile(8),
      ciPKUnknown(9),
      invalidTransactionId(10),
      insufficientMemory(11),
      undefinedError(127)
   }
}

AuthenticateClientOk ::= SEQUENCE {
   transactionId [0] TransactionId,
   profileMetaData [37] StoreMetadataRequest,
   smdpSigned2 SmdpSigned2, -- Signed information
   smdpSignature2 [APPLICATION 55] OCTET STRING,              -- tag '5F37'
   smdpCertificate Certificate    -- CERT.DPpb.ECDSA
}

GetBoundProfilePackageRequest ::= [58] SEQUENCE { -- Tag 'BF3A'
   transactionId [0] TransactionId,
   prepareDownloadResponse [33] PrepareDownloadResponse
}

GetBoundProfilePackageResponse ::= [58] CHOICE { -- Tag 'BF3A'
   getBoundProfilePackageOk GetBoundProfilePackageOk,
   getBoundProfilePackageError INTEGER {
      euiccSignatureInvalid(1),
      confirmationCodeMissing(2),
      confirmationCodeRefused(3),
      confirmationCodeRetriesExceeded(4),
      bppRebindingRefused(5),
      downloadOrderExpired(6),
      invalidTransactionId(95),
      undefinedError(127)
   }
}

GetBoundProfilePackageOk ::= SEQUENCE {
   transactionId [0] TransactionId,
   boundProfilePackage [54] BoundProfilePackage
}

HandleNotification ::= [61] SEQUENCE { -- Tag 'BF3D'
   pendingNotification PendingNotification
}

CancelSessionRequestEs9 ::= [65] SEQUENCE { -- Tag 'BF41'
   transactionId TransactionId,
   cancelSessionResponse CancelSessionResponse -- data structure defined for ES10b.CancelSession function
}

CancelSessionResponseEs9 ::= [65] CHOICE { -- Tag 'BF41'
   cancelSessionOk CancelSessionOk,
   cancelSessionError INTEGER {
      invalidTransactionId(1),
      euiccSignatureInvalid(2),
      undefinedError(127)
   }
}

CancelSessionOk ::= SEQUENCE { -- This function has no output data
}

EuiccConfiguredAddressesRequest ::= [60] SEQUENCE { -- Tag 'BF3C'
}

EuiccConfiguredAddressesResponse ::= [60] SEQUENCE { -- Tag 'BF3C'
   defaultDpAddress UTF8String OPTIONAL, -- Default SM-DP+ address as an FQDN
   rootDsAddress UTF8String -- Root SM-DS address as an FQDN
}

ISDRProprietaryApplicationTemplate ::= [PRIVATE 0] SEQUENCE { -- Tag 'E0'
   svn [2] VersionType,     -- GSMA SGP.22 version supported (SVN)
   lpaeSupport BIT STRING {
      lpaeUsingCat(0), -- LPA in the eUICC using Card Application Toolkit
      lpaeUsingScws(1) -- LPA in the eUICC using Smartcard Web Server
   } OPTIONAL
}

LpaeActivationRequest ::= [66] SEQUENCE { -- Tag 'BF42'
   lpaeOption BIT STRING {
      activateCatBasedLpae(0), -- LPAe with LUIe based on CAT
      activateScwsBasedLpae(1) -- LPAe with LUIe based on SCWS
   }
}

LpaeActivationResponse ::= [66] SEQUENCE { -- Tag 'BF42'
   lpaeActivationResult INTEGER {ok(0), notSupported(1)}
}

SetDefaultDpAddressRequest ::= [63] SEQUENCE { -- Tag 'BF3F'
   defaultDpAddress UTF8String -- Default SM-DP+ address as an FQDN
}

SetDefaultDpAddressResponse ::= [63] SEQUENCE { -- Tag 'BF3F'
   setDefaultDpAddressResult INTEGER { ok (0), undefinedError (127)}
}

AuthenticateClientResponseEs11 ::= [64] CHOICE { -- Tag 'BF40'
   authenticateClientOk AuthenticateClientOkEs11,
   authenticateClientError INTEGER {
      eumCertificateInvalid(1),
      eumCertificateExpired(2),
      euiccCertificateInvalid(3),
      euiccCertificateExpired(4),
      euiccSignatureInvalid(5),
      eventIdUnknown(6),
      invalidTransactionId(7),
      undefinedError(127)
    }
}

AuthenticateClientOkEs11 ::= SEQUENCE {
   transactionId TransactionId,
   eventEntries SEQUENCE OF EventEntries
}

EventEntries ::= SEQUENCE {
   eventId UTF8String,
   rspServerAddress UTF8String
}

END