1 /* 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 17 package com.android.internal.telephony.uicc.euicc; 18 19 /** 20 * ASN1 tags used by {@link EuiccCard} implementation. 21 */ 22 class 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 // Context tags for constructed (compound) types 59 static final int TAG_CTX_COMP_0 = 0xA0; 60 static final int TAG_CTX_COMP_1 = 0xA1; 61 static final int TAG_CTX_COMP_2 = 0xA2; 62 static final int TAG_CTX_COMP_3 = 0xA3; 63 64 // Command data tags 65 static final int TAG_PROFILE_INSTALLATION_RESULT = 0xBF37; 66 static final int TAG_PROFILE_INSTALLATION_RESULT_DATA = 0xBF27; 67 static final int TAG_NOTIFICATION_METADATA = 0xBF2F; 68 static final int TAG_SEQ = TAG_CTX_0; 69 static final int TAG_TARGET_ADDR = 0x0C; 70 static final int TAG_EVENT = TAG_CTX_1; 71 static final int TAG_CANCEL_SESSION = 0xBF41; 72 static final int TAG_PROFILE_INFO = 0xE3; 73 static final int TAG_TAG_LIST = 0x5C; 74 static final int TAG_EID = 0x5A; 75 static final int TAG_NICKNAME = 0x90; 76 static final int TAG_ICCID = 0x5A; 77 static final int TAG_PROFILE_STATE = 0x9F70; 78 static final int TAG_SERVICE_PROVIDER_NAME = 0x91; 79 static final int TAG_PROFILE_CLASS = 0x95; 80 static final int TAG_PROFILE_POLICY_RULE = 0x99; 81 static final int TAG_PROFILE_NAME = 0x92; 82 static final int TAG_OPERATOR_ID = 0xB7; 83 static final int TAG_CARRIER_PRIVILEGE_RULES = 0xBF76; 84 85 // Tags from the RefArDo data standard - https://source.android.com/devices/tech/config/uicc 86 static final int TAG_REF_AR_DO = 0xE2; 87 static final int TAG_REF_DO = 0xE1; 88 static final int TAG_DEVICE_APP_ID_REF_DO = 0xC1; 89 static final int TAG_PKG_REF_DO = 0xCA; 90 static final int TAG_AR_DO = 0xE3; 91 static final int TAG_PERM_AR_DO = 0xDB; 92 93 // TAG list for Euicc Profile 94 static final byte[] EUICC_PROFILE_TAGS = new byte[] { 95 TAG_ICCID, 96 (byte) TAG_NICKNAME, 97 (byte) TAG_SERVICE_PROVIDER_NAME, 98 (byte) TAG_PROFILE_NAME, 99 (byte) TAG_OPERATOR_ID, 100 (byte) (TAG_PROFILE_STATE / 256), 101 (byte) (TAG_PROFILE_STATE % 256), 102 (byte) TAG_PROFILE_CLASS, 103 (byte) TAG_PROFILE_POLICY_RULE, 104 (byte) (TAG_CARRIER_PRIVILEGE_RULES / 256), 105 (byte) (TAG_CARRIER_PRIVILEGE_RULES % 256), 106 }; 107 Tags()108 private Tags() {} 109 } 110