blob: 26df42b19642723528396420adae2a2b4bd69faf [file] [log] [blame]
Alan Viverette3da604b2020-06-10 18:34:39 +00001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.internal.telephony.uicc.euicc;
18
19/**
20 * ASN1 tags used by {@link EuiccCard} implementation.
21 */
22class Tags {
23 // ASN.1 tags for commands
24 static final int TAG_GET_PROFILES = 0xBF2D;
25 static final int TAG_DISABLE_PROFILE = 0xBF32;
26 static final int TAG_ENABLE_PROFILE = 0xBF31;
27 static final int TAG_GET_EID = 0xBF3E;
28 static final int TAG_SET_NICKNAME = 0xBF29;
29 static final int TAG_DELETE_PROFILE = 0xBF33;
30 static final int TAG_GET_CONFIGURED_ADDRESSES = 0xBF3C;
31 static final int TAG_SET_DEFAULT_SMDP_ADDRESS = 0xBF3F;
32 static final int TAG_GET_RAT = 0xBF43;
33 static final int TAG_EUICC_MEMORY_RESET = 0xBF34;
34 static final int TAG_GET_EUICC_CHALLENGE = 0xBF2E;
35 static final int TAG_GET_EUICC_INFO_1 = 0xBF20;
36 static final int TAG_GET_EUICC_INFO_2 = 0xBF22;
37 static final int TAG_LIST_NOTIFICATION = 0xBF28;
38 static final int TAG_RETRIEVE_NOTIFICATIONS_LIST = 0xBF2B;
39 static final int TAG_REMOVE_NOTIFICATION_FROM_LIST = 0xBF30;
40 static final int TAG_AUTHENTICATE_SERVER = 0xBF38;
41 static final int TAG_PREPARE_DOWNLOAD = 0xBF21;
42 static final int TAG_INITIALISE_SECURE_CHANNEL = 0xBF23;
43
44 // Universal tags
45 static final int TAG_UNI_2 = 0x02;
46 static final int TAG_UNI_4 = 0x04;
47 static final int TAG_SEQUENCE = 0x30;
48 // Context tags for primitive types
49 static final int TAG_CTX_0 = 0x80;
50 static final int TAG_CTX_1 = 0x81;
51 static final int TAG_CTX_2 = 0x82;
52 static final int TAG_CTX_3 = 0x83;
53 static final int TAG_CTX_4 = 0x84;
54 static final int TAG_CTX_5 = 0x85;
55 static final int TAG_CTX_6 = 0x86;
56 static final int TAG_CTX_7 = 0x87;
57 static final int TAG_CTX_8 = 0x88;
58 static final int TAG_CTX_9 = 0x89;
59 static final int TAG_CTX_10 = 0x8A;
60 static final int TAG_CTX_11 = 0x8B;
61
62 // Context tags for constructed (compound) types
63 static final int TAG_CTX_COMP_0 = 0xA0;
64 static final int TAG_CTX_COMP_1 = 0xA1;
65 static final int TAG_CTX_COMP_2 = 0xA2;
66 static final int TAG_CTX_COMP_3 = 0xA3;
67
68 // Command data tags
69 static final int TAG_PROFILE_INSTALLATION_RESULT = 0xBF37;
70 static final int TAG_PROFILE_INSTALLATION_RESULT_DATA = 0xBF27;
71 static final int TAG_NOTIFICATION_METADATA = 0xBF2F;
72 static final int TAG_SEQ = TAG_CTX_0;
73 static final int TAG_TARGET_ADDR = 0x0C;
74 static final int TAG_EVENT = TAG_CTX_1;
75 static final int TAG_CANCEL_SESSION = 0xBF41;
76 static final int TAG_PROFILE_INFO = 0xE3;
77 static final int TAG_TAG_LIST = 0x5C;
78 static final int TAG_EID = 0x5A;
79 static final int TAG_NICKNAME = 0x90;
80 static final int TAG_ICCID = 0x5A;
81 static final int TAG_PROFILE_STATE = 0x9F70;
82 static final int TAG_SERVICE_PROVIDER_NAME = 0x91;
83 static final int TAG_PROFILE_CLASS = 0x95;
84 static final int TAG_PROFILE_POLICY_RULE = 0x99;
85 static final int TAG_PROFILE_NAME = 0x92;
86 static final int TAG_OPERATOR_ID = 0xB7;
87 static final int TAG_CARRIER_PRIVILEGE_RULES = 0xBF76;
88
89 // Tags from the RefArDo data standard - https://source.android.com/devices/tech/config/uicc
90 static final int TAG_REF_AR_DO = 0xE2;
91 static final int TAG_REF_DO = 0xE1;
92 static final int TAG_DEVICE_APP_ID_REF_DO = 0xC1;
93 static final int TAG_PKG_REF_DO = 0xCA;
94 static final int TAG_AR_DO = 0xE3;
95 static final int TAG_PERM_AR_DO = 0xDB;
96
97 // TAG list for Euicc Profile
98 static final byte[] EUICC_PROFILE_TAGS = new byte[] {
99 TAG_ICCID,
100 (byte) TAG_NICKNAME,
101 (byte) TAG_SERVICE_PROVIDER_NAME,
102 (byte) TAG_PROFILE_NAME,
103 (byte) TAG_OPERATOR_ID,
104 (byte) (TAG_PROFILE_STATE / 256),
105 (byte) (TAG_PROFILE_STATE % 256),
106 (byte) TAG_PROFILE_CLASS,
107 (byte) TAG_PROFILE_POLICY_RULE,
108 (byte) (TAG_CARRIER_PRIVILEGE_RULES / 256),
109 (byte) (TAG_CARRIER_PRIVILEGE_RULES % 256),
110 };
111
112 private Tags() {}
113}