From c84f475c404bbf2c67f2bc49294aafe8484dc607 Mon Sep 17 00:00:00 2001 From: hanss Date: Sun, 13 Jun 2021 13:00:31 +0200 Subject: [PATCH] Rel 16 --- .../uicc_example/Test_uicc_example.java | 101 + .../userclass/UiccAPITestCardService.java | 29 + .../uicc/jcapi/userclass/UiccTestModel.java | 12 + .../jcapi/userinterface/APDUResponse.java | 37 + .../UiccAdministrativeCommandsService.java | 42 + .../UiccApplicationManagementService.java | 88 + .../UiccCardManagementService.java | 235 +++ .../userinterface/UiccToolkitService.java | 212 ++ .../uicc/test/util/LoadUtil.java | 36 + .../uicc/test/util/TestToolkitApplet.java | 117 ++ .../uicc/test/util/TestToolkitApplet.opt | 3 + .../uicc/test/util/UICCTestConstants.java | 118 ++ .../uicc/test/util/javacard/util.cap | Bin 0 -> 2836 bytes .../uicc/test/util/javacard/util.exp | Bin 0 -> 3333 bytes .../uicc/test/util/javacard/util.jca | 466 +++++ .../test/access/api_1_cont/Api_1_Cont_1.java | 1662 +++++++++++++++ .../access/api_1_cont/Test_Api_1_Cont.java | 560 +++++ .../uicc/test/access/api_1_cont/applet.opt | 4 + .../access/api_1_cont/javacard/api_1_cont.cap | Bin 0 -> 14298 bytes .../api_1_fvw_actf/Api_1_Fvw_Actf_1.java | 173 ++ .../api_1_fvw_actf/Test_Api_1_Fvw_Actf.java | 93 + .../test/access/api_1_fvw_actf/applet.opt | 4 + .../javacard/api_1_fvw_actf.cap | Bin 0 -> 4729 bytes .../api_1_fvw_dacf/Api_1_Fvw_Dacf_1.java | 153 ++ .../api_1_fvw_dacf/Test_Api_1_Fvw_Dacf.java | 93 + .../test/access/api_1_fvw_dacf/applet.opt | 4 + .../javacard/api_1_fvw_dacf.cap | Bin 0 -> 4581 bytes .../api_1_fvw_incr/Api_1_Fvw_Incr_1.java | 574 +++++ .../api_1_fvw_incr/Test_Api_1_Fvw_Incr.java | 101 + .../test/access/api_1_fvw_incr/applet.opt | 4 + .../javacard/api_1_fvw_incr.cap | Bin 0 -> 9139 bytes .../api_1_fvw_redb/Api_1_Fvw_Redb_1.java | 361 ++++ .../api_1_fvw_redb/Test_Api_1_Fvw_Redb.java | 94 + .../test/access/api_1_fvw_redb/applet.opt | 4 + .../javacard/api_1_fvw_redb.cap | Bin 0 -> 4206 bytes .../api_1_fvw_redr/Api_1_Fvw_Redr_1.java | 851 ++++++++ .../api_1_fvw_redr/Test_Api_1_Fvw_Redr.java | 95 + .../test/access/api_1_fvw_redr/applet.opt | 4 + .../javacard/api_1_fvw_redr.cap | Bin 0 -> 6327 bytes .../api_1_fvw_sear/Api_1_Fvw_Sear_1.java | 1841 ++++++++++++++++ .../api_1_fvw_sear/Test_Api_1_Fvw_Sear.java | 97 + .../test/access/api_1_fvw_sear/applet.opt | 4 + .../javacard/api_1_fvw_sear.cap | Bin 0 -> 22451 bytes .../api_1_fvw_slctb/Api_1_Fvw_Slctb_1.java | 183 ++ .../api_1_fvw_slctb/Test_Api_1_Fvw_Slctb.java | 87 + .../test/access/api_1_fvw_slctb/applet.opt | 4 + .../javacard/api_1_fvw_slctb.cap | Bin 0 -> 3614 bytes .../Api_1_Fvw_Slctb_Bss_1.java | 811 ++++++++ .../Test_Api_1_Fvw_Slctb_Bss.java | 115 + .../access/api_1_fvw_slctb_bss/applet.opt | 4 + .../javacard/api_1_fvw_slctb_bss.cap | Bin 0 -> 7697 bytes .../api_1_fvw_slcts/Api_1_Fvw_Slcts_1.java | 310 +++ .../api_1_fvw_slcts/Test_Api_1_Fvw_Slcts.java | 101 + .../test/access/api_1_fvw_slcts/applet.opt | 4 + .../javacard/api_1_fvw_slcts.cap | Bin 0 -> 4371 bytes .../api_1_fvw_stat/Api_1_Fvw_Stat_1.java | 466 +++++ .../api_1_fvw_stat/Test_Api_1_Fvw_Stat.java | 94 + .../test/access/api_1_fvw_stat/applet.opt | 4 + .../javacard/api_1_fvw_stat.cap | Bin 0 -> 5320 bytes .../api_1_fvw_updb/Api_1_Fvw_Updb_1.java | 387 ++++ .../api_1_fvw_updb/Test_Api_1_Fvw_Updb.java | 93 + .../test/access/api_1_fvw_updb/applet.opt | 4 + .../javacard/api_1_fvw_updb.cap | Bin 0 -> 4357 bytes .../api_1_fvw_updr/Api_1_Fvw_Updr_1.java | 852 ++++++++ .../api_1_fvw_updr/Test_Api_1_Fvw_Updr.java | 96 + .../test/access/api_1_fvw_updr/applet.opt | 4 + .../javacard/api_1_fvw_updr.cap | Bin 0 -> 6448 bytes .../api_1_uex_coor/Api_1_Uex_Coor_1.java | 60 + .../api_1_uex_coor/Test_Api_1_Uex_Coor.java | 86 + .../test/access/api_1_uex_coor/applet.opt | 4 + .../javacard/api_1_uex_coor.cap | Bin 0 -> 3819 bytes .../api_1_uex_thit/Api_1_Uex_Thit_1.java | 150 ++ .../api_1_uex_thit/Test_Api_1_Uex_Thit.java | 86 + .../test/access/api_1_uex_thit/applet.opt | 4 + .../javacard/api_1_uex_thit.cap | Bin 0 -> 4605 bytes .../Api_1_Usy_Getf_Bsbb_1.java | 576 ++++++ .../Test_Api_1_Usy_Getf_Bsbb.java | 201 ++ .../access/api_1_usy_getf_bsbb/applet.opt | 4 + .../javacard/api_1_usy_getf_bsbb.cap | Bin 0 -> 6065 bytes .../api_1_usy_getfb/Api_1_Usy_Getfb_1.java | 443 ++++ .../api_1_usy_getfb/Test_Api_1_Usy_Getfb.java | 177 ++ .../test/access/api_1_usy_getfb/applet.opt | 4 + .../javacard/api_1_usy_getfb.cap | Bin 0 -> 5267 bytes .../api_1_usy_getfob/Api_1_Usy_Getfob_1.java | 517 +++++ .../Test_Api_1_Usy_Getfob.java | 185 ++ .../test/access/api_1_usy_getfob/applet.opt | 4 + .../javacard/api_1_usy_getfob.cap | Bin 0 -> 5781 bytes .../api_4_aex_coor/Api_4_Aex_Coor_1.java | 60 + .../api_4_aex_coor/Test_Api_4_Aex_Coor.java | 86 + .../api_4_aex_coor/applet.opt | 4 + .../javacard/api_4_aex_coor.cap | Bin 0 -> 4352 bytes .../api_4_aex_thit/Api_4_Aex_Thit_1.java | 151 ++ .../api_4_aex_thit/Test_Api_4_Aex_Thit.java | 86 + .../api_4_aex_thit/applet.opt | 4 + .../javacard/api_4_aex_thit.cap | Bin 0 -> 5139 bytes .../Api_4_Afb_Gtaf_Bsbb_1.java | 599 ++++++ .../Test_Api_4_Afb_Gtaf_Bsbb.java | 201 ++ .../api_4_afb_gtaf_bsbb/applet.opt | 4 + .../javacard/api_4_afb_gtaf_bsbb.cap | Bin 0 -> 10167 bytes .../api_4_afb_gtafb/Api_4_Afb_Gtafb_1.java | 468 +++++ .../api_4_afb_gtafb/Test_Api_4_Afb_Gtafb.java | 176 ++ .../api_4_afb_gtafb/applet.opt | 4 + .../javacard/api_4_afb_gtafb.cap | Bin 0 -> 8783 bytes .../api_4_afb_gtafob/Api_4_Afb_Gtafob_1.java | 540 +++++ .../Test_Api_4_Afb_Gtafob.java | 185 ++ .../api_4_afb_gtafob/applet.opt | 4 + .../javacard/api_4_afb_gtafob.cap | Bin 0 -> 9720 bytes .../api_4_afv_actf/Api_4_Afv_Actf_1.java | 175 ++ .../api_4_afv_actf/Test_Api_4_Afv_Actf.java | 91 + .../api_4_afv_actf/applet.opt | 4 + .../javacard/api_4_afv_actf.cap | Bin 0 -> 5298 bytes .../api_4_afv_crtf/Api_4_Afv_Crtf_1.java | 359 ++++ .../api_4_afv_crtf/Test_Api_4_Afv_Crtf.java | 179 ++ .../api_4_afv_crtf/applet.opt | 4 + .../javacard/api_4_afv_crtf.cap | Bin 0 -> 5823 bytes .../api_4_afv_dacf/Api_4_Afv_Dacf_1.java | 155 ++ .../api_4_afv_dacf/Test_Api_4_Afv_Dacf.java | 92 + .../api_4_afv_dacf/applet.opt | 4 + .../javacard/api_4_afv_dacf.cap | Bin 0 -> 5151 bytes .../api_4_afv_dltf/Api_4_Afv_Dltf_1.java | 438 ++++ .../api_4_afv_dltf/Test_Api_4_Afv_Dltf.java | 105 + .../api_4_afv_dltf/applet.opt | 4 + .../javacard/api_4_afv_dltf.cap | Bin 0 -> 6611 bytes .../api_4_afv_incr/Api_4_Afv_Incr_1.java | 579 ++++++ .../api_4_afv_incr/Test_Api_4_Afv_Incr.java | 93 + .../api_4_afv_incr/applet.opt | 4 + .../javacard/api_4_afv_incr.cap | Bin 0 -> 9653 bytes .../api_4_afv_redb/Api_4_Afv_Redb_1.java | 363 ++++ .../api_4_afv_redb/Test_Api_4_Afv_Redb.java | 93 + .../api_4_afv_redb/applet.opt | 4 + .../javacard/api_4_afv_redb.cap | Bin 0 -> 7161 bytes .../api_4_afv_redr/Api_4_Afv_Redr_1.java | 853 ++++++++ .../api_4_afv_redr/Test_Api_4_Afv_Redr.java | 94 + .../api_4_afv_redr/applet.opt | 4 + .../javacard/api_4_afv_redr.cap | Bin 0 -> 10896 bytes .../api_4_afv_rszf/Api_4_Afv_Rszf_1.java | 316 +++ .../api_4_afv_rszf/Test_Api_4_Afv_Rszf.java | 154 ++ .../api_4_afv_rszf/applet.opt | 4 + .../javacard/api_4_afv_rszf.cap | Bin 0 -> 7443 bytes .../api_4_afv_sear/Api_4_Afv_Sear_1.java | 1842 +++++++++++++++++ .../api_4_afv_sear/Test_Api_4_Afv_Sear.java | 95 + .../api_4_afv_sear/applet.opt | 4 + .../javacard/api_4_afv_sear.cap | Bin 0 -> 23022 bytes .../api_4_afv_slctb/Api_4_Afv_Slctb_1.java | 182 ++ .../api_4_afv_slctb/Test_Api_4_Afv_Slctb.java | 88 + .../api_4_afv_slctb/applet.opt | 4 + .../javacard/api_4_afv_slctb.cap | Bin 0 -> 5737 bytes .../Api_4_Afv_Slctb_Bss_1.java | 812 ++++++++ .../Test_Api_4_Afv_Slctb_Bss.java | 112 + .../api_4_afv_slctb_bss/applet.opt | 4 + .../javacard/api_4_afv_slctb_bss.cap | Bin 0 -> 13111 bytes .../api_4_afv_slcts/Api_4_Afv_Slcts_1.java | 312 +++ .../api_4_afv_slcts/Test_Api_4_Afv_Slcts.java | 98 + .../api_4_afv_slcts/applet.opt | 4 + .../javacard/api_4_afv_slcts.cap | Bin 0 -> 7248 bytes .../api_4_afv_stat/Api_4_Afv_Stat_1.java | 468 +++++ .../api_4_afv_stat/Test_Api_4_Afv_Stat.java | 95 + .../api_4_afv_stat/applet.opt | 4 + .../javacard/api_4_afv_stat.cap | Bin 0 -> 9124 bytes .../api_4_afv_updb/Api_4_Afv_Updb_1.java | 389 ++++ .../api_4_afv_updb/Test_Api_4_Afv_Updb.java | 94 + .../api_4_afv_updb/applet.opt | 4 + .../javacard/api_4_afv_updb.cap | Bin 0 -> 7457 bytes .../api_4_afv_updr/Api_4_Afv_Updr_1.java | 854 ++++++++ .../api_4_afv_updr/Test_Api_4_Afv_Updr.java | 95 + .../api_4_afv_updr/applet.opt | 4 + .../javacard/api_4_afv_updr.cap | Bin 0 -> 11244 bytes .../catre/cre_api_hepo/Cre_Api_Hepo_1.java | 172 ++ .../catre/cre_api_hepo/Test_Cre_Api_Hepo.java | 80 + .../uicc/test/catre/cre_api_hepo/applet.opt | 4 + .../cre_api_hepo/javacard/cre_api_hepo.cap | Bin 0 -> 4681 bytes .../catre/cre_api_tmid/Cre_Api_Tmid_1.java | 92 + .../catre/cre_api_tmid/Test_Cre_Api_Tmid.java | 90 + .../uicc/test/catre/cre_api_tmid/applet.opt | 4 + .../cre_api_tmid/javacard/cre_api_tmid.cap | Bin 0 -> 3933 bytes .../catre/cre_api_tran/Cre_Api_Tran_1.java | 100 + .../catre/cre_api_tran/Cre_Api_Tran_2.java | 75 + .../catre/cre_api_tran/Test_Cre_Api_Tran.java | 111 + .../uicc/test/catre/cre_api_tran/applet.opt | 5 + .../cre_api_tran/javacard/cre_api_tran.cap | Bin 0 -> 4730 bytes .../catre/cre_apt_eade/Cre_Apt_Eade_1.java | 200 ++ .../catre/cre_apt_eade/Test_Cre_Apt_Eade.java | 89 + .../uicc/test/catre/cre_apt_eade/applet.opt | 4 + .../cre_apt_eade/javacard/cre_apt_eade.cap | Bin 0 -> 3531 bytes .../catre/cre_apt_eccn/Cre_Apt_Eccn_1.java | 92 + .../catre/cre_apt_eccn/Cre_Apt_Eccn_2.java | 100 + .../catre/cre_apt_eccn/Test_Cre_Apt_Eccn.java | 98 + .../uicc/test/catre/cre_apt_eccn/applet.opt | 5 + .../cre_apt_eccn/javacard/cre_apt_eccn.cap | Bin 0 -> 3359 bytes .../catre/cre_apt_edat/Cre_Apt_Edat_1.java | 125 ++ .../catre/cre_apt_edat/Test_Cre_Apt_Edat.java | 84 + .../uicc/test/catre/cre_apt_edat/applet.opt | 4 + .../cre_apt_edat/javacard/cre_apt_edat.cap | Bin 0 -> 2983 bytes .../catre/cre_apt_edbs/Cre_Apt_Edbs_1.java | 121 ++ .../catre/cre_apt_edbs/Test_Cre_Apt_Edbs.java | 75 + .../uicc/test/catre/cre_apt_edbs/applet.opt | 4 + .../cre_apt_edbs/javacard/cre_apt_edbs.cap | Bin 0 -> 3092 bytes .../catre/cre_apt_edbt/Cre_Apt_Edbt_1.java | 122 ++ .../catre/cre_apt_edbt/Test_Cre_Apt_Edbt.java | 78 + .../uicc/test/catre/cre_apt_edbt/applet.opt | 4 + .../cre_apt_edbt/javacard/cre_apt_edbt.cap | Bin 0 -> 2983 bytes .../catre/cre_apt_edcc/Cre_Apt_Edcc_1.java | 121 ++ .../catre/cre_apt_edcc/Test_Cre_Apt_Edcc.java | 78 + .../uicc/test/catre/cre_apt_edcc/applet.opt | 4 + .../cre_apt_edcc/javacard/cre_apt_edcc.cap | Bin 0 -> 2983 bytes .../catre/cre_apt_edcd/Cre_Apt_Edcd_1.java | 120 ++ .../catre/cre_apt_edcd/Test_Cre_Apt_Edcd.java | 76 + .../uicc/test/catre/cre_apt_edcd/applet.opt | 4 + .../cre_apt_edcd/javacard/cre_apt_edcd.cap | Bin 0 -> 2984 bytes .../catre/cre_apt_edcr/Cre_Apt_Edcr_1.java | 121 ++ .../catre/cre_apt_edcr/Test_Cre_Apt_Edcr.java | 75 + .../uicc/test/catre/cre_apt_edcr/applet.opt | 4 + .../cre_apt_edcr/javacard/cre_apt_edcr.cap | Bin 0 -> 2983 bytes .../catre/cre_apt_edcs/Cre_Apt_Edcs_1.java | 258 +++ .../catre/cre_apt_edcs/Test_Cre_Apt_Edcs.java | 154 ++ .../uicc/test/catre/cre_apt_edcs/applet.opt | 4 + .../cre_apt_edcs/javacard/cre_apt_edcs.cap | Bin 0 -> 3766 bytes .../catre/cre_apt_edda/Cre_Apt_Edda_1.java | 261 +++ .../catre/cre_apt_edda/Test_Cre_Apt_Edda.java | 154 ++ .../uicc/test/catre/cre_apt_edda/applet.opt | 4 + .../cre_apt_edda/javacard/cre_apt_edda.cap | Bin 0 -> 3814 bytes .../catre/cre_apt_eddp/Cre_Apt_Eddp_1.java | 124 ++ .../catre/cre_apt_eddp/Test_Cre_Apt_Eddp.java | 78 + .../uicc/test/catre/cre_apt_eddp/applet.opt | 4 + .../cre_apt_eddp/javacard/cre_apt_eddp.cap | Bin 0 -> 2983 bytes .../catre/cre_apt_edis/Cre_Apt_Edis_1.java | 125 ++ .../catre/cre_apt_edis/Test_Cre_Apt_Edis.java | 79 + .../uicc/test/catre/cre_apt_edis/applet.opt | 4 + .../cre_apt_edis/javacard/cre_apt_edis.cap | Bin 0 -> 2983 bytes .../catre/cre_apt_edlc/Cre_Apt_Edlc_1.java | 245 +++ .../catre/cre_apt_edlc/Test_Cre_Apt_Edlc.java | 126 ++ .../uicc/test/catre/cre_apt_edlc/applet.opt | 4 + .../cre_apt_edlc/javacard/cre_apt_edlc.cap | Bin 0 -> 3814 bytes .../catre/cre_apt_edlg/Cre_Apt_Edlg_1.java | 124 ++ .../catre/cre_apt_edlg/Test_Cre_Apt_Edlg.java | 81 + .../uicc/test/catre/cre_apt_edlg/applet.opt | 4 + .../cre_apt_edlg/javacard/cre_apt_edlg.cap | Bin 0 -> 2983 bytes .../catre/cre_apt_edls/Cre_Apt_Edls_1.java | 125 ++ .../catre/cre_apt_edls/Test_Cre_Apt_Edls.java | 78 + .../uicc/test/catre/cre_apt_edls/applet.opt | 4 + .../cre_apt_edls/javacard/cre_apt_edls.cap | Bin 0 -> 2988 bytes .../catre/cre_apt_edmc/Cre_Apt_Edmc_1.java | 126 ++ .../catre/cre_apt_edmc/Test_Cre_Apt_Edmc.java | 78 + .../uicc/test/catre/cre_apt_edmc/applet.opt | 4 + .../cre_apt_edmc/javacard/cre_apt_edmc.cap | Bin 0 -> 2989 bytes .../catre/cre_apt_edns/Cre_Apt_Edns_1.java | 122 ++ .../catre/cre_apt_edns/Test_Cre_Apt_Edns.java | 76 + .../uicc/test/catre/cre_apt_edns/applet.opt | 4 + .../cre_apt_edns/javacard/cre_apt_edns.cap | Bin 0 -> 3092 bytes .../catre/cre_apt_edua/Cre_Apt_Edua_1.java | 125 ++ .../catre/cre_apt_edua/Test_Cre_Apt_Edua.java | 76 + .../uicc/test/catre/cre_apt_edua/applet.opt | 4 + .../cre_apt_edua/javacard/cre_apt_edua.cap | Bin 0 -> 2983 bytes .../catre/cre_apt_eefu/Cre_Apt_Eefu_1.java | 336 +++ .../catre/cre_apt_eefu/Test_Cre_Apt_Eefu.java | 198 ++ .../uicc/test/catre/cre_apt_eefu/applet.opt | 4 + .../cre_apt_eefu/javacard/cre_apt_eefu.cap | Bin 0 -> 4724 bytes .../catre/cre_apt_efca/Cre_Apt_Efca_1.java | 102 + .../catre/cre_apt_efca/Cre_Apt_Efca_2.java | 100 + .../catre/cre_apt_efca/Cre_Apt_Efca_3.java | 139 ++ .../catre/cre_apt_efca/Cre_Apt_Efca_4.java | 89 + .../catre/cre_apt_efca/Cre_Apt_Efca_5.java | 95 + .../catre/cre_apt_efca/Test_Cre_Apt_Efca.java | 169 ++ .../uicc/test/catre/cre_apt_efca/applet.opt | 8 + .../cre_apt_efca/javacard/cre_apt_efca.cap | Bin 0 -> 4737 bytes .../catre/cre_apt_emse/Cre_Apt_Emse_1.java | 89 + .../catre/cre_apt_emse/Cre_Apt_Emse_2.java | 81 + .../catre/cre_apt_emse/Test_Cre_Apt_Emse.java | 94 + .../uicc/test/catre/cre_apt_emse/applet.opt | 5 + .../cre_apt_emse/javacard/cre_apt_emse.cap | Bin 0 -> 3219 bytes .../catre/cre_apt_emsh/Cre_Apt_Emsh_1.java | 95 + .../catre/cre_apt_emsh/Cre_Apt_Emsh_2.java | 93 + .../catre/cre_apt_emsh/Cre_Apt_Emsh_3.java | 109 + .../catre/cre_apt_emsh/Test_Cre_Apt_Emsh.java | 151 ++ .../uicc/test/catre/cre_apt_emsh/applet.opt | 6 + .../cre_apt_emsh/javacard/cre_apt_emsh.cap | Bin 0 -> 3881 bytes .../catre/cre_apt_epdw/Cre_Apt_Epdw_1.java | 103 + .../catre/cre_apt_epdw/Cre_Apt_Epdw_2.java | 102 + .../catre/cre_apt_epdw/Cre_Apt_Epdw_3.java | 115 + .../catre/cre_apt_epdw/Test_Cre_Apt_Epdw.java | 111 + .../uicc/test/catre/cre_apt_epdw/applet.opt | 6 + .../cre_apt_epdw/javacard/cre_apt_epdw.cap | Bin 0 -> 3689 bytes .../catre/cre_apt_epha/Cre_Apt_Epha_1.java | 170 ++ .../catre/cre_apt_epha/Cre_Apt_Epha_2.java | 128 ++ .../catre/cre_apt_epha/Test_Cre_Apt_Epha.java | 104 + .../uicc/test/catre/cre_apt_epha/applet.opt | 5 + .../cre_apt_epha/javacard/cre_apt_epha.cap | Bin 0 -> 3937 bytes .../catre/cre_apt_estc/Cre_Apt_Estc_1.java | 94 + .../catre/cre_apt_estc/Cre_Apt_Estc_2.java | 95 + .../catre/cre_apt_estc/Cre_Apt_Estc_3.java | 109 + .../catre/cre_apt_estc/Test_Cre_Apt_Estc.java | 114 + .../uicc/test/catre/cre_apt_estc/applet.opt | 6 + .../cre_apt_estc/javacard/cre_apt_estc.cap | Bin 0 -> 3684 bytes .../catre/cre_apt_etex/Cre_Apt_Etex_1.java | 139 ++ .../catre/cre_apt_etex/Test_Cre_Apt_Etex.java | 81 + .../uicc/test/catre/cre_apt_etex/applet.opt | 4 + .../cre_apt_etex/javacard/cre_apt_etex.cap | Bin 0 -> 3144 bytes .../catre/cre_apt_euev/Cre_Apt_Euev_1.java | 121 ++ .../catre/cre_apt_euev/Test_Cre_Apt_Euev.java | 79 + .../uicc/test/catre/cre_apt_euev/applet.opt | 4 + .../cre_apt_euev/javacard/cre_apt_euev.cap | Bin 0 -> 2978 bytes .../catre/cre_apt_genb/Cre_Apt_Genb_1.java | 114 + .../catre/cre_apt_genb/Test_Cre_Apt_Genb.java | 119 ++ .../uicc/test/catre/cre_apt_genb/applet.opt | 4 + .../cre_apt_genb/javacard/cre_apt_genb.cap | Bin 0 -> 4075 bytes .../catre/cre_erp_eccn/Cre_Erp_Eccn_1.java | 88 + .../catre/cre_erp_eccn/Cre_Erp_Eccn_2.java | 94 + .../catre/cre_erp_eccn/Cre_Erp_Eccn_3.java | 109 + .../catre/cre_erp_eccn/Test_Cre_Erp_Eccn.java | 181 ++ .../uicc/test/catre/cre_erp_eccn/applet.opt | 6 + .../cre_erp_eccn/javacard/cre_erp_eccn.cap | Bin 0 -> 5634 bytes .../catre/cre_erp_euen/Cre_Erp_Euen_1.java | 103 + .../catre/cre_erp_euen/Test_Cre_Erp_Euen.java | 97 + .../uicc/test/catre/cre_erp_euen/applet.opt | 4 + .../cre_erp_euen/javacard/cre_erp_euen.cap | Bin 0 -> 4081 bytes .../catre/cre_exh_genb/Cre_Exh_Genb_1.java | 115 + .../catre/cre_exh_genb/Cre_Exh_Genb_2.java | 90 + .../catre/cre_exh_genb/Test_Cre_Exh_Genb.java | 137 ++ .../uicc/test/catre/cre_exh_genb/applet.opt | 5 + .../cre_exh_genb/javacard/cre_exh_genb.cap | Bin 0 -> 4816 bytes .../catre/cre_exh_imtg/Cre_Exh_Imtg_1.java | 107 + .../catre/cre_exh_imtg/Cre_Exh_Imtg_2.java | 102 + .../catre/cre_exh_imtg/Test_Cre_Exh_Imtg.java | 131 ++ .../uicc/test/catre/cre_exh_imtg/applet.opt | 5 + .../cre_exh_imtg/javacard/cre_exh_imtg.cap | Bin 0 -> 4512 bytes .../catre/cre_hin_enhd/Cre_Hin_Enhd_1.java | 466 +++++ .../catre/cre_hin_enhd/Test_Cre_Hin_Enhd.java | 371 ++++ .../uicc/test/catre/cre_hin_enhd/applet.opt | 4 + .../cre_hin_enhd/javacard/cre_hin_enhd.cap | Bin 0 -> 5131 bytes .../catre/cre_hin_erhd/Cre_Hin_Erhd_1.java | 67 + .../catre/cre_hin_erhd/Test_Cre_Hin_Erhd.java | 83 + .../uicc/test/catre/cre_hin_erhd/applet.opt | 4 + .../cre_hin_erhd/javacard/cre_hin_erhd.cap | Bin 0 -> 2737 bytes .../catre/cre_hin_pahd/Cre_Hin_Pahd_1.java | 114 + .../catre/cre_hin_pahd/Cre_Hin_Pahd_2.java | 209 ++ .../catre/cre_hin_pahd/Test_Cre_Hin_Pahd.java | 115 + .../uicc/test/catre/cre_hin_pahd/applet.opt | 5 + .../cre_hin_pahd/javacard/cre_hin_pahd.cap | Bin 0 -> 4260 bytes .../catre/cre_hin_prhd/Cre_Hin_Prhd_1.java | 233 +++ .../catre/cre_hin_prhd/Test_Cre_Hin_Prhd.java | 534 +++++ .../uicc/test/catre/cre_hin_prhd/applet.opt | 4 + .../cre_hin_prhd/javacard/cre_hin_prhd.cap | Bin 0 -> 3762 bytes .../catre/cre_mha_enhd/Cre_Mha_Enhd_1.java | 255 +++ .../catre/cre_mha_enhd/Cre_Mha_Enhd_2.java | 192 ++ .../catre/cre_mha_enhd/Cre_Mha_Enhd_3.java | 159 ++ .../catre/cre_mha_enhd/Test_Cre_Mha_Enhd.java | 246 +++ .../uicc/test/catre/cre_mha_enhd/applet.opt | 6 + .../cre_mha_enhd/javacard/cre_mha_enhd.cap | Bin 0 -> 5648 bytes .../catre/cre_mha_erhd/Cre_Mha_Erhd_1.java | 632 ++++++ .../catre/cre_mha_erhd/Cre_Mha_Erhd_2.java | 146 ++ .../catre/cre_mha_erhd/Cre_Mha_Erhd_3.java | 165 ++ .../catre/cre_mha_erhd/Test_Cre_Mha_Erhd.java | 264 +++ .../uicc/test/catre/cre_mha_erhd/applet.opt | 6 + .../cre_mha_erhd/javacard/cre_mha_erhd.cap | Bin 0 -> 6996 bytes .../catre/cre_mha_pahd/Cre_Mha_Pahd_1.java | 265 +++ .../catre/cre_mha_pahd/Cre_Mha_Pahd_2.java | 227 ++ .../catre/cre_mha_pahd/Cre_Mha_Pahd_3.java | 155 ++ .../catre/cre_mha_pahd/Test_Cre_Mha_Pahd.java | 337 +++ .../uicc/test/catre/cre_mha_pahd/applet.opt | 6 + .../cre_mha_pahd/javacard/cre_mha_pahd.cap | Bin 0 -> 5677 bytes .../catre/cre_mha_prhd/Cre_Mha_Prhd_1.java | 272 +++ .../catre/cre_mha_prhd/Cre_Mha_Prhd_2.java | 224 ++ .../catre/cre_mha_prhd/Cre_Mha_Prhd_3.java | 161 ++ .../catre/cre_mha_prhd/Test_Cre_Mha_Prhd.java | 336 +++ .../uicc/test/catre/cre_mha_prhd/applet.opt | 6 + .../cre_mha_prhd/javacard/cre_mha_prhd.cap | Bin 0 -> 5710 bytes .../catre/cre_pcs_igco/Cre_Pcs_Igco_1.java | 118 ++ .../catre/cre_pcs_igco/Test_Cre_Pcs_Igco.java | 197 ++ .../uicc/test/catre/cre_pcs_igco/applet.opt | 4 + .../cre_pcs_igco/javacard/cre_pcs_igco.cap | Bin 0 -> 4195 bytes .../catre/cre_pcs_pcco/Cre_Pcs_Pcco_1.java | 525 +++++ .../catre/cre_pcs_pcco/Cre_Pcs_Pcco_2.java | 334 +++ .../catre/cre_pcs_pcco/Cre_Pcs_Pcco_3.java | 92 + .../catre/cre_pcs_pcco/Test_Cre_Pcs_Pcco.java | 301 +++ .../uicc/test/catre/cre_pcs_pcco/applet.opt | 6 + .../cre_pcs_pcco/javacard/cre_pcs_pcco.cap | Bin 0 -> 11461 bytes .../catre/cre_pcs_spco/Cre_Pcs_Spco_1.java | 188 ++ .../catre/cre_pcs_spco/Cre_Pcs_Spco_2.java | 247 +++ .../catre/cre_pcs_spco/Cre_Pcs_Spco_3.java | 83 + .../catre/cre_pcs_spco/Test_Cre_Pcs_Spco.java | 739 +++++++ .../uicc/test/catre/cre_pcs_spco/applet.opt | 6 + .../cre_pcs_spco/javacard/cre_pcs_spco.cap | Bin 0 -> 8565 bytes .../catre/cre_reg_evtr/Cre_Reg_Evtr_1.java | 65 + .../catre/cre_reg_evtr/Cre_Reg_Evtr_2.java | 73 + .../catre/cre_reg_evtr/Test_Cre_Reg_Evtr.java | 111 + .../uicc/test/catre/cre_reg_evtr/applet.opt | 5 + .../cre_reg_evtr/javacard/cre_reg_evtr.cap | Bin 0 -> 4629 bytes .../catre/cre_tin_acdo/Cre_Tin_Acdo_1.java | 176 ++ .../catre/cre_tin_acdo/Cre_Tin_Acdo_2.java | 160 ++ .../catre/cre_tin_acdo/Cre_Tin_Acdo_3.java | 176 ++ .../catre/cre_tin_acdo/Cre_Tin_Acdo_4.java | 176 ++ .../catre/cre_tin_acdo/Cre_Tin_Acdo_5.java | 176 ++ .../catre/cre_tin_acdo/Cre_Tin_Acdo_6.java | 176 ++ .../catre/cre_tin_acdo/Cre_Tin_Acdo_7.java | 316 +++ .../catre/cre_tin_acdo/Cre_Tin_Acdo_8.java | 751 +++++++ .../catre/cre_tin_acdo/Test_Cre_Tin_Acdo.java | 684 ++++++ .../uicc/test/catre/cre_tin_acdo/applet.opt | 10 + .../cre_tin_acdo/javacard/cre_tin_acdo.cap | Bin 0 -> 14237 bytes .../catre/cre_tin_chal/Cre_Tin_Chal_1.java | 47 + .../catre/cre_tin_chal/Cre_Tin_Chal_2.java | 114 + .../catre/cre_tin_chal/Cre_Tin_Chal_3.java | 110 + .../catre/cre_tin_chal/Test_Cre_Tin_Chal.java | 188 ++ .../uicc/test/catre/cre_tin_chal/applet.opt | 6 + .../cre_tin_chal/javacard/cre_tin_chal.cap | Bin 0 -> 5872 bytes .../catre/cre_tin_genb/Cre_Tin_Genb_1.java | 85 + .../catre/cre_tin_genb/Cre_Tin_Genb_2.java | 72 + .../catre/cre_tin_genb/Test_Cre_Tin_Genb.java | 121 ++ .../uicc/test/catre/cre_tin_genb/applet.opt | 5 + .../cre_tin_genb/javacard/cre_tin_genb.cap | Bin 0 -> 4712 bytes .../catre/cre_tin_itid/Cre_Tin_Itid_1.java | 57 + .../catre/cre_tin_itid/Cre_Tin_Itid_2.java | 54 + .../catre/cre_tin_itid/Cre_Tin_Itid_3.java | 53 + .../catre/cre_tin_itid/Test_Cre_Tin_Itid.java | 335 +++ .../uicc/test/catre/cre_tin_itid/applet.opt | 6 + .../cre_tin_itid/javacard/cre_tin_itid.cap | Bin 0 -> 4552 bytes .../catre/cre_tin_itpo/Cre_Tin_Itpo_1.java | 77 + .../catre/cre_tin_itpo/Cre_Tin_Itpo_2.java | 55 + .../catre/cre_tin_itpo/Cre_Tin_Itpo_3.java | 56 + .../catre/cre_tin_itpo/Cre_Tin_Itpo_4.java | 53 + .../catre/cre_tin_itpo/Cre_Tin_Itpo_5.java | 53 + .../catre/cre_tin_itpo/Cre_Tin_Itpo_6.java | 57 + .../catre/cre_tin_itpo/Test_Cre_Tin_Itpo.java | 517 +++++ .../uicc/test/catre/cre_tin_itpo/applet.opt | 9 + .../cre_tin_itpo/javacard/cre_tin_itpo.cap | Bin 0 -> 6472 bytes .../catre/cre_tin_mlme/Cre_Tin_Mlme_1.java | 316 +++ .../catre/cre_tin_mlme/Test_Cre_Tin_Mlme.java | 212 ++ .../uicc/test/catre/cre_tin_mlme/applet.opt | 4 + .../cre_tin_mlme/javacard/cre_tin_mlme.cap | Bin 0 -> 4852 bytes .../catre/cre_tin_nbme/Cre_Tin_Nbme_1.java | 182 ++ .../catre/cre_tin_nbme/Cre_Tin_Nbme_2.java | 90 + .../catre/cre_tin_nbme/Test_Cre_Tin_Nbme.java | 223 ++ .../uicc/test/catre/cre_tin_nbme/applet.opt | 5 + .../cre_tin_nbme/javacard/cre_tin_nbme.cap | Bin 0 -> 4934 bytes .../catre/cre_tin_prlv_1/Cre_Tin_Prlv_1.java | 98 + .../cre_tin_prlv_1/Test_Cre_Tin_Prlv_1.java | 103 + .../uicc/test/catre/cre_tin_prlv_1/applet.opt | 4 + .../javacard/cre_tin_prlv_1.cap | Bin 0 -> 3782 bytes .../cre_tin_prlv_10/Cre_Tin_Prlv_10.java | 29 + .../cre_tin_prlv_10/Test_Cre_Tin_Prlv_10.java | 167 ++ .../test/catre/cre_tin_prlv_10/applet.opt | 3 + .../cre_tin_prlv_10a/Cre_Tin_Prlv_10A.java | 152 ++ .../cre_tin_prlv_10a/applet.opt | 4 + .../javacard/cre_tin_prlv_10a.cap | Bin 0 -> 4473 bytes .../cre_tin_prlv_10b/Cre_Tin_Prlv_10B.java | 99 + .../cre_tin_prlv_10b/applet.opt | 4 + .../javacard/cre_tin_prlv_10b.cap | Bin 0 -> 4262 bytes .../javacard/cre_tin_prlv_10.cap | Bin 0 -> 2959 bytes .../cre_tin_prlv_11/Cre_Tin_Prlv_11.java | 191 ++ .../cre_tin_prlv_11/Test_Cre_Tin_Prlv_11.java | 188 ++ .../test/catre/cre_tin_prlv_11/applet.opt | 4 + .../javacard/cre_tin_prlv_11.cap | Bin 0 -> 4220 bytes .../cre_tin_prlv_12/Cre_Tin_Prlv_12.java | 246 +++ .../cre_tin_prlv_12/Test_Cre_Tin_Prlv_12.java | 223 ++ .../test/catre/cre_tin_prlv_12/applet.opt | 4 + .../javacard/cre_tin_prlv_12.cap | Bin 0 -> 4440 bytes .../catre/cre_tin_prlv_2/Cre_Tin_Prlv_2.java | 98 + .../cre_tin_prlv_2/Test_Cre_Tin_Prlv_2.java | 103 + .../uicc/test/catre/cre_tin_prlv_2/applet.opt | 4 + .../javacard/cre_tin_prlv_2.cap | Bin 0 -> 3782 bytes .../catre/cre_tin_prlv_3/Cre_Tin_Prlv_3.java | 98 + .../cre_tin_prlv_3/Test_Cre_Tin_Prlv_3.java | 103 + .../uicc/test/catre/cre_tin_prlv_3/applet.opt | 4 + .../javacard/cre_tin_prlv_3.cap | Bin 0 -> 3780 bytes .../catre/cre_tin_prlv_4/Cre_Tin_Prlv_4.java | 98 + .../cre_tin_prlv_4/Test_Cre_Tin_Prlv_4.java | 103 + .../uicc/test/catre/cre_tin_prlv_4/applet.opt | 4 + .../javacard/cre_tin_prlv_4.cap | Bin 0 -> 3782 bytes .../catre/cre_tin_prlv_5/Cre_Tin_Prlv_5.java | 111 + .../cre_tin_prlv_5/Test_Cre_Tin_Prlv_5.java | 119 ++ .../uicc/test/catre/cre_tin_prlv_5/applet.opt | 4 + .../javacard/cre_tin_prlv_5.cap | Bin 0 -> 3832 bytes .../catre/cre_tin_prlv_6/Cre_Tin_Prlv_6.java | 102 + .../cre_tin_prlv_6/Test_Cre_Tin_Prlv_6.java | 105 + .../uicc/test/catre/cre_tin_prlv_6/applet.opt | 5 + .../javacard/cre_tin_prlv_6.cap | Bin 0 -> 3816 bytes .../catre/cre_tin_prlv_7/Cre_Tin_Prlv_7.java | 101 + .../cre_tin_prlv_7/Test_Cre_Tin_Prlv_7.java | 108 + .../uicc/test/catre/cre_tin_prlv_7/applet.opt | 5 + .../javacard/cre_tin_prlv_7.cap | Bin 0 -> 3817 bytes .../catre/cre_tin_prlv_8/Cre_Tin_Prlv_8.java | 29 + .../cre_tin_prlv_8/Test_Cre_Tin_Prlv_8.java | 111 + .../uicc/test/catre/cre_tin_prlv_8/applet.opt | 3 + .../cre_tin_prlv_8a/Cre_Tin_Prlv_8A.java | 73 + .../cre_tin_prlv_8/cre_tin_prlv_8a/applet.opt | 4 + .../javacard/cre_tin_prlv_8a.cap | Bin 0 -> 4008 bytes .../cre_tin_prlv_8b/Cre_Tin_Prlv_8B.java | 73 + .../cre_tin_prlv_8/cre_tin_prlv_8b/applet.opt | 4 + .../javacard/cre_tin_prlv_8b.cap | Bin 0 -> 4008 bytes .../javacard/cre_tin_prlv_8.cap | Bin 0 -> 2929 bytes .../catre/cre_tin_prlv_9/Cre_Tin_Prlv_9.java | 29 + .../cre_tin_prlv_9/Test_Cre_Tin_Prlv_9.java | 114 + .../uicc/test/catre/cre_tin_prlv_9/applet.opt | 3 + .../cre_tin_prlv_9a/Cre_Tin_Prlv_9A.java | 72 + .../cre_tin_prlv_9/cre_tin_prlv_9a/applet.opt | 4 + .../javacard/cre_tin_prlv_9a.cap | Bin 0 -> 4008 bytes .../cre_tin_prlv_9b/Cre_Tin_Prlv_9B.java | 72 + .../cre_tin_prlv_9/cre_tin_prlv_9b/applet.opt | 4 + .../javacard/cre_tin_prlv_9b.cap | Bin 0 -> 4009 bytes .../javacard/cre_tin_prlv_9.cap | Bin 0 -> 2930 bytes .../catre/cre_tin_sval/Cre_Tin_Sval_1.java | 47 + .../catre/cre_tin_sval/Cre_Tin_Sval_2.java | 111 + .../catre/cre_tin_sval/Cre_Tin_Sval_3.java | 126 ++ .../catre/cre_tin_sval/Test_Cre_Tin_Sval.java | 157 ++ .../uicc/test/catre/cre_tin_sval/applet.opt | 6 + .../cre_tin_sval/javacard/cre_tin_sval.cap | Bin 0 -> 5679 bytes .../catre/cre_tin_tarv/Cre_Tin_Tarv_1.java | 47 + .../catre/cre_tin_tarv/Cre_Tin_Tarv_2.java | 47 + .../catre/cre_tin_tarv/Test_Cre_Tin_Tarv.java | 119 ++ .../uicc/test/catre/cre_tin_tarv/applet.opt | 5 + .../cre_tin_tarv/javacard/cre_tin_tarv.cap | Bin 0 -> 3834 bytes .../catre/cre_tin_tmal/Cre_Tin_Tmal_1.java | 46 + .../catre/cre_tin_tmal/Cre_Tin_Tmal_2.java | 103 + .../catre/cre_tin_tmal/Cre_Tin_Tmal_3.java | 121 ++ .../catre/cre_tin_tmal/Test_Cre_Tin_Tmal.java | 151 ++ .../uicc/test/catre/cre_tin_tmal/applet.opt | 6 + .../cre_tin_tmal/javacard/cre_tin_tmal.cap | Bin 0 -> 5534 bytes .../catre/cre_ufa_view/Cre_Ufa_View_1.java | 471 +++++ .../catre/cre_ufa_view/Cre_Ufa_View_2.java | 492 +++++ .../catre/cre_ufa_view/Test_Cre_Ufa_View.java | 136 ++ .../uicc/test/catre/cre_ufa_view/applet.opt | 5 + .../cre_ufa_view/javacard/cre_ufa_view.cap | Bin 0 -> 13572 bytes .../catre/cre_uta_adel/Test_Cre_Uta_Adel.java | 436 ++++ .../cre_uta_adel_a/Cre_Uta_Adel_A_1.java | 126 ++ .../cre_uta_adel_a/Cre_Uta_Adel_A_2.java | 96 + .../cre_uta_adel_a/Cre_Uta_Adel_A_3.java | 24 + .../cre_uta_adel/cre_uta_adel_a/applet.opt | 5 + .../javacard/cre_uta_adel_a.cap | Bin 0 -> 4135 bytes .../cre_uta_adel_b/Cre_Uta_Adel_B_1.java | 113 + .../cre_uta_adel_b/Cre_Uta_Adel_B_2.java | 115 + .../cre_uta_adel/cre_uta_adel_b/applet.opt | 5 + .../javacard/cre_uta_adel_b.cap | Bin 0 -> 3809 bytes .../catre/cre_uta_dafs/Test_Cre_Uta_Dafs.java | 119 ++ .../cre_uta_dafs_a/Cre_Uta_Dafs_A_1.java | 92 + .../cre_uta_dafs_a/Cre_Uta_Dafs_A_2.java | 31 + .../cre_uta_dafs_a/Cre_Uta_Dafs_A_3.java | 28 + .../cre_uta_dafs/cre_uta_dafs_a/applet.opt | 4 + .../javacard/cre_uta_dafs_a.cap | Bin 0 -> 3521 bytes .../cre_uta_dafs_b/Cre_Uta_Dafs_B_1.java | 90 + .../cre_uta_dafs/cre_uta_dafs_b/applet.opt | 4 + .../javacard/cre_uta_dafs_b.cap | Bin 0 -> 3207 bytes .../catre/cre_uta_odel/Cre_Uta_Odel_1.java | 66 + .../catre/cre_uta_odel/Test_Cre_Uta_Odel.java | 76 + .../uicc/test/catre/cre_uta_odel/applet.opt | 4 + .../cre_uta_odel/javacard/cre_uta_odel.cap | Bin 0 -> 2676 bytes .../catre/cre_uta_pdel/Test_Cre_Uta_Pdel.java | 217 ++ .../cre_uta_pdel_a/Cre_Uta_Pdel_A_1.java | 52 + .../cre_uta_pdel_a/Cre_Uta_Pdel_A_2.java | 93 + .../cre_uta_pdel_a/Cre_Uta_Pdel_A_3.java | 24 + .../cre_uta_pdel/cre_uta_pdel_a/applet.opt | 5 + .../javacard/cre_uta_pdel_a.cap | Bin 0 -> 3595 bytes .../cre_uta_pdel_b/Cre_Uta_Pdel_B_1.java | 90 + .../cre_uta_pdel_b/Cre_Uta_Pdel_B_2.java | 54 + .../cre_uta_pdel/cre_uta_pdel_b/applet.opt | 5 + .../javacard/cre_uta_pdel_b.cap | Bin 0 -> 3384 bytes .../api_3_hbd_bthdbs/Api_3_Hbd_Bthdbs_1.java | 132 ++ .../Test_Api_3_Hbd_Bthdbs.java | 73 + .../test/system/api_3_hbd_bthdbs/applet.opt | 4 + .../javacard/api_3_hbd_bthdbs.cap | Bin 0 -> 4641 bytes .../Api_3_Hbd_Bthdbs_Bss_1.java | 262 +++ .../Test_Api_3_Hbd_Bthdbs_Bss.java | 71 + .../system/api_3_hbd_bthdbs_bss/applet.opt | 4 + .../javacard/api_3_hbd_bthdbs_bss.cap | Bin 0 -> 6400 bytes .../api_3_upf_gvba/Api_3_Upf_Gvba_1.java | 170 ++ .../Api_ShareableInterface.java | 15 + .../api_3_upf_gvba/Test_Api_3_Upf_Gvba.java | 102 + .../Api_GetShareableClientApplet.java | 48 + .../api_3_upf_gvba/api_3_upf_gvba2/applet.opt | 4 + .../javacard/api_3_upf_gvba2.cap | Bin 0 -> 4190 bytes .../test/system/api_3_upf_gvba/applet.opt | 4 + .../javacard/api_3_upf_gvba.cap | Bin 0 -> 5679 bytes .../api_2_bte_apda/Api_2_Bte_Apda_1.java | 294 +++ .../api_2_bte_apda/Test_Api_2_Bte_Apda.java | 81 + .../test/toolkit/api_2_bte_apda/applet.opt | 4 + .../javacard/api_2_bte_apda.cap | Bin 0 -> 4484 bytes .../Api_2_Bte_Aptlb_Bss_1.java | 346 ++++ .../Test_Api_2_Bte_Aptlb_Bss.java | 87 + .../toolkit/api_2_bte_aptlb_bss/applet.opt | 4 + .../javacard/api_2_bte_aptlb_bss.cap | Bin 0 -> 4972 bytes .../Api_2_Bte_Aptlb_Bss_Bss_1.java | 449 ++++ .../Test_Api_2_Bte_Aptlb_Bss_Bss.java | 87 + .../api_2_bte_aptlb_bss_bss/applet.opt | 4 + .../javacard/api_2_bte_aptlb_bss_bss.cap | Bin 0 -> 5804 bytes .../api_2_bte_aptlbb/Api_2_Bte_Aptlbb_1.java | 189 ++ .../Test_Api_2_Bte_Aptlbb.java | 82 + .../test/toolkit/api_2_bte_aptlbb/applet.opt | 4 + .../javacard/api_2_bte_aptlbb.cap | Bin 0 -> 3795 bytes .../Api_2_Bte_Aptlbb_Bss_1.java | 366 ++++ .../Test_Api_2_Bte_Aptlbb_Bss.java | 81 + .../toolkit/api_2_bte_aptlbb_bss/applet.opt | 4 + .../javacard/api_2_bte_aptlbb_bss.cap | Bin 0 -> 5044 bytes .../Api_2_Bte_Aptlbbb_1.java | 182 ++ .../Test_Api_2_Bte_Aptlbbb.java | 81 + .../test/toolkit/api_2_bte_aptlbbb/applet.opt | 4 + .../javacard/api_2_bte_aptlbbb.cap | Bin 0 -> 3844 bytes .../Api_2_Bte_Aptlbbs_1.java | 173 ++ .../Test_Api_2_Bte_Aptlbbs.java | 82 + .../test/toolkit/api_2_bte_aptlbbs/applet.opt | 4 + .../javacard/api_2_bte_aptlbbs.cap | Bin 0 -> 3875 bytes .../api_2_bte_aptlbs/Api_2_Bte_Aptlbs_1.java | 178 ++ .../Test_Api_2_Bte_Aptlbs.java | 80 + .../test/toolkit/api_2_bte_aptlbs/applet.opt | 4 + .../javacard/api_2_bte_aptlbs.cap | Bin 0 -> 3841 bytes .../Api_2_Bte_Aptlbss_1.java | 189 ++ .../Test_Api_2_Bte_Aptlbss.java | 80 + .../test/toolkit/api_2_bte_aptlbss/applet.opt | 4 + .../javacard/api_2_bte_aptlbss.cap | Bin 0 -> 3936 bytes .../api_2_bte_cler/Api_2_Bte_Cler_1.java | 107 + .../api_2_bte_cler/Test_Api_2_Bte_Cler.java | 78 + .../test/toolkit/api_2_bte_cler/applet.opt | 4 + .../javacard/api_2_bte_cler.cap | Bin 0 -> 3185 bytes .../api_2_bte_copy/Api_2_Bte_Copy_1.java | 239 +++ .../api_2_bte_copy/Test_Api_2_Bte_Copy.java | 82 + .../test/toolkit/api_2_bte_copy/applet.opt | 4 + .../javacard/api_2_bte_copy.cap | Bin 0 -> 3815 bytes .../api_2_bte_cprv/Api_2_Bte_Cprv_1.java | 390 ++++ .../api_2_bte_cprv/Test_Api_2_Bte_Cprv.java | 83 + .../test/toolkit/api_2_bte_cprv/applet.opt | 4 + .../javacard/api_2_bte_cprv.cap | Bin 0 -> 5755 bytes .../api_2_bte_cpyv/Api_2_Bte_Cpyv_1.java | 328 +++ .../api_2_bte_cpyv/Test_Api_2_Bte_Cpyv.java | 82 + .../test/toolkit/api_2_bte_cpyv/applet.opt | 4 + .../javacard/api_2_bte_cpyv.cap | Bin 0 -> 4741 bytes .../Api_2_Bte_Facrb_Bs_1.java | 425 ++++ .../Test_Api_2_Bte_Facrb_Bs.java | 83 + .../toolkit/api_2_bte_facrb_bs/applet.opt | 4 + .../javacard/api_2_bte_facrb_bs.cap | Bin 0 -> 6338 bytes .../Api_2_Bte_Facrbbs_Bss_1.java | 568 +++++ .../Test_Api_2_Bte_Facrbbs_Bss.java | 85 + .../toolkit/api_2_bte_facrbbs_bss/applet.opt | 4 + .../javacard/api_2_bte_facrbbs_bss.cap | Bin 0 -> 7266 bytes .../Api_2_Bte_Facyb_Bs_1.java | 379 ++++ .../Test_Api_2_Bte_Facyb_Bs.java | 83 + .../toolkit/api_2_bte_facyb_bs/applet.opt | 4 + .../javacard/api_2_bte_facyb_bs.cap | Bin 0 -> 5573 bytes .../Api_2_Bte_Facybbs_Bss_1.java | 504 +++++ .../Test_Api_2_Bte_Facybbs_Bss.java | 81 + .../toolkit/api_2_bte_facybbs_bss/applet.opt | 4 + .../javacard/api_2_bte_facybbs_bss.cap | Bin 0 -> 6232 bytes .../api_2_bte_find/Api_2_Bte_Find_1.java | 207 ++ .../api_2_bte_find/Test_Api_2_Bte_Find.java | 82 + .../test/toolkit/api_2_bte_find/applet.opt | 4 + .../javacard/api_2_bte_find.cap | Bin 0 -> 3530 bytes .../api_2_bte_gcap/Api_2_Bte_Gcap_1.java | 92 + .../api_2_bte_gcap/Test_Api_2_Bte_Gcap.java | 80 + .../test/toolkit/api_2_bte_gcap/applet.opt | 4 + .../javacard/api_2_bte_gcap.cap | Bin 0 -> 3128 bytes .../api_2_bte_glen/Api_2_Bte_Glen_1.java | 130 ++ .../api_2_bte_glen/Test_Api_2_Bte_Glen.java | 83 + .../test/toolkit/api_2_bte_glen/applet.opt | 4 + .../javacard/api_2_bte_glen.cap | Bin 0 -> 3171 bytes .../api_2_bte_gtsz/Api_2_Bte_Gtsz_1.java | 135 ++ .../api_2_bte_gtsz/Test_Api_2_Bte_Gtsz.java | 83 + .../test/toolkit/api_2_bte_gtsz/applet.opt | 4 + .../javacard/api_2_bte_gtsz.cap | Bin 0 -> 3177 bytes .../api_2_bte_gvby/Api_2_Bte_Gvby_1.java | 198 ++ .../api_2_bte_gvby/Test_Api_2_Bte_Gvby.java | 81 + .../test/toolkit/api_2_bte_gvby/applet.opt | 4 + .../javacard/api_2_bte_gvby.cap | Bin 0 -> 3725 bytes .../api_2_bte_gvle/Api_2_Bte_Gvle_1.java | 190 ++ .../api_2_bte_gvle/Test_Api_2_Bte_Gvle.java | 79 + .../test/toolkit/api_2_bte_gvle/applet.opt | 4 + .../javacard/api_2_bte_gvle.cap | Bin 0 -> 3729 bytes .../api_2_bte_gvsh/Api_2_Bte_Gvsh_1.java | 229 ++ .../api_2_bte_gvsh/Test_Api_2_Bte_Gvsh.java | 82 + .../test/toolkit/api_2_bte_gvsh/applet.opt | 4 + .../javacard/api_2_bte_gvsh.cap | Bin 0 -> 4073 bytes .../api_2_bte_sttg/Api_2_Bte_Sttg_1.java | 76 + .../api_2_bte_sttg/Test_Api_2_Bte_Sttg.java | 80 + .../test/toolkit/api_2_bte_sttg/applet.opt | 4 + .../javacard/api_2_bte_sttg.cap | Bin 0 -> 2879 bytes .../api_2_ehs_gthd/Api_2_Ehs_Gthd_1.java | 126 ++ .../api_2_ehs_gthd/Test_Api_2_Ehs_Gthd.java | 109 + .../test/toolkit/api_2_ehs_gthd/applet.opt | 4 + .../javacard/api_2_ehs_gthd.cap | Bin 0 -> 2954 bytes .../api_2_enh_copy/Api_2_Enh_Copy_1.java | 468 +++++ .../api_2_enh_copy/Test_Api_2_Enh_Copy.java | 273 +++ .../test/toolkit/api_2_enh_copy/applet.opt | 4 + .../javacard/api_2_enh_copy.cap | Bin 0 -> 7937 bytes .../api_2_enh_cprv/Api_2_Enh_Cprv_1.java | 519 +++++ .../api_2_enh_cprv/Test_Api_2_Enh_Cprv.java | 120 ++ .../test/toolkit/api_2_enh_cprv/applet.opt | 4 + .../javacard/api_2_enh_cprv.cap | Bin 0 -> 4881 bytes .../api_2_enh_cpyv/Api_2_Enh_Cpyv_1.java | 430 ++++ .../api_2_enh_cpyv/Test_Api_2_Enh_Cpyv.java | 130 ++ .../test/toolkit/api_2_enh_cpyv/applet.opt | 4 + .../javacard/api_2_enh_cpyv.cap | Bin 0 -> 4724 bytes .../Api_2_Enh_Facrb_Bs_1.java | 430 ++++ .../Test_Api_2_Enh_Facrb_Bs.java | 131 ++ .../toolkit/api_2_enh_facrb_bs/applet.opt | 4 + .../javacard/api_2_enh_facrb_bs.cap | Bin 0 -> 5567 bytes .../Api_2_Enh_Facrbbs_Bss_1.java | 616 ++++++ .../Test_Api_2_Enh_Facrbbs_Bss.java | 133 ++ .../toolkit/api_2_enh_facrbbs_bss/applet.opt | 4 + .../javacard/api_2_enh_facrbbs_bss.cap | Bin 0 -> 6488 bytes .../Api_2_Enh_Facyb_Bs_1.java | 432 ++++ .../Test_Api_2_Enh_Facyb_Bs.java | 132 ++ .../toolkit/api_2_enh_facyb_bs/applet.opt | 4 + .../javacard/api_2_enh_facyb_bs.cap | Bin 0 -> 5740 bytes .../Api_2_Enh_Facyb_Bss_1.java | 625 ++++++ .../Test_Api_2_Enh_Facyb_Bss.java | 132 ++ .../toolkit/api_2_enh_facyb_bss/applet.opt | 4 + .../javacard/api_2_enh_facyb_bss.cap | Bin 0 -> 5665 bytes .../api_2_enh_find/Api_2_Enh_Find_1.java | 325 +++ .../api_2_enh_find/Test_Api_2_Enh_Find.java | 122 ++ .../test/toolkit/api_2_enh_find/applet.opt | 4 + .../javacard/api_2_enh_find.cap | Bin 0 -> 3783 bytes .../api_2_enh_gcap/Api_2_Enh_Gcap_1.java | 103 + .../api_2_enh_gcap/Test_Api_2_Enh_Gcap.java | 105 + .../test/toolkit/api_2_enh_gcap/applet.opt | 4 + .../javacard/api_2_enh_gcap.cap | Bin 0 -> 2904 bytes .../api_2_enh_gcid/Api_2_Enh_Gcid_1.java | 202 ++ .../api_2_enh_gcid/Test_Api_2_Enh_Gcid.java | 176 ++ .../test/toolkit/api_2_enh_gcid/applet.opt | 4 + .../javacard/api_2_enh_gcid.cap | Bin 0 -> 3460 bytes .../api_2_enh_gcst/Api_2_Enh_Gcst_1.java | 242 +++ .../api_2_enh_gcst/Test_Api_2_Enh_Gcst.java | 144 ++ .../test/toolkit/api_2_enh_gcst/applet.opt | 4 + .../javacard/Api_2_Enh_Gcst.cap | Bin 0 -> 3648 bytes .../api_2_enh_giid/Api_2_Enh_Giid_1.java | 233 +++ .../api_2_enh_giid/Test_Api_2_Enh_Giid.java | 134 ++ .../test/toolkit/api_2_enh_giid/applet.opt | 4 + .../javacard/api_2_enh_giid.cap | Bin 0 -> 3551 bytes .../api_2_enh_glen/Api_2_Enh_Glen_1.java | 140 ++ .../api_2_enh_glen/Test_Api_2_Enh_Glen.java | 168 ++ .../test/toolkit/api_2_enh_glen/applet.opt | 4 + .../javacard/Api_2_Enh_Glen.cap | Bin 0 -> 3026 bytes .../api_2_enh_gtsz/Api_2_Enh_Gtsz_1.java | 103 + .../api_2_enh_gtsz/Test_Api_2_Enh_Gtsz.java | 118 ++ .../test/toolkit/api_2_enh_gtsz/applet.opt | 4 + .../javacard/api_2_enh_gtsz.cap | Bin 0 -> 2991 bytes .../api_2_enh_gttg/Api_2_Enh_Gttg_1.java | 103 + .../api_2_enh_gttg/Test_Api_2_Enh_Gttg.java | 118 ++ .../test/toolkit/api_2_enh_gttg/applet.opt | 4 + .../javacard/api_2_enh_gttg.cap | Bin 0 -> 2988 bytes .../api_2_enh_gvby/Api_2_Enh_Gvby_1.java | 213 ++ .../api_2_enh_gvby/Test_Api_2_Enh_Gvby.java | 131 ++ .../test/toolkit/api_2_enh_gvby/applet.opt | 4 + .../javacard/api_2_enh_gvby.cap | Bin 0 -> 3385 bytes .../api_2_enh_gvle/Api_2_Enh_Gvle_1.java | 141 ++ .../api_2_enh_gvle/Test_Api_2_Enh_Gvle.java | 140 ++ .../test/toolkit/api_2_enh_gvle/applet.opt | 4 + .../javacard/api_2_enh_gvle.cap | Bin 0 -> 3112 bytes .../api_2_enh_gvsh/Api_2_Enh_Gvsh_1.java | 215 ++ .../api_2_enh_gvsh/Test_Api_2_Enh_Gvsh.java | 134 ++ .../test/toolkit/api_2_enh_gvsh/applet.opt | 4 + .../javacard/api_2_enh_gvsh.cap | Bin 0 -> 3398 bytes .../Api_2_Erh_Apda_Bss_1.java | 409 ++++ .../Test_Api_2_Erh_Apda_Bss.java | 108 + .../toolkit/api_2_erh_apda_bss/applet.opt | 4 + .../javacard/api_2_erh_apda_bss.cap | Bin 0 -> 4254 bytes .../Api_2_Erh_Aptlb_Bss_1.java | 506 +++++ .../Test_Api_2_Erh_Aptlb_Bss.java | 107 + .../toolkit/api_2_erh_aptlb_bss/applet.opt | 4 + .../javacard/api_2_erh_aptlb_bss.cap | Bin 0 -> 4710 bytes .../Api_2_Erh_Aptlb_Bss_Bss_1.java | 673 ++++++ .../Test_Api_2_Erh_Aptlb_Bss_Bss.java | 108 + .../api_2_erh_aptlb_bss_bss/applet.opt | 4 + .../javacard/api_2_erh_aptlb_bss_bss.cap | Bin 0 -> 5700 bytes .../api_2_erh_aptlbb/Api_2_Erh_Aptlbb_1.java | 244 +++ .../Test_Api_2_Erh_Aptlbb.java | 107 + .../test/toolkit/api_2_erh_aptlbb/applet.opt | 4 + .../javacard/api_2_erh_aptlbb.cap | Bin 0 -> 3524 bytes .../Api_2_Erh_Aptlbb_Bss_1.java | 511 +++++ .../Test_Api_2_Erh_Aptlbb_Bss.java | 107 + .../toolkit/api_2_erh_aptlbb_bss/applet.opt | 4 + .../javacard/api_2_erh_aptlbb_bss.cap | Bin 0 -> 4841 bytes .../Api_2_Erh_Aptlbbb_1.java | 247 +++ .../Test_Api_2_Erh_Aptlbbb.java | 107 + .../test/toolkit/api_2_erh_aptlbbb/applet.opt | 4 + .../javacard/api_2_erh_aptlbbb.cap | Bin 0 -> 3561 bytes .../Api_2_Erh_Aptlbbs_1.java | 243 +++ .../Test_Api_2_Erh_Aptlbbs.java | 105 + .../test/toolkit/api_2_erh_aptlbbs/applet.opt | 4 + .../javacard/api_2_erh_aptlbbs.cap | Bin 0 -> 3561 bytes .../api_2_erh_aptlbs/Api_2_Erh_Aptlbs_1.java | 242 +++ .../Test_Api_2_Erh_Aptlbs.java | 107 + .../test/toolkit/api_2_erh_aptlbs/applet.opt | 4 + .../javacard/api_2_erh_aptlbs.cap | Bin 0 -> 3525 bytes .../Api_2_Erh_Aptlbss_1.java | 237 +++ .../Test_Api_2_Erh_Aptlbss.java | 105 + .../test/toolkit/api_2_erh_aptlbss/applet.opt | 4 + .../javacard/api_2_erh_aptlbss.cap | Bin 0 -> 3569 bytes .../api_2_erh_cler/Api_2_Erh_Cler_1.java | 161 ++ .../api_2_erh_cler/Test_Api_2_Erh_Cler.java | 107 + .../test/toolkit/api_2_erh_cler/applet.opt | 4 + .../javacard/api_2_erh_cler.cap | Bin 0 -> 3239 bytes .../api_2_erh_copy/Api_2_Erh_Copy_1.java | 385 ++++ .../api_2_erh_copy/Test_Api_2_Erh_Copy.java | 111 + .../test/toolkit/api_2_erh_copy/applet.opt | 4 + .../javacard/api_2_erh_copy.cap | Bin 0 -> 5764 bytes .../api_2_erh_cprv/Api_2_Erh_Cprv_1.java | 491 +++++ .../api_2_erh_cprv/Test_Api_2_Erh_Cprv.java | 106 + .../test/toolkit/api_2_erh_cprv/applet.opt | 4 + .../javacard/api_2_erh_cprv.cap | Bin 0 -> 5997 bytes .../api_2_erh_cpyv/Api_2_Erh_Cpyv_1.java | 423 ++++ .../api_2_erh_cpyv/Test_Api_2_Erh_Cpyv.java | 106 + .../test/toolkit/api_2_erh_cpyv/applet.opt | 4 + .../javacard/api_2_erh_cpyv.cap | Bin 0 -> 5850 bytes .../Api_2_Erh_Facrb_Bs_1.java | 467 +++++ .../Test_Api_2_Erh_Facrb_Bs.java | 106 + .../toolkit/api_2_erh_facrb_bs/applet.opt | 4 + .../javacard/api_2_erh_facrb_bs.cap | Bin 0 -> 5980 bytes .../Api_2_Erh_Facrbbs_Bss_1.java | 642 ++++++ .../Test_Api_2_Erh_Facrbbs_Bss.java | 109 + .../toolkit/api_2_erh_facrbbs_bss/applet.opt | 4 + .../javacard/api_2_erh_facrbbs_bss.cap | Bin 0 -> 6836 bytes .../Api_2_Erh_Facyb_Bs_1.java | 444 ++++ .../Test_Api_2_Erh_Facyb_Bs.java | 106 + .../toolkit/api_2_erh_facyb_bs/applet.opt | 4 + .../javacard/api_2_erh_facyb_bs.cap | Bin 0 -> 5979 bytes .../Api_2_Erh_Facybbs_Bss_1.java | 637 ++++++ .../Test_Api_2_Erh_Facybbs_Bss.java | 106 + .../toolkit/api_2_erh_facybbs_bss/applet.opt | 4 + .../javacard/api_2_erh_facybbs_bss.cap | Bin 0 -> 6867 bytes .../api_2_erh_find/Api_2_Erh_Find_1.java | 322 +++ .../api_2_erh_find/Test_Api_2_Erh_Find.java | 105 + .../test/toolkit/api_2_erh_find/applet.opt | 4 + .../javacard/api_2_erh_find.cap | Bin 0 -> 3633 bytes .../api_2_erh_gcap/Api_2_Erh_Gcap_1.java | 137 ++ .../api_2_erh_gcap/Test_Api_2_Erh_Gcap.java | 107 + .../test/toolkit/api_2_erh_gcap/applet.opt | 4 + .../javacard/api_2_erh_gcap.cap | Bin 0 -> 3177 bytes .../api_2_erh_glen/Api_2_Erh_Glen_1.java | 191 ++ .../api_2_erh_glen/Test_Api_2_Erh_Glen.java | 122 ++ .../test/toolkit/api_2_erh_glen/applet.opt | 4 + .../javacard/api_2_erh_glen.cap | Bin 0 -> 4930 bytes .../api_2_erh_gvby/Api_2_Erh_Gvby_1.java | 261 +++ .../api_2_erh_gvby/Test_Api_2_Erh_Gvby.java | 104 + .../test/toolkit/api_2_erh_gvby/applet.opt | 4 + .../javacard/api_2_erh_gvby.cap | Bin 0 -> 3567 bytes .../api_2_erh_gvle/Api_2_Erh_Gvle_1.java | 228 ++ .../api_2_erh_gvle/Test_Api_2_Erh_Gvle.java | 105 + .../test/toolkit/api_2_erh_gvle/applet.opt | 4 + .../javacard/api_2_erh_gvle.cap | Bin 0 -> 3398 bytes .../api_2_erh_gvsh/Api_2_Erh_Gvsh_1.java | 259 +++ .../api_2_erh_gvsh/Test_Api_2_Erh_Gvsh.java | 108 + .../test/toolkit/api_2_erh_gvsh/applet.opt | 4 + .../javacard/api_2_erh_gvsh.cap | Bin 0 -> 3582 bytes .../api_2_erh_poab/Api_2_Erh_Poab_1.java | 305 +++ .../api_2_erh_poab/Test_Api_2_Erh_Poab.java | 184 ++ .../test/toolkit/api_2_erh_poab/applet.opt | 4 + .../javacard/api_2_erh_poab.cap | Bin 0 -> 5426 bytes .../api_2_erh_post/Api_2_Erh_Post_1.java | 310 +++ .../api_2_erh_post/Test_Api_2_Erh_Post.java | 179 ++ .../test/toolkit/api_2_erh_post/applet.opt | 4 + .../javacard/api_2_erh_post.cap | Bin 0 -> 5436 bytes .../api_2_ers_gthd/Api_2_Ers_Gthd_1.java | 150 ++ .../api_2_ers_gthd/Test_Api_2_Ers_Gthd.java | 116 ++ .../test/toolkit/api_2_ers_gthd/applet.opt | 4 + .../javacard/api_2_ers_gthd.cap | Bin 0 -> 3076 bytes .../api_2_pah_apda/Api_2_Pah_Apda_1.java | 430 ++++ .../api_2_pah_apda/Test_Api_2_Pah_Apda.java | 101 + .../test/toolkit/api_2_pah_apda/applet.opt | 4 + .../javacard/api_2_pah_apda.cap | Bin 0 -> 4307 bytes .../Api_2_Pah_Aptlb_Bss_1.java | 512 +++++ .../Test_Api_2_Pah_Aptlb_Bss.java | 101 + .../toolkit/api_2_pah_aptlb_bss/applet.opt | 4 + .../javacard/api_2_pah_aptlb_bss.cap | Bin 0 -> 4784 bytes .../Api_2_Pah_Aptlb_Bss_Bss_1.java | 553 +++++ .../Test_Api_2_Pah_Aptlb_Bss_Bss.java | 102 + .../api_2_pah_aptlb_bss_bss/applet.opt | 4 + .../javacard/api_2_pah_aptlb_bss_bss.cap | Bin 0 -> 5484 bytes .../api_2_pah_aptlbb/Api_2_Pah_Aptlbb_1.java | 252 +++ .../Test_Api_2_Pah_Aptlbb.java | 101 + .../test/toolkit/api_2_pah_aptlbb/applet.opt | 4 + .../javacard/api_2_pah_aptlbb.cap | Bin 0 -> 3619 bytes .../Api_2_Pah_Aptlbb_Bss_1.java | 525 +++++ .../Test_Api_2_Pah_Aptlbb_Bss.java | 101 + .../toolkit/api_2_pah_aptlbb_bss/applet.opt | 4 + .../javacard/api_2_pah_aptlbb_bss.cap | Bin 0 -> 4918 bytes .../Api_2_Pah_Aptlbbb_1.java | 249 +++ .../Test_Api_2_Pah_Aptlbbb.java | 100 + .../test/toolkit/api_2_pah_aptlbbb/applet.opt | 4 + .../javacard/api_2_pah_aptlbbb.cap | Bin 0 -> 3629 bytes .../Api_2_Pah_Aptlbbs_1.java | 253 +++ .../Test_Api_2_Pah_Aptlbbs.java | 101 + .../test/toolkit/api_2_pah_aptlbbs/applet.opt | 4 + .../javacard/api_2_pah_aptlbbs.cap | Bin 0 -> 3734 bytes .../api_2_pah_aptlbs/Api_2_Pah_Aptlbs_1.java | 249 +++ .../Test_Api_2_Pah_Aptlbs.java | 101 + .../test/toolkit/api_2_pah_aptlbs/applet.opt | 4 + .../javacard/api_2_pah_aptlbs.cap | Bin 0 -> 3654 bytes .../Api_2_Pah_Aptlbss_1.java | 257 +++ .../Test_Api_2_Pah_Aptlbss.java | 101 + .../test/toolkit/api_2_pah_aptlbss/applet.opt | 4 + .../javacard/api_2_pah_aptlbss.cap | Bin 0 -> 3792 bytes .../api_2_pah_cler/Api_2_Pah_Cler_1.java | 120 ++ .../api_2_pah_cler/Test_Api_2_Pah_Cler.java | 101 + .../test/toolkit/api_2_pah_cler/applet.opt | 4 + .../javacard/api_2_pah_cler.cap | Bin 0 -> 2994 bytes .../api_2_pah_copy/Api_2_Pah_Copy_1.java | 375 ++++ .../api_2_pah_copy/Test_Api_2_Pah_Copy.java | 101 + .../test/toolkit/api_2_pah_copy/applet.opt | 4 + .../javacard/api_2_pah_copy.cap | Bin 0 -> 4059 bytes .../api_2_pah_cprv/Api_2_Pah_Cprv_1.java | 521 +++++ .../api_2_pah_cprv/Test_Api_2_Pah_Cprv.java | 102 + .../test/toolkit/api_2_pah_cprv/applet.opt | 4 + .../javacard/api_2_pah_cprv.cap | Bin 0 -> 4677 bytes .../api_2_pah_cpyv/Api_2_Pah_Cpyv_1.java | 447 ++++ .../api_2_pah_cpyv/Test_Api_2_Pah_Cpyv.java | 101 + .../test/toolkit/api_2_pah_cpyv/applet.opt | 4 + .../javacard/api_2_pah_cpyv.cap | Bin 0 -> 4399 bytes .../Api_2_Pah_Facrb_Bs_1.java | 533 +++++ .../Test_Api_2_Pah_Facrb_Bs.java | 102 + .../toolkit/api_2_pah_facrb_bs/applet.opt | 4 + .../javacard/api_2_pah_facrb_bs.cap | Bin 0 -> 4881 bytes .../Api_2_Pah_Facrbbs_Bss_1.java | 805 +++++++ .../Test_Api_2_Pah_Facrbbs_Bss.java | 102 + .../toolkit/api_2_pah_facrbbs_bss/applet.opt | 4 + .../javacard/api_2_pah_facrbbs_bss.cap | Bin 0 -> 5976 bytes .../Api_2_Pah_Facyb_Bs_1.java | 472 +++++ .../Test_Api_2_Pah_Facyb_Bs.java | 102 + .../toolkit/api_2_pah_facyb_bs/applet.opt | 4 + .../javacard/api_2_pah_facyb_bs.cap | Bin 0 -> 4590 bytes .../Api_2_Pah_Facybbs_Bss_1.java | 660 ++++++ .../Test_Api_2_Pah_Facybbs_Bss.java | 102 + .../toolkit/api_2_pah_facybbs_bss/applet.opt | 4 + .../javacard/api_2_pah_facybbs_bss.cap | Bin 0 -> 5396 bytes .../api_2_pah_find/Api_2_Pah_Find_1.java | 325 +++ .../api_2_pah_find/Test_Api_2_Pah_Find.java | 101 + .../test/toolkit/api_2_pah_find/applet.opt | 4 + .../javacard/api_2_pah_find.cap | Bin 0 -> 3590 bytes .../api_2_pah_gcap/Api_2_Pah_Gcap_1.java | 147 ++ .../api_2_pah_gcap/Test_Api_2_Pah_Gcap.java | 101 + .../test/toolkit/api_2_pah_gcap/applet.opt | 4 + .../javacard/api_2_pah_gcap.cap | Bin 0 -> 3267 bytes .../api_2_pah_glen/Api_2_Pah_Glen_1.java | 162 ++ .../api_2_pah_glen/Test_Api_2_Pah_glen.java | 106 + .../test/toolkit/api_2_pah_glen/applet.opt | 4 + .../javacard/api_2_pah_glen.cap | Bin 0 -> 3247 bytes .../api_2_pah_gvby/Api_2_Pah_Gvby_1.java | 256 +++ .../api_2_pah_gvby/Test_Api_2_Pah_Gvby.java | 101 + .../test/toolkit/api_2_pah_gvby/applet.opt | 4 + .../javacard/api_2_pah_gvby.cap | Bin 0 -> 3537 bytes .../api_2_pah_gvle/Api_2_Pah_Gvle_1.java | 229 ++ .../api_2_pah_gvle/Test_Api_2_Pah_Gvle.java | 101 + .../test/toolkit/api_2_pah_gvle/applet.opt | 4 + .../javacard/api_2_pah_gvle.cap | Bin 0 -> 3451 bytes .../api_2_pah_gvsh/Api_2_Pah_Gvsh_1.java | 257 +++ .../api_2_pah_gvsh/Test_Api_2_Pah_Gvsh.java | 101 + .../test/toolkit/api_2_pah_gvsh/applet.opt | 4 + .../javacard/api_2_pah_gvsh.cap | Bin 0 -> 3456 bytes .../api_2_pah_icch/Api_2_Pah_Icch_1.java | 160 ++ .../api_2_pah_icch/Test_Api_2_Pah_Icch.java | 200 ++ .../test/toolkit/api_2_pah_icch/applet.opt | 4 + .../javacard/api_2_pah_icch.cap | Bin 0 -> 3287 bytes .../api_2_pah_indt/Api_2_Pah_Indt_1.java | 479 +++++ .../api_2_pah_indt/Test_Api_2_Pah_Indt.java | 242 +++ .../test/toolkit/api_2_pah_indt/applet.opt | 4 + .../javacard/api_2_pah_indt.cap | Bin 0 -> 4817 bytes .../api_2_pah_ingk/Api_2_Pah_Ingk_1.java | 479 +++++ .../api_2_pah_ingk/Test_Api_2_Pah_Ingk.java | 242 +++ .../test/toolkit/api_2_pah_ingk/applet.opt | 4 + .../javacard/api_2_pah_ingk.cap | Bin 0 -> 4818 bytes .../api_2_pah_ingp/Api_2_Pah_Ingp_1.java | 472 +++++ .../api_2_pah_ingp/Test_Api_2_Pah_Ingp.java | 245 +++ .../test/toolkit/api_2_pah_ingp/applet.opt | 4 + .../javacard/api_2_pah_ingp.cap | Bin 0 -> 4911 bytes .../api_2_pah_init/Api_2_Pah_Init_1.java | 217 ++ .../api_2_pah_init/Test_Api_2_Pah_Init.java | 112 + .../test/toolkit/api_2_pah_init/applet.opt | 4 + .../javacard/api_2_pah_init.cap | Bin 0 -> 3258 bytes .../api_2_pah_inmt/Api_2_Pah_Inmt_1.java | 116 ++ .../api_2_pah_inmt/Test_Api_2_Pah_Inmt.java | 109 + .../test/toolkit/api_2_pah_inmt/applet.opt | 4 + .../javacard/api_2_pah_inmt.cap | Bin 0 -> 2956 bytes .../api_2_pah_send/Api_2_Pah_Send_1.java | 418 ++++ .../api_2_pah_send/Test_Api_2_Pah_Send.java | 249 +++ .../test/toolkit/api_2_pah_send/applet.opt | 4 + .../javacard/api_2_pah_send.cap | Bin 0 -> 4227 bytes .../api_2_phs_gthd/Api_2_Phs_Gthd_1.java | 125 ++ .../api_2_phs_gthd/Test_Api_2_Phs_Gthd.java | 108 + .../test/toolkit/api_2_phs_gthd/applet.opt | 4 + .../javacard/api_2_phs_gthd.cap | Bin 0 -> 2954 bytes .../api_2_prh_cchd/Api_2_Prh_Cchd_1.java | 356 ++++ .../api_2_prh_cchd/Test_Api_2_Prh_Cchd.java | 171 ++ .../test/toolkit/api_2_prh_cchd/applet.opt | 4 + .../javacard/api_2_prh_cchd.cap | Bin 0 -> 4269 bytes .../api_2_prh_copy/Api_2_Prh_Copy_1.java | 383 ++++ .../api_2_prh_copy/Test_Api_2_Prh_Copy.java | 111 + .../test/toolkit/api_2_prh_copy/applet.opt | 4 + .../javacard/api_2_prh_copy.cap | Bin 0 -> 4213 bytes .../api_2_prh_cpai/Api_2_Prh_Cpai_1.java | 715 +++++++ .../api_2_prh_cpai/Test_Api_2_Prh_Cpai.java | 251 +++ .../test/toolkit/api_2_prh_cpai/applet.opt | 4 + .../javacard/api_2_prh_cpai.cap | Bin 0 -> 5107 bytes .../api_2_prh_cprv/Api_2_Prh_Cprv_1.java | 540 +++++ .../api_2_prh_cprv/Test_Api_2_Prh_Cprv.java | 127 ++ .../test/toolkit/api_2_prh_cprv/applet.opt | 4 + .../javacard/api_2_prh_cprv.cap | Bin 0 -> 4662 bytes .../api_2_prh_cpts/Api_2_Prh_Cpts_1.java | 641 ++++++ .../api_2_prh_cpts/Test_Api_2_Prh_Cpts.java | 253 +++ .../test/toolkit/api_2_prh_cpts/applet.opt | 4 + .../javacard/api_2_prh_cpts.cap | Bin 0 -> 4969 bytes .../api_2_prh_cpyv/Api_2_Prh_Cpyv_1.java | 378 ++++ .../api_2_prh_cpyv/Test_Api_2_Prh_Cpyv.java | 111 + .../test/toolkit/api_2_prh_cpyv/applet.opt | 4 + .../javacard/api_2_prh_cpyv.cap | Bin 0 -> 4413 bytes .../Api_2_Prh_Facrb_Bs_1.java | 495 +++++ .../Test_Api_2_Prh_Facrb_Bs.java | 155 ++ .../toolkit/api_2_prh_facrb_bs/applet.opt | 4 + .../javacard/api_2_prh_facrb_bs.cap | Bin 0 -> 4937 bytes .../Api_2_Prh_Facrbbs_Bss_1.java | 774 +++++++ .../Test_Api_2_Prh_Facrbbs_Bss.java | 169 ++ .../toolkit/api_2_prh_facrbbs_bss/applet.opt | 4 + .../javacard/api_2_prh_facrbbs_bss.cap | Bin 0 -> 6141 bytes .../Api_2_Prh_Facyb_Bs_1.java | 434 ++++ .../Test_Api_2_Prh_Facyb_Bs.java | 155 ++ .../toolkit/api_2_prh_facyb_bs/applet.opt | 4 + .../javacard/api_2_prh_facyb_bs.cap | Bin 0 -> 4405 bytes .../Api_2_Prh_Facybbs_Bss_1.java | 688 ++++++ .../Test_Api_2_Prh_Facybbs_Bss.java | 170 ++ .../toolkit/api_2_prh_facybbs_bss/applet.opt | 4 + .../javacard/api_2_prh_facybbs_bss.cap | Bin 0 -> 5737 bytes .../api_2_prh_find/Api_2_Prh_Find_1.java | 352 ++++ .../api_2_prh_find/Test_Api_2_Prh_Find.java | 111 + .../test/toolkit/api_2_prh_find/applet.opt | 4 + .../javacard/api_2_prh_find.cap | Bin 0 -> 4066 bytes .../api_2_prh_gcap/Api_2_Prh_Gcap_1.java | 117 ++ .../api_2_prh_gcap/Test_Api_2_Prh_Gcap.java | 109 + .../test/toolkit/api_2_prh_gcap/applet.opt | 4 + .../javacard/api_2_prh_gcap.cap | Bin 0 -> 3066 bytes .../api_2_prh_gcid/Api_2_Prh_Gcid_1.java | 223 ++ .../api_2_prh_gcid/Test_Api_2_Prh_Gcid.java | 182 ++ .../test/toolkit/api_2_prh_gcid/applet.opt | 4 + .../javacard/api_2_prh_gcid.cap | Bin 0 -> 3688 bytes .../api_2_prh_gcst/Api_2_Prh_Gcst_1.java | 281 +++ .../api_2_prh_gcst/Test_Api_2_Prh_Gcst.java | 231 +++ .../test/toolkit/api_2_prh_gcst/applet.opt | 4 + .../javacard/api_2_prh_gcst.cap | Bin 0 -> 4203 bytes .../api_2_prh_glen/Api_2_Prh_Glen_1.java | 120 ++ .../api_2_prh_glen/Test_Api_2_Prh_Glen.java | 139 ++ .../test/toolkit/api_2_prh_glen/applet.opt | 4 + .../javacard/api_2_prh_glen.cap | Bin 0 -> 3045 bytes .../api_2_prh_gtcs/Api_2_Prh_Gtcs_1.java | 406 ++++ .../api_2_prh_gtcs/Test_Api_2_Prh_Gtcs.java | 235 +++ .../test/toolkit/api_2_prh_gtcs/applet.opt | 4 + .../javacard/api_2_prh_gtcs.cap | Bin 0 -> 4111 bytes .../api_2_prh_gtgr/Api_2_Prh_Gtgr_1.java | 411 ++++ .../api_2_prh_gtgr/Test_Api_2_Prh_Gtgr.java | 212 ++ .../test/toolkit/api_2_prh_gtgr/applet.opt | 4 + .../javacard/api_2_prh_gtgr.cap | Bin 0 -> 3872 bytes .../api_2_prh_gtii/Api_2_Prh_Gtii_1.java | 349 ++++ .../api_2_prh_gtii/Test_Api_2_Prh_Gtii.java | 181 ++ .../test/toolkit/api_2_prh_gtii/applet.opt | 4 + .../javacard/api_2_prh_gtii.cap | Bin 0 -> 4308 bytes .../api_2_prh_gtil/Api_2_Prh_Gtil_1.java | 418 ++++ .../api_2_prh_gtil/Test_Api_2_Prh_Gtil.java | 243 +++ .../test/toolkit/api_2_prh_gtil/applet.opt | 4 + .../javacard/api_2_prh_gtil.cap | Bin 0 -> 3885 bytes .../api_2_prh_gttl/Api_2_Prh_Gttl_1.java | 423 ++++ .../api_2_prh_gttl/Test_Api_2_Prh_Gttl.java | 235 +++ .../test/toolkit/api_2_prh_gttl/applet.opt | 4 + .../javacard/api_2_prh_gttl.cap | Bin 0 -> 3953 bytes .../api_2_prh_gvby/Api_2_Prh_Gvby_1.java | 263 +++ .../api_2_prh_gvby/Test_Api_2_Prh_Gvby.java | 147 ++ .../test/toolkit/api_2_prh_gvby/applet.opt | 4 + .../javacard/api_2_prh_gvby.cap | Bin 0 -> 3675 bytes .../api_2_prh_gvle/Api_2_Prh_Gvle_1.java | 230 ++ .../api_2_prh_gvle/Test_Api_2_Prh_Gvle.java | 194 ++ .../test/toolkit/api_2_prh_gvle/applet.opt | 4 + .../javacard/api_2_prh_gvle.cap | Bin 0 -> 3539 bytes .../api_2_prh_gvsh/Api_2_Prh_Gvsh_1.java | 270 +++ .../api_2_prh_gvsh/Test_Api_2_Prh_Gvsh.java | 145 ++ .../test/toolkit/api_2_prh_gvsh/applet.opt | 4 + .../javacard/api_2_prh_gvsh.cap | Bin 0 -> 3665 bytes .../api_2_prs_gthd/Api_2_Prs_Gthd_1.java | 124 ++ .../api_2_prs_gthd/Test_Api_2_Prs_Gthd.java | 108 + .../test/toolkit/api_2_prs_gthd/applet.opt | 4 + .../javacard/api_2_prs_gthd.cap | Bin 0 -> 2954 bytes .../Api_2_Tep_Chec_Bss_1.java | 226 ++ .../Test_Api_2_Tep_Chec_Bss.java | 79 + .../toolkit/api_2_tep_chec_bss/applet.opt | 4 + .../javacard/api_2_tep_chec_bss.cap | Bin 0 -> 5248 bytes .../api_2_tep_checb/Api_2_Tep_Checb_1.java | 133 ++ .../api_2_tep_checb/Test_Api_2_Tep_Checb.java | 79 + .../test/toolkit/api_2_tep_checb/applet.opt | 4 + .../javacard/api_2_tep_checb.cap | Bin 0 -> 4326 bytes .../api_2_tep_checs/Api_2_Tep_Checs_1.java | 133 ++ .../api_2_tep_checs/Test_Api_2_Tep_Checs.java | 78 + .../test/toolkit/api_2_tep_checs/applet.opt | 4 + .../javacard/api_2_tep_checs.cap | Bin 0 -> 4327 bytes .../api_2_tep_copy/Api_2_Tep_Copy_1.java | 299 +++ .../api_2_tep_copy/Test_Api_2_Tep_Copy.java | 78 + .../test/toolkit/api_2_tep_copy/applet.opt | 4 + .../javacard/api_2_tep_copy.cap | Bin 0 -> 6283 bytes .../api_2_tep_gval/Api_2_Tep_Gval_1.java | 179 ++ .../api_2_tep_gval/Test_Api_2_Tep_Gval.java | 79 + .../test/toolkit/api_2_tep_gval/applet.opt | 4 + .../javacard/api_2_tep_gval.cap | Bin 0 -> 4815 bytes .../api_2_tke_coor/Api_2_Tke_Coor_1.java | 59 + .../api_2_tke_coor/Test_Api_2_Tke_Coor.java | 86 + .../test/toolkit/api_2_tke_coor/applet.opt | 4 + .../javacard/api_2_tke_coor.cap | Bin 0 -> 3817 bytes .../api_2_tke_thit/Api_2_Tke_Thit_1.java | 149 ++ .../api_2_tke_thit/Test_Api_2_Tke_Thit.java | 86 + .../test/toolkit/api_2_tke_thit/applet.opt | 4 + .../javacard/api_2_tke_thit.cap | Bin 0 -> 4607 bytes .../api_2_tkr_asid/Api_2_Tkr_Asid_1.java | 213 ++ .../api_2_tkr_asid/Api_2_Tkr_Asid_2.java | 104 + .../api_2_tkr_asid/Api_2_Tkr_Asid_3.java | 73 + .../api_2_tkr_asid/Test_Api_2_Tkr_Asid.java | 159 ++ .../test/toolkit/api_2_tkr_asid/applet.opt | 6 + .../javacard/api_2_tkr_asid.cap | Bin 0 -> 4514 bytes .../api_2_tkr_atim/Api_2_Tkr_Atim_1.java | 173 ++ .../api_2_tkr_atim/Api_2_Tkr_Atim_2.java | 122 ++ .../api_2_tkr_atim/Api_2_Tkr_Atim_3.java | 76 + .../api_2_tkr_atim/Test_Api_2_Tkr_Atim.java | 140 ++ .../test/toolkit/api_2_tkr_atim/applet.opt | 6 + .../javacard/api_2_tkr_atim.cap | Bin 0 -> 4310 bytes .../api_2_tkr_cevt/Api_2_Tkr_Cevt_1.java | 231 +++ .../api_2_tkr_cevt/Test_Api_2_Tkr_Cevt.java | 81 + .../test/toolkit/api_2_tkr_cevt/applet.opt | 4 + .../javacard/api_2_tkr_cevt.cap | Bin 0 -> 3629 bytes .../api_2_tkr_cmet/Api_2_Tkr_Cmet_1.java | 742 +++++++ .../api_2_tkr_cmet/Test_Api_2_Tkr_Cmet.java | 164 ++ .../test/toolkit/api_2_tkr_cmet/applet.opt | 4 + .../javacard/api_2_tkr_cmet.cap | Bin 0 -> 4864 bytes .../api_2_tkr_dmet/Api_2_Tkr_Dmet_1.java | 187 ++ .../api_2_tkr_dmet/Test_Api_2_Tkr_Dmet.java | 112 + .../test/toolkit/api_2_tkr_dmet/applet.opt | 4 + .../javacard/api_2_tkr_dmet.cap | Bin 0 -> 3460 bytes .../Api_2_Tkr_Drfes_Bss_Bsb_1.java | 743 +++++++ .../Test_Api_2_Tkr_Drfes_Bss_Bsb.java | 288 +++ .../api_2_tkr_drfes_bss_bsb/applet.opt | 4 + .../javacard/api_2_tkr_drfes_bss_bsb.cap | Bin 0 -> 6751 bytes .../api_2_tkr_drfeso/Api_2_Tkr_Drfeso_1.java | 456 ++++ .../Test_Api_2_Tkr_Drfeso.java | 274 +++ .../test/toolkit/api_2_tkr_drfeso/applet.opt | 4 + .../javacard/api_2_tkr_drfeso.cap | Bin 0 -> 5250 bytes .../api_2_tkr_emet/Api_2_Tkr_Emet_1.java | 212 ++ .../api_2_tkr_emet/Test_Api_2_Tkr_Emet.java | 119 ++ .../test/toolkit/api_2_tkr_emet/applet.opt | 4 + .../javacard/api_2_tkr_emet.cap | Bin 0 -> 3558 bytes .../api_2_tkr_gpol/Api_2_Tkr_Gpol_1.java | 129 ++ .../api_2_tkr_gpol/Test_Api_2_Tkr_Gpol.java | 109 + .../test/toolkit/api_2_tkr_gpol/applet.opt | 4 + .../javacard/api_2_tkr_gpol.cap | Bin 0 -> 3141 bytes .../api_2_tkr_ievs/Api_2_Tkr_Ievs_1.java | 276 +++ .../api_2_tkr_ievs/Api_2_Tkr_Ievs_2.java | 62 + .../api_2_tkr_ievs/Test_Api_2_Tkr_Ievs.java | 93 + .../test/toolkit/api_2_tkr_ievs/applet.opt | 5 + .../javacard/api_2_tkr_ievs.cap | Bin 0 -> 4051 bytes .../api_2_tkr_imet/Api_2_Tkr_Imet_1.java | 476 +++++ .../api_2_tkr_imet/Test_Api_2_Tkr_Imet.java | 118 ++ .../test/toolkit/api_2_tkr_imet/applet.opt | 4 + .../javacard/api_2_tkr_imet.cap | Bin 0 -> 4407 bytes .../Api_2_Tkr_Rgfes_Bss_Bsb_1.java | 875 ++++++++ .../Test_Api_2_Tkr_Rgfes_Bss_Bsb.java | 353 ++++ .../api_2_tkr_rgfes_bss_bsb/applet.opt | 4 + .../javacard/api_2_tkr_rgfes_bss_bsb.cap | Bin 0 -> 6497 bytes .../api_2_tkr_rgfeso/Api_2_Tkr_Rgfeso_1.java | 387 ++++ .../Test_Api_2_Tkr_Rgfeso.java | 302 +++ .../test/toolkit/api_2_tkr_rgfeso/applet.opt | 4 + .../javacard/api_2_tkr_rgfeso.cap | Bin 0 -> 4655 bytes .../api_2_tkr_rpol/Api_2_Tkr_Rpol_1.java | 198 ++ .../api_2_tkr_rpol/Test_Api_2_Tkr_Rpol.java | 96 + .../test/toolkit/api_2_tkr_rpol/applet.opt | 4 + .../javacard/api_2_tkr_rpol.cap | Bin 0 -> 3340 bytes .../api_2_tkr_rsid/Api_2_Tkr_Rsid_1.java | 199 ++ .../api_2_tkr_rsid/Api_2_Tkr_Rsid_2.java | 83 + .../api_2_tkr_rsid/Test_Api_2_Tkr_Rsid.java | 111 + .../test/toolkit/api_2_tkr_rsid/applet.opt | 5 + .../javacard/api_2_tkr_rsid.cap | Bin 0 -> 4047 bytes .../api_2_tkr_rtim/Api_2_Tkr_Rtim_1.java | 214 ++ .../api_2_tkr_rtim/Test_Api_2_Tkr_Rtim.java | 97 + .../test/toolkit/api_2_tkr_rtim/applet.opt | 4 + .../javacard/api_2_tkr_rtim.cap | Bin 0 -> 3436 bytes .../api_2_tkr_sevl/Api_2_Tkr_Sevl_1.java | 493 +++++ .../api_2_tkr_sevl/Api_2_Tkr_Sevl_2.java | 124 ++ .../api_2_tkr_sevl/Test_Api_2_Tkr_Sevl.java | 104 + .../test/toolkit/api_2_tkr_sevl/applet.opt | 5 + .../javacard/api_2_tkr_sevl.cap | Bin 0 -> 4869 bytes .../api_2_tkr_sevt/Api_2_Tkr_Sevt_1.java | 243 +++ .../api_2_tkr_sevt/Api_2_Tkr_Sevt_2.java | 72 + .../api_2_tkr_sevt/Api_2_Tkr_Sevt_3.java | 70 + .../api_2_tkr_sevt/Api_2_Tkr_Sevt_4.java | 92 + .../api_2_tkr_sevt/Test_Api_2_Tkr_Sevt.java | 144 ++ .../test/toolkit/api_2_tkr_sevt/applet.opt | 7 + .../javacard/api_2_tkr_sevt.cap | Bin 0 -> 4554 bytes .../api_2_tkr_smta/Api_2_Tkr_Smta_1.java | 244 +++ .../api_2_tkr_smta/Test_Api_2_Tkr_Smta.java | 108 + .../test/toolkit/api_2_tkr_smta/applet.opt | 4 + .../javacard/api_2_tkr_smta.cap | Bin 0 -> 3702 bytes .../api_2_trs_gety/Api_2_Trs_Gety_1.java | 95 + .../api_2_trs_gety/Test_Api_2_Trs_Gety.java | 74 + .../test/toolkit/api_2_trs_gety/applet.opt | 4 + .../javacard/api_2_trs_gety.cap | Bin 0 -> 2964 bytes 1188 files changed, 131435 insertions(+) create mode 100644 source/Annex_D_Example/uicc/test/example/uicc_example/Test_uicc_example.java create mode 100644 source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass/UiccAPITestCardService.java create mode 100644 source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass/UiccTestModel.java create mode 100644 source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/APDUResponse.java create mode 100644 source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccAdministrativeCommandsService.java create mode 100644 source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccApplicationManagementService.java create mode 100644 source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccCardManagementService.java create mode 100644 source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccToolkitService.java create mode 100644 source/Annex_D_UiccTestUtil/uicc/test/util/LoadUtil.java create mode 100644 source/Annex_D_UiccTestUtil/uicc/test/util/TestToolkitApplet.java create mode 100644 source/Annex_D_UiccTestUtil/uicc/test/util/TestToolkitApplet.opt create mode 100644 source/Annex_D_UiccTestUtil/uicc/test/util/UICCTestConstants.java create mode 100644 source/Annex_D_UiccTestUtil/uicc/test/util/javacard/util.cap create mode 100644 source/Annex_D_UiccTestUtil/uicc/test/util/javacard/util.exp create mode 100644 source/Annex_D_UiccTestUtil/uicc/test/util/javacard/util.jca create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_cont/Api_1_Cont_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_cont/Test_Api_1_Cont.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_cont/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_cont/javacard/api_1_cont.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/Api_1_Fvw_Actf_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/Test_Api_1_Fvw_Actf.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/javacard/api_1_fvw_actf.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/Api_1_Fvw_Dacf_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/Test_Api_1_Fvw_Dacf.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/javacard/api_1_fvw_dacf.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/Api_1_Fvw_Incr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/Test_Api_1_Fvw_Incr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/javacard/api_1_fvw_incr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/Api_1_Fvw_Redb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/Test_Api_1_Fvw_Redb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/javacard/api_1_fvw_redb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/Api_1_Fvw_Redr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/Test_Api_1_Fvw_Redr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/javacard/api_1_fvw_redr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/Api_1_Fvw_Sear_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/Test_Api_1_Fvw_Sear.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/javacard/api_1_fvw_sear.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb/Api_1_Fvw_Slctb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb/Test_Api_1_Fvw_Slctb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb/javacard/api_1_fvw_slctb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/Api_1_Fvw_Slctb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/Test_Api_1_Fvw_Slctb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/javacard/api_1_fvw_slctb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slcts/Api_1_Fvw_Slcts_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slcts/Test_Api_1_Fvw_Slcts.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slcts/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slcts/javacard/api_1_fvw_slcts.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/Api_1_Fvw_Stat_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/Test_Api_1_Fvw_Stat.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/javacard/api_1_fvw_stat.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/Api_1_Fvw_Updb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/Test_Api_1_Fvw_Updb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/javacard/api_1_fvw_updb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/Api_1_Fvw_Updr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/Test_Api_1_Fvw_Updr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/javacard/api_1_fvw_updr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_uex_coor/Api_1_Uex_Coor_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_uex_coor/Test_Api_1_Uex_Coor.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_uex_coor/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_uex_coor/javacard/api_1_uex_coor.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/Api_1_Uex_Thit_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/Test_Api_1_Uex_Thit.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/javacard/api_1_uex_thit.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/Api_1_Usy_Getf_Bsbb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/Test_Api_1_Usy_Getf_Bsbb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/javacard/api_1_usy_getf_bsbb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/Api_1_Usy_Getfb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/Test_Api_1_Usy_Getfb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/javacard/api_1_usy_getfb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/Api_1_Usy_Getfob_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/Test_Api_1_Usy_Getfob.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/javacard/api_1_usy_getfob.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/Api_4_Aex_Coor_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/Test_Api_4_Aex_Coor.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/javacard/api_4_aex_coor.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/Api_4_Aex_Thit_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/Test_Api_4_Aex_Thit.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/javacard/api_4_aex_thit.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/Api_4_Afb_Gtaf_Bsbb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/Test_Api_4_Afb_Gtaf_Bsbb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/javacard/api_4_afb_gtaf_bsbb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/Api_4_Afb_Gtafb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/Test_Api_4_Afb_Gtafb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/javacard/api_4_afb_gtafb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/Api_4_Afb_Gtafob_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/Test_Api_4_Afb_Gtafob.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/javacard/api_4_afb_gtafob.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_actf/Api_4_Afv_Actf_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_actf/Test_Api_4_Afv_Actf.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_actf/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_actf/javacard/api_4_afv_actf.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_crtf/Api_4_Afv_Crtf_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_crtf/Test_Api_4_Afv_Crtf.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_crtf/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_crtf/javacard/api_4_afv_crtf.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/Api_4_Afv_Dacf_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/Test_Api_4_Afv_Dacf.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/javacard/api_4_afv_dacf.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dltf/Api_4_Afv_Dltf_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dltf/Test_Api_4_Afv_Dltf.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dltf/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dltf/javacard/api_4_afv_dltf.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/Api_4_Afv_Incr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/Test_Api_4_Afv_Incr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/javacard/api_4_afv_incr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/Api_4_Afv_Redb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/Test_Api_4_Afv_Redb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/javacard/api_4_afv_redb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/Api_4_Afv_Redr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/Test_Api_4_Afv_Redr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/javacard/api_4_afv_redr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/Api_4_Afv_Rszf_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/Test_Api_4_Afv_Rszf.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/javacard/api_4_afv_rszf.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/Api_4_Afv_Sear_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/Test_Api_4_Afv_Sear.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/javacard/api_4_afv_sear.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb/Api_4_Afv_Slctb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb/Test_Api_4_Afv_Slctb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb/javacard/api_4_afv_slctb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/Api_4_Afv_Slctb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/Test_Api_4_Afv_Slctb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/javacard/api_4_afv_slctb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/Api_4_Afv_Slcts_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/Test_Api_4_Afv_Slcts.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/javacard/api_4_afv_slcts.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/Api_4_Afv_Stat_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/Test_Api_4_Afv_Stat.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/javacard/api_4_afv_stat.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/Api_4_Afv_Updb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/Test_Api_4_Afv_Updb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/javacard/api_4_afv_updb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/Api_4_Afv_Updr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/Test_Api_4_Afv_Updr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/javacard/api_4_afv_updr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/Cre_Api_Hepo_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/Test_Cre_Api_Hepo.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/javacard/cre_api_hepo.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/Cre_Api_Tmid_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/Test_Cre_Api_Tmid.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/javacard/cre_api_tmid.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tran/Cre_Api_Tran_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tran/Cre_Api_Tran_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tran/Test_Cre_Api_Tran.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tran/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_api_tran/javacard/cre_api_tran.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/Cre_Apt_Eade_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/Test_Cre_Apt_Eade.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/javacard/cre_apt_eade.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eccn/Cre_Apt_Eccn_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eccn/Cre_Apt_Eccn_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eccn/Test_Cre_Apt_Eccn.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eccn/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eccn/javacard/cre_apt_eccn.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edat/Cre_Apt_Edat_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edat/Test_Cre_Apt_Edat.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edat/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edat/javacard/cre_apt_edat.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/Cre_Apt_Edbs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/Test_Cre_Apt_Edbs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/javacard/cre_apt_edbs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbt/Cre_Apt_Edbt_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbt/Test_Cre_Apt_Edbt.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbt/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbt/javacard/cre_apt_edbt.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcc/Cre_Apt_Edcc_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcc/Test_Cre_Apt_Edcc.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcc/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcc/javacard/cre_apt_edcc.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/Cre_Apt_Edcd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/Test_Cre_Apt_Edcd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/javacard/cre_apt_edcd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcr/Cre_Apt_Edcr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcr/Test_Cre_Apt_Edcr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcr/javacard/cre_apt_edcr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/Cre_Apt_Edcs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/Test_Cre_Apt_Edcs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/javacard/cre_apt_edcs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/Cre_Apt_Edda_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/Test_Cre_Apt_Edda.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/javacard/cre_apt_edda.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eddp/Cre_Apt_Eddp_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eddp/Test_Cre_Apt_Eddp.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eddp/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eddp/javacard/cre_apt_eddp.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/Cre_Apt_Edis_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/Test_Cre_Apt_Edis.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/javacard/cre_apt_edis.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edlc/Cre_Apt_Edlc_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edlc/Test_Cre_Apt_Edlc.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edlc/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edlc/javacard/cre_apt_edlc.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edlg/Cre_Apt_Edlg_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edlg/Test_Cre_Apt_Edlg.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edlg/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edlg/javacard/cre_apt_edlg.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edls/Cre_Apt_Edls_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edls/Test_Cre_Apt_Edls.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edls/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edls/javacard/cre_apt_edls.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edmc/Cre_Apt_Edmc_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edmc/Test_Cre_Apt_Edmc.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edmc/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edmc/javacard/cre_apt_edmc.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edns/Cre_Apt_Edns_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edns/Test_Cre_Apt_Edns.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edns/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edns/javacard/cre_apt_edns.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/Cre_Apt_Edua_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/Test_Cre_Apt_Edua.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/javacard/cre_apt_edua.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eefu/Cre_Apt_Eefu_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eefu/Test_Cre_Apt_Eefu.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eefu/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eefu/javacard/cre_apt_eefu.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_efca/Cre_Apt_Efca_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_efca/Cre_Apt_Efca_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_efca/Cre_Apt_Efca_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_efca/Cre_Apt_Efca_4.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_efca/Cre_Apt_Efca_5.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_efca/Test_Cre_Apt_Efca.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_efca/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_efca/javacard/cre_apt_efca.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emse/Cre_Apt_Emse_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emse/Cre_Apt_Emse_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emse/Test_Cre_Apt_Emse.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emse/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emse/javacard/cre_apt_emse.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Test_Cre_Apt_Emsh.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/javacard/cre_apt_emsh.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Test_Cre_Apt_Epdw.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/javacard/cre_apt_epdw.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Cre_Apt_Epha_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Cre_Apt_Epha_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Test_Cre_Apt_Epha.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/javacard/cre_apt_epha.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_estc/Cre_Apt_Estc_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_estc/Cre_Apt_Estc_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_estc/Cre_Apt_Estc_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_estc/Test_Cre_Apt_Estc.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_estc/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_estc/javacard/cre_apt_estc.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/Cre_Apt_Etex_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/Test_Cre_Apt_Etex.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/javacard/cre_apt_etex.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/Cre_Apt_Euev_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/Test_Cre_Apt_Euev.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/javacard/cre_apt_euev.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/Cre_Apt_Genb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/Test_Cre_Apt_Genb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/javacard/cre_apt_genb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_eccn/Cre_Erp_Eccn_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_eccn/Cre_Erp_Eccn_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_eccn/Cre_Erp_Eccn_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_eccn/Test_Cre_Erp_Eccn.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_eccn/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_eccn/javacard/cre_erp_eccn.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_euen/Cre_Erp_Euen_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_euen/Test_Cre_Erp_Euen.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_euen/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_erp_euen/javacard/cre_erp_euen.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_genb/Cre_Exh_Genb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_genb/Cre_Exh_Genb_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_genb/Test_Cre_Exh_Genb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_genb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_genb/javacard/cre_exh_genb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Cre_Exh_Imtg_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Cre_Exh_Imtg_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Test_Cre_Exh_Imtg.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/javacard/cre_exh_imtg.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_enhd/Cre_Hin_Enhd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_enhd/Test_Cre_Hin_Enhd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_enhd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_enhd/javacard/cre_hin_enhd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/Cre_Hin_Erhd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/Test_Cre_Hin_Erhd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/javacard/cre_hin_erhd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_pahd/Cre_Hin_Pahd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_pahd/Cre_Hin_Pahd_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_pahd/Test_Cre_Hin_Pahd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_pahd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_pahd/javacard/cre_hin_pahd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_prhd/Cre_Hin_Prhd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_prhd/Test_Cre_Hin_Prhd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_prhd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_hin_prhd/javacard/cre_hin_prhd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Test_Cre_Mha_Enhd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/javacard/cre_mha_enhd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Test_Cre_Mha_Erhd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/javacard/cre_mha_erhd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Test_Cre_Mha_Pahd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/javacard/cre_mha_pahd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Test_Cre_Mha_Prhd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/javacard/cre_mha_prhd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/Cre_Pcs_Igco_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/Test_Cre_Pcs_Igco.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/javacard/cre_pcs_igco.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_pcco/Cre_Pcs_Pcco_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_pcco/Cre_Pcs_Pcco_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_pcco/Cre_Pcs_Pcco_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_pcco/Test_Cre_Pcs_Pcco.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_pcco/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_pcco/javacard/cre_pcs_pcco.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Test_Cre_Pcs_Spco.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/javacard/cre_pcs_spco.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Cre_Reg_Evtr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Cre_Reg_Evtr_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Test_Cre_Reg_Evtr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/javacard/cre_reg_evtr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_4.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_5.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_6.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_7.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_8.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Test_Cre_Tin_Acdo.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/javacard/cre_tin_acdo.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_chal/Cre_Tin_Chal_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_chal/Cre_Tin_Chal_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_chal/Cre_Tin_Chal_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_chal/Test_Cre_Tin_Chal.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_chal/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_chal/javacard/cre_tin_chal.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_genb/Cre_Tin_Genb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_genb/Cre_Tin_Genb_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_genb/Test_Cre_Tin_Genb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_genb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_genb/javacard/cre_tin_genb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Test_Cre_Tin_Itid.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/javacard/cre_tin_itid.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_4.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_5.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_6.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Test_Cre_Tin_Itpo.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/javacard/cre_tin_itpo.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/Cre_Tin_Mlme_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/Test_Cre_Tin_Mlme.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/javacard/cre_tin_mlme.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/Cre_Tin_Nbme_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/Cre_Tin_Nbme_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/Test_Cre_Tin_Nbme.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/javacard/cre_tin_nbme.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/Cre_Tin_Prlv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/Test_Cre_Tin_Prlv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/javacard/cre_tin_prlv_1.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/Cre_Tin_Prlv_10.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/Test_Cre_Tin_Prlv_10.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/Cre_Tin_Prlv_10A.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/javacard/cre_tin_prlv_10a.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10b/Cre_Tin_Prlv_10B.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10b/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10b/javacard/cre_tin_prlv_10b.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/javacard/cre_tin_prlv_10.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/Cre_Tin_Prlv_11.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/Test_Cre_Tin_Prlv_11.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/javacard/cre_tin_prlv_11.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/Cre_Tin_Prlv_12.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/Test_Cre_Tin_Prlv_12.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/javacard/cre_tin_prlv_12.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/Cre_Tin_Prlv_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/Test_Cre_Tin_Prlv_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/javacard/cre_tin_prlv_2.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_3/Cre_Tin_Prlv_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_3/Test_Cre_Tin_Prlv_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_3/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_3/javacard/cre_tin_prlv_3.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_4/Cre_Tin_Prlv_4.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_4/Test_Cre_Tin_Prlv_4.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_4/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_4/javacard/cre_tin_prlv_4.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/Cre_Tin_Prlv_5.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/Test_Cre_Tin_Prlv_5.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/javacard/cre_tin_prlv_5.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/Cre_Tin_Prlv_6.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/Test_Cre_Tin_Prlv_6.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/javacard/cre_tin_prlv_6.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/Cre_Tin_Prlv_7.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/Test_Cre_Tin_Prlv_7.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/javacard/cre_tin_prlv_7.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/Cre_Tin_Prlv_8.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/Test_Cre_Tin_Prlv_8.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/cre_tin_prlv_8a/Cre_Tin_Prlv_8A.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/cre_tin_prlv_8a/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/cre_tin_prlv_8a/javacard/cre_tin_prlv_8a.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/cre_tin_prlv_8b/Cre_Tin_Prlv_8B.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/cre_tin_prlv_8b/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/cre_tin_prlv_8b/javacard/cre_tin_prlv_8b.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/javacard/cre_tin_prlv_8.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/Cre_Tin_Prlv_9.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/Test_Cre_Tin_Prlv_9.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/Cre_Tin_Prlv_9A.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/javacard/cre_tin_prlv_9a.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/Cre_Tin_Prlv_9B.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/javacard/cre_tin_prlv_9b.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/javacard/cre_tin_prlv_9.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/Cre_Tin_Sval_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/Cre_Tin_Sval_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/Cre_Tin_Sval_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/Test_Cre_Tin_Sval.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/javacard/cre_tin_sval.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Cre_Tin_Tarv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Cre_Tin_Tarv_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Test_Cre_Tin_Tarv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/javacard/cre_tin_tarv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Test_Cre_Tin_Tmal.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/javacard/cre_tin_tmal.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_ufa_view/Cre_Ufa_View_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_ufa_view/Cre_Ufa_View_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_ufa_view/Test_Cre_Ufa_View.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_ufa_view/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_ufa_view/javacard/cre_ufa_view.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/Test_Cre_Uta_Adel.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/javacard/cre_uta_adel_a.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_b/Cre_Uta_Adel_B_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_b/Cre_Uta_Adel_B_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_b/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_b/javacard/cre_uta_adel_b.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/Test_Cre_Uta_Dafs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/javacard/cre_uta_dafs_a.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_b/Cre_Uta_Dafs_B_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_b/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_b/javacard/cre_uta_dafs_b.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/Cre_Uta_Odel_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/Test_Cre_Uta_Odel.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/javacard/cre_uta_odel.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/Test_Cre_Uta_Pdel.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_a/Cre_Uta_Pdel_A_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_a/Cre_Uta_Pdel_A_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_a/Cre_Uta_Pdel_A_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_a/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_a/javacard/cre_uta_pdel_a.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/Cre_Uta_Pdel_B_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/Cre_Uta_Pdel_B_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/javacard/cre_uta_pdel_b.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/Api_3_Hbd_Bthdbs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/Test_Api_3_Hbd_Bthdbs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/javacard/api_3_hbd_bthdbs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/Api_3_Hbd_Bthdbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/Test_Api_3_Hbd_Bthdbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/javacard/api_3_hbd_bthdbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Api_3_Upf_Gvba_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Api_ShareableInterface.java create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Test_Api_3_Upf_Gvba.java create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/Api_GetShareableClientApplet.java create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/javacard/api_3_upf_gvba2.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/javacard/api_3_upf_gvba.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/Api_2_Bte_Apda_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/Test_Api_2_Bte_Apda.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/javacard/api_2_bte_apda.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/Api_2_Bte_Aptlb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/Test_Api_2_Bte_Aptlb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/javacard/api_2_bte_aptlb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/Api_2_Bte_Aptlb_Bss_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/Test_Api_2_Bte_Aptlb_Bss_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/javacard/api_2_bte_aptlb_bss_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb/Api_2_Bte_Aptlbb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb/Test_Api_2_Bte_Aptlbb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb/javacard/api_2_bte_aptlbb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/Api_2_Bte_Aptlbb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/Test_Api_2_Bte_Aptlbb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/javacard/api_2_bte_aptlbb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbb/Api_2_Bte_Aptlbbb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbb/Test_Api_2_Bte_Aptlbbb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbb/javacard/api_2_bte_aptlbbb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/Api_2_Bte_Aptlbbs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/Test_Api_2_Bte_Aptlbbs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/javacard/api_2_bte_aptlbbs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/Api_2_Bte_Aptlbs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/Test_Api_2_Bte_Aptlbs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/javacard/api_2_bte_aptlbs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/Api_2_Bte_Aptlbss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/Test_Api_2_Bte_Aptlbss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/javacard/api_2_bte_aptlbss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/Api_2_Bte_Cler_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/Test_Api_2_Bte_Cler.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/javacard/api_2_bte_cler.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/Api_2_Bte_Copy_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/Test_Api_2_Bte_Copy.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/javacard/api_2_bte_copy.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/Api_2_Bte_Cprv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/Test_Api_2_Bte_Cprv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/javacard/api_2_bte_cprv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/Api_2_Bte_Cpyv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/Test_Api_2_Bte_Cpyv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/javacard/api_2_bte_cpyv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/Api_2_Bte_Facrb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/Test_Api_2_Bte_Facrb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/javacard/api_2_bte_facrb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/Api_2_Bte_Facrbbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/Test_Api_2_Bte_Facrbbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/javacard/api_2_bte_facrbbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/Api_2_Bte_Facyb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/Test_Api_2_Bte_Facyb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/javacard/api_2_bte_facyb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/Api_2_Bte_Facybbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/Test_Api_2_Bte_Facybbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/javacard/api_2_bte_facybbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/Api_2_Bte_Find_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/Test_Api_2_Bte_Find.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/javacard/api_2_bte_find.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/Api_2_Bte_Gcap_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/Test_Api_2_Bte_Gcap.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/javacard/api_2_bte_gcap.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_glen/Api_2_Bte_Glen_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_glen/Test_Api_2_Bte_Glen.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_glen/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_glen/javacard/api_2_bte_glen.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/Api_2_Bte_Gtsz_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/Test_Api_2_Bte_Gtsz.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/javacard/api_2_bte_gtsz.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/Api_2_Bte_Gvby_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/Test_Api_2_Bte_Gvby.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/javacard/api_2_bte_gvby.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/Api_2_Bte_Gvle_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/Test_Api_2_Bte_Gvle.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/javacard/api_2_bte_gvle.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/Api_2_Bte_Gvsh_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/Test_Api_2_Bte_Gvsh.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/javacard/api_2_bte_gvsh.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_sttg/Api_2_Bte_Sttg_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_sttg/Test_Api_2_Bte_Sttg.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_sttg/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_sttg/javacard/api_2_bte_sttg.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/Api_2_Ehs_Gthd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/Test_Api_2_Ehs_Gthd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/javacard/api_2_ehs_gthd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/Api_2_Enh_Copy_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/Test_Api_2_Enh_Copy.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/javacard/api_2_enh_copy.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/Api_2_Enh_Cprv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/Test_Api_2_Enh_Cprv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/javacard/api_2_enh_cprv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/Api_2_Enh_Cpyv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/Test_Api_2_Enh_Cpyv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/javacard/api_2_enh_cpyv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/Api_2_Enh_Facrb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/Test_Api_2_Enh_Facrb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/javacard/api_2_enh_facrb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/Api_2_Enh_Facrbbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/Test_Api_2_Enh_Facrbbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/javacard/api_2_enh_facrbbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/Api_2_Enh_Facyb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/Test_Api_2_Enh_Facyb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/javacard/api_2_enh_facyb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/Api_2_Enh_Facyb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/Test_Api_2_Enh_Facyb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/javacard/api_2_enh_facyb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_find/Api_2_Enh_Find_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_find/Test_Api_2_Enh_Find.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_find/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_find/javacard/api_2_enh_find.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/Api_2_Enh_Gcap_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/Test_Api_2_Enh_Gcap.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/javacard/api_2_enh_gcap.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/Api_2_Enh_Gcid_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/Test_Api_2_Enh_Gcid.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/javacard/api_2_enh_gcid.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/Api_2_Enh_Gcst_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/Test_Api_2_Enh_Gcst.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/javacard/Api_2_Enh_Gcst.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/Api_2_Enh_Giid_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/Test_Api_2_Enh_Giid.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/javacard/api_2_enh_giid.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_glen/Api_2_Enh_Glen_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_glen/Test_Api_2_Enh_Glen.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_glen/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_glen/javacard/Api_2_Enh_Glen.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/Api_2_Enh_Gtsz_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/Test_Api_2_Enh_Gtsz.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/javacard/api_2_enh_gtsz.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gttg/Api_2_Enh_Gttg_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gttg/Test_Api_2_Enh_Gttg.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gttg/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gttg/javacard/api_2_enh_gttg.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/Api_2_Enh_Gvby_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/Test_Api_2_Enh_Gvby.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/javacard/api_2_enh_gvby.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvle/Api_2_Enh_Gvle_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvle/Test_Api_2_Enh_Gvle.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvle/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvle/javacard/api_2_enh_gvle.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvsh/Api_2_Enh_Gvsh_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvsh/Test_Api_2_Enh_Gvsh.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvsh/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvsh/javacard/api_2_enh_gvsh.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/Api_2_Erh_Apda_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/Test_Api_2_Erh_Apda_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/javacard/api_2_erh_apda_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/Api_2_Erh_Aptlb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/Test_Api_2_Erh_Aptlb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/javacard/api_2_erh_aptlb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/Api_2_Erh_Aptlb_Bss_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/Test_Api_2_Erh_Aptlb_Bss_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/javacard/api_2_erh_aptlb_bss_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/Api_2_Erh_Aptlbb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/Test_Api_2_Erh_Aptlbb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/javacard/api_2_erh_aptlbb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/Api_2_Erh_Aptlbb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/Test_Api_2_Erh_Aptlbb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/javacard/api_2_erh_aptlbb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/Api_2_Erh_Aptlbbb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/Test_Api_2_Erh_Aptlbbb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/javacard/api_2_erh_aptlbbb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/Api_2_Erh_Aptlbbs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/Test_Api_2_Erh_Aptlbbs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/javacard/api_2_erh_aptlbbs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/Api_2_Erh_Aptlbs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/Test_Api_2_Erh_Aptlbs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/javacard/api_2_erh_aptlbs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/Api_2_Erh_Aptlbss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/Test_Api_2_Erh_Aptlbss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/javacard/api_2_erh_aptlbss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cler/Api_2_Erh_Cler_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cler/Test_Api_2_Erh_Cler.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cler/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cler/javacard/api_2_erh_cler.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/Api_2_Erh_Copy_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/Test_Api_2_Erh_Copy.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/javacard/api_2_erh_copy.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/Api_2_Erh_Cprv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/Test_Api_2_Erh_Cprv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/javacard/api_2_erh_cprv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/Api_2_Erh_Cpyv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/Test_Api_2_Erh_Cpyv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/javacard/api_2_erh_cpyv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/Api_2_Erh_Facrb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/Test_Api_2_Erh_Facrb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/javacard/api_2_erh_facrb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/Api_2_Erh_Facrbbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/Test_Api_2_Erh_Facrbbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/javacard/api_2_erh_facrbbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/Api_2_Erh_Facyb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/Test_Api_2_Erh_Facyb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/javacard/api_2_erh_facyb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/Api_2_Erh_Facybbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/Test_Api_2_Erh_Facybbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/javacard/api_2_erh_facybbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/Api_2_Erh_Find_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/Test_Api_2_Erh_Find.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/javacard/api_2_erh_find.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/Api_2_Erh_Gcap_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/Test_Api_2_Erh_Gcap.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/javacard/api_2_erh_gcap.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/Api_2_Erh_Glen_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/Test_Api_2_Erh_Glen.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/javacard/api_2_erh_glen.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/Api_2_Erh_Gvby_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/Test_Api_2_Erh_Gvby.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/javacard/api_2_erh_gvby.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/Api_2_Erh_Gvle_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/Test_Api_2_Erh_Gvle.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/javacard/api_2_erh_gvle.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/Api_2_Erh_Gvsh_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/Test_Api_2_Erh_Gvsh.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/javacard/api_2_erh_gvsh.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/Api_2_Erh_Poab_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/Test_Api_2_Erh_Poab.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/javacard/api_2_erh_poab.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/Api_2_Erh_Post_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/Test_Api_2_Erh_Post.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/javacard/api_2_erh_post.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/Api_2_Ers_Gthd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/Test_Api_2_Ers_Gthd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/javacard/api_2_ers_gthd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/Api_2_Pah_Apda_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/Test_Api_2_Pah_Apda.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/javacard/api_2_pah_apda.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/Api_2_Pah_Aptlb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/Test_Api_2_Pah_Aptlb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/javacard/api_2_pah_aptlb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/Api_2_Pah_Aptlb_Bss_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/Test_Api_2_Pah_Aptlb_Bss_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/javacard/api_2_pah_aptlb_bss_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb/Api_2_Pah_Aptlbb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb/Test_Api_2_Pah_Aptlbb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb/javacard/api_2_pah_aptlbb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/Api_2_Pah_Aptlbb_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/Test_Api_2_Pah_Aptlbb_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/javacard/api_2_pah_aptlbb_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/Api_2_Pah_Aptlbbb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/Test_Api_2_Pah_Aptlbbb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/javacard/api_2_pah_aptlbbb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/Api_2_Pah_Aptlbbs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/Test_Api_2_Pah_Aptlbbs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/javacard/api_2_pah_aptlbbs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/Api_2_Pah_Aptlbs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/Test_Api_2_Pah_Aptlbs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/javacard/api_2_pah_aptlbs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/Api_2_Pah_Aptlbss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/Test_Api_2_Pah_Aptlbss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/javacard/api_2_pah_aptlbss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/Api_2_Pah_Cler_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/Test_Api_2_Pah_Cler.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/javacard/api_2_pah_cler.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/Api_2_Pah_Copy_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/Test_Api_2_Pah_Copy.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/javacard/api_2_pah_copy.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cprv/Api_2_Pah_Cprv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cprv/Test_Api_2_Pah_Cprv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cprv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cprv/javacard/api_2_pah_cprv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cpyv/Api_2_Pah_Cpyv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cpyv/Test_Api_2_Pah_Cpyv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cpyv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cpyv/javacard/api_2_pah_cpyv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrb_bs/Api_2_Pah_Facrb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrb_bs/Test_Api_2_Pah_Facrb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrb_bs/javacard/api_2_pah_facrb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrbbs_bss/Api_2_Pah_Facrbbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrbbs_bss/Test_Api_2_Pah_Facrbbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrbbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrbbs_bss/javacard/api_2_pah_facrbbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facyb_bs/Api_2_Pah_Facyb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facyb_bs/Test_Api_2_Pah_Facyb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facyb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facyb_bs/javacard/api_2_pah_facyb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facybbs_bss/Api_2_Pah_Facybbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facybbs_bss/Test_Api_2_Pah_Facybbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facybbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facybbs_bss/javacard/api_2_pah_facybbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/Api_2_Pah_Find_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/Test_Api_2_Pah_Find.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/javacard/api_2_pah_find.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/Api_2_Pah_Gcap_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/Test_Api_2_Pah_Gcap.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/javacard/api_2_pah_gcap.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_glen/Api_2_Pah_Glen_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_glen/Test_Api_2_Pah_glen.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_glen/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_glen/javacard/api_2_pah_glen.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvby/Api_2_Pah_Gvby_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvby/Test_Api_2_Pah_Gvby.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvby/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvby/javacard/api_2_pah_gvby.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvle/Api_2_Pah_Gvle_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvle/Test_Api_2_Pah_Gvle.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvle/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvle/javacard/api_2_pah_gvle.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/Api_2_Pah_Gvsh_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/Test_Api_2_Pah_Gvsh.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/javacard/api_2_pah_gvsh.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/Api_2_Pah_Icch_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/Test_Api_2_Pah_Icch.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/javacard/api_2_pah_icch.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/Api_2_Pah_Indt_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/Test_Api_2_Pah_Indt.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/javacard/api_2_pah_indt.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/Api_2_Pah_Ingk_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/Test_Api_2_Pah_Ingk.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/javacard/api_2_pah_ingk.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/Api_2_Pah_Ingp_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/Test_Api_2_Pah_Ingp.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/javacard/api_2_pah_ingp.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/Api_2_Pah_Init_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/Test_Api_2_Pah_Init.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/javacard/api_2_pah_init.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/Api_2_Pah_Inmt_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/Test_Api_2_Pah_Inmt.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/javacard/api_2_pah_inmt.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/Api_2_Pah_Send_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/Test_Api_2_Pah_Send.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/javacard/api_2_pah_send.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/Api_2_Phs_Gthd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/Test_Api_2_Phs_Gthd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/javacard/api_2_phs_gthd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cchd/Api_2_Prh_Cchd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cchd/Test_Api_2_Prh_Cchd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cchd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cchd/javacard/api_2_prh_cchd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/Api_2_Prh_Copy_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/Test_Api_2_Prh_Copy.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/javacard/api_2_prh_copy.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/Api_2_Prh_Cpai_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/Test_Api_2_Prh_Cpai.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/javacard/api_2_prh_cpai.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cprv/Api_2_Prh_Cprv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cprv/Test_Api_2_Prh_Cprv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cprv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cprv/javacard/api_2_prh_cprv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/Api_2_Prh_Cpts_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/Test_Api_2_Prh_Cpts.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/javacard/api_2_prh_cpts.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/Api_2_Prh_Cpyv_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/Test_Api_2_Prh_Cpyv.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/javacard/api_2_prh_cpyv.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrb_bs/Api_2_Prh_Facrb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrb_bs/Test_Api_2_Prh_Facrb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrb_bs/javacard/api_2_prh_facrb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrbbs_bss/Api_2_Prh_Facrbbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrbbs_bss/Test_Api_2_Prh_Facrbbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrbbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrbbs_bss/javacard/api_2_prh_facrbbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facyb_bs/Api_2_Prh_Facyb_Bs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facyb_bs/Test_Api_2_Prh_Facyb_Bs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facyb_bs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facyb_bs/javacard/api_2_prh_facyb_bs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facybbs_bss/Api_2_Prh_Facybbs_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facybbs_bss/Test_Api_2_Prh_Facybbs_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facybbs_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facybbs_bss/javacard/api_2_prh_facybbs_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_find/Api_2_Prh_Find_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_find/Test_Api_2_Prh_Find.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_find/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_find/javacard/api_2_prh_find.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/Api_2_Prh_Gcap_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/Test_Api_2_Prh_Gcap.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/javacard/api_2_prh_gcap.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/Api_2_Prh_Gcid_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/Test_Api_2_Prh_Gcid.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/javacard/api_2_prh_gcid.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/Api_2_Prh_Gcst_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/Test_Api_2_Prh_Gcst.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/javacard/api_2_prh_gcst.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/Api_2_Prh_Glen_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/Test_Api_2_Prh_Glen.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/javacard/api_2_prh_glen.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/Api_2_Prh_Gtcs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/Test_Api_2_Prh_Gtcs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/javacard/api_2_prh_gtcs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtgr/Api_2_Prh_Gtgr_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtgr/Test_Api_2_Prh_Gtgr.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtgr/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtgr/javacard/api_2_prh_gtgr.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/Api_2_Prh_Gtii_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/Test_Api_2_Prh_Gtii.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/javacard/api_2_prh_gtii.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/Api_2_Prh_Gtil_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/Test_Api_2_Prh_Gtil.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/javacard/api_2_prh_gtil.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/Api_2_Prh_Gttl_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/Test_Api_2_Prh_Gttl.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/javacard/api_2_prh_gttl.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/Api_2_Prh_Gvby_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/Test_Api_2_Prh_Gvby.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/javacard/api_2_prh_gvby.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvle/Api_2_Prh_Gvle_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvle/Test_Api_2_Prh_Gvle.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvle/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvle/javacard/api_2_prh_gvle.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/Api_2_Prh_Gvsh_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/Test_Api_2_Prh_Gvsh.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/javacard/api_2_prh_gvsh.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prs_gthd/Api_2_Prs_Gthd_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prs_gthd/Test_Api_2_Prs_Gthd.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prs_gthd/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prs_gthd/javacard/api_2_prs_gthd.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/Api_2_Tep_Chec_Bss_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/Test_Api_2_Tep_Chec_Bss.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/javacard/api_2_tep_chec_bss.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/Api_2_Tep_Checb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/Test_Api_2_Tep_Checb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/javacard/api_2_tep_checb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/Api_2_Tep_Checs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/Test_Api_2_Tep_Checs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/javacard/api_2_tep_checs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_copy/Api_2_Tep_Copy_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_copy/Test_Api_2_Tep_Copy.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_copy/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_copy/javacard/api_2_tep_copy.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/Api_2_Tep_Gval_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/Test_Api_2_Tep_Gval.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/javacard/api_2_tep_gval.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_coor/Api_2_Tke_Coor_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_coor/Test_Api_2_Tke_Coor.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_coor/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_coor/javacard/api_2_tke_coor.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/Api_2_Tke_Thit_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/Test_Api_2_Tke_Thit.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/javacard/api_2_tke_thit.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Test_Api_2_Tkr_Asid.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/javacard/api_2_tkr_asid.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Test_Api_2_Tkr_Atim.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/javacard/api_2_tkr_atim.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/Api_2_Tkr_Cevt_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/Test_Api_2_Tkr_Cevt.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/javacard/api_2_tkr_cevt.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cmet/Api_2_Tkr_Cmet_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cmet/Test_Api_2_Tkr_Cmet.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cmet/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cmet/javacard/api_2_tkr_cmet.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_dmet/Api_2_Tkr_Dmet_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_dmet/Test_Api_2_Tkr_Dmet.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_dmet/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_dmet/javacard/api_2_tkr_dmet.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/Api_2_Tkr_Drfes_Bss_Bsb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/Test_Api_2_Tkr_Drfes_Bss_Bsb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/javacard/api_2_tkr_drfes_bss_bsb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/Api_2_Tkr_Drfeso_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/Test_Api_2_Tkr_Drfeso.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/javacard/api_2_tkr_drfeso.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_emet/Api_2_Tkr_Emet_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_emet/Test_Api_2_Tkr_Emet.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_emet/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_emet/javacard/api_2_tkr_emet.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/Api_2_Tkr_Gpol_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/Test_Api_2_Tkr_Gpol.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/javacard/api_2_tkr_gpol.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Api_2_Tkr_Ievs_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Api_2_Tkr_Ievs_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Test_Api_2_Tkr_Ievs.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/javacard/api_2_tkr_ievs.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/Api_2_Tkr_Imet_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/Test_Api_2_Tkr_Imet.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/javacard/api_2_tkr_imet.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/Api_2_Tkr_Rgfes_Bss_Bsb_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/Test_Api_2_Tkr_Rgfes_Bss_Bsb.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/javacard/api_2_tkr_rgfes_bss_bsb.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfeso/Api_2_Tkr_Rgfeso_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfeso/Test_Api_2_Tkr_Rgfeso.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfeso/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfeso/javacard/api_2_tkr_rgfeso.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rpol/Api_2_Tkr_Rpol_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rpol/Test_Api_2_Tkr_Rpol.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rpol/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rpol/javacard/api_2_tkr_rpol.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Api_2_Tkr_Rsid_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Api_2_Tkr_Rsid_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Test_Api_2_Tkr_Rsid.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/javacard/api_2_tkr_rsid.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/Api_2_Tkr_Rtim_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/Test_Api_2_Tkr_Rtim.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/javacard/api_2_tkr_rtim.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Api_2_Tkr_Sevl_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Api_2_Tkr_Sevl_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Test_Api_2_Tkr_Sevl.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/javacard/api_2_tkr_sevl.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_2.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_3.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_4.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Test_Api_2_Tkr_Sevt.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/javacard/api_2_tkr_sevt.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/Api_2_Tkr_Smta_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/Test_Api_2_Tkr_Smta.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/javacard/api_2_tkr_smta.cap create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_trs_gety/Api_2_Trs_Gety_1.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_trs_gety/Test_Api_2_Trs_Gety.java create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_trs_gety/applet.opt create mode 100644 source/Annex_E_SourceCode/uicc/test/toolkit/api_2_trs_gety/javacard/api_2_trs_gety.cap diff --git a/source/Annex_D_Example/uicc/test/example/uicc_example/Test_uicc_example.java b/source/Annex_D_Example/uicc/test/example/uicc_example/Test_uicc_example.java new file mode 100644 index 0000000..eccd065 --- /dev/null +++ b/source/Annex_D_Example/uicc/test/example/uicc_example/Test_uicc_example.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.example.uicc_example; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_uicc_example extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/example/example/uicc_example"; + static final String CLASS_AID_1 = "A0000000 090002FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090002FF FFFFFF89 40010101"; + static final String CLASS_AID_2 = "A0000000 090002FF FFFFFF89 40020001"; + static final String APPLET_AID_2 = "A0000000 090002FF FFFFFF89 40020101"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_uicc_example() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, "8008" + + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("03010000 0102"); + + // test case 1: trigger applet1 + test.envelopeEventDownloadBrowserTermination(); + + // check results + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1" + + "01CC"); + + // delete applet + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + + // test case 2: Applet 2 installation + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Fetch setUpMenu proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response + response = test.terminalResponse("81030121 00820282 81030100"); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_2); + result = response.checkData("10" + APPLET_AID_2" + + "01CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass/UiccAPITestCardService.java b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass/UiccAPITestCardService.java new file mode 100644 index 0000000..fa16fcb --- /dev/null +++ b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass/UiccAPITestCardService.java @@ -0,0 +1,29 @@ +/** + * @author SCP WG3, ETSI + * @version 0.01 + * UiccAPITestCardService defines method to get an object implementing interfaces + * This class has to be adapted to proprietary environment... + */ + +package org.etsi.scp.wg3.uicc.jcapi.userclass; + + + +public class UiccAPITestCardService { + + public static UiccAPITestCardService TestReference = null; + + /** + * static method to get a reference to UiccAPITestCardService + * @returns reference to the UiccAPITestCardService implementation class + */ + public static UiccAPITestCardService getTheUiccTestCardService() { + if (TestReference == null) { + return new UiccAPITestCardService(); + } + else { + return TestReference; + } + } + +} diff --git a/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass/UiccTestModel.java b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass/UiccTestModel.java new file mode 100644 index 0000000..4c3b890 --- /dev/null +++ b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass/UiccTestModel.java @@ -0,0 +1,12 @@ +/** + * @author SCP WG3, ETSI + * @version 0.10 + * UiccTestModel defines mandatory common methods for all tests + */ +package org.etsi.scp.wg3.uicc.jcapi.userclass; + + +public abstract class UiccTestModel { + + public abstract boolean run(); +} diff --git a/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/APDUResponse.java b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/APDUResponse.java new file mode 100644 index 0000000..2582d3b --- /dev/null +++ b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/APDUResponse.java @@ -0,0 +1,37 @@ +/** + * @author SCP WG3, ETSI + * @version 0.10 + * ResponseAPDU Class creates Object handling with APDU responses + */ +package org.etsi.scp.wg3.uicc.jcapi.userinterface; + + +public interface APDUResponse { + + /** + * Gives the Status Word returned by the card + * @return Status Word, as String + */ + public String getStatusWord(); + + /** + * Gives Data returned by the card + * @return Data, as String + */ + public String getData(); + + /** + * Check the received Status Word with expected Status Word + * @param expectedSw expected StatusWord, as String + * @return true or false, as boolean + */ + public boolean checkSw(String expectedSw); + + /** + * compare APDUResponse Object data with expected data + * @param expectedData, as String + * @return true or false, as boolean + */ + public boolean checkData(String expectedData); + +} diff --git a/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccAdministrativeCommandsService.java b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccAdministrativeCommandsService.java new file mode 100644 index 0000000..4fc8aee --- /dev/null +++ b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccAdministrativeCommandsService.java @@ -0,0 +1,42 @@ +/** + * @author SCP WG3, ETSI + * @version 0.10 + * UiccAdministrativeCommandsService defines administrative methods from ETSI TS 102 222 specification + */ +package org.etsi.scp.wg3.uicc.jcapi.userinterface; + + +public interface UiccAdministrativeCommandsService { + + /** + * create a new file under the current DF or ADF, as described in TS 102 222. + * @param Value field of the File control parameters TLV, as String + * @param Logical Channel number, as String + * @return ResponseAPDU Object + */ + public APDUResponse createFile(String fcpValue); + public APDUResponse createFile(String logicalChannel, String fcpValue); + + + /** + * initiate the deletion of an EF immediately under the current DF, + * or a DF with its complete subtree, as described in TS 102 222. + * @param File Id, as String + * @param Logical Channel number, as String + * @return ResponseAPDU Object + */ + public APDUResponse deleteFile(String fileId); + public APDUResponse deleteFile(String logicalChannel, String fileId); + + /** + * resize a file under the current DF or ADF, as described in TS 102 222. + * If used with BER TLV file, mode 0 shall be used. + * @param File Id, as String + * @param New size, as String + * @param Logical Channel number, as String + * @return ResponseAPDU Object + */ + public APDUResponse resizeFile(String fileId, String size); + public APDUResponse resizeFile(String logicalChannel, String fileId, String size); + +} diff --git a/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccApplicationManagementService.java b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccApplicationManagementService.java new file mode 100644 index 0000000..232d935 --- /dev/null +++ b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccApplicationManagementService.java @@ -0,0 +1,88 @@ +/** + * @author SCP WG3, ETSI + * @version 0.10 + * UiccApplicationManagementService defines methods to manage applications + */ +package org.etsi.scp.wg3.uicc.jcapi.userinterface; + + +public interface UiccApplicationManagementService { + + /** + * load cap file in the card + * @param relative path of the cap file, as String + * @return ResponseAPDU Object + */ + public APDUResponse loadPackage(String capFilePath); + + /** + * install and makeSelectable an instance in the card + * @param relative path of the cap file, as String + * @param Aid of the class, as String + * @param Aid of the instance, as String + * @param UICC System Specific TLV as defined in 102 226 specification, as String + * @return ResponseAPDU Object, corresponding to the GlobalPlatform command response. + */ + public APDUResponse installApplet(String capFilePath, String classAID, String appAID, String uiccSystemSpecificParameters); + + /** + * install an applet in installed state + * @param relative path of the cap file, as String + * @param AID of the class, as String + * @param AID of the instance, as String + * @param UICC System Specific TLV as defined in 102 226 specification, as String + * @return ResponseAPDU Object, corresponding to the GlobalPlatform command response. + */ + public APDUResponse installInstallApplet(String capFilePath, String classAID, String appAID, String uiccSystemSpecificParameters); + + /** + * make an applet selectable (install for make selectable) + * @param AID of the instance, as String + * @return ResponseAPDU Object, corresponding to the GlobalPlatform command response. + */ + public APDUResponse makeSelectableApplet(String appAID); + + /** + * perform a SelectApplication APDU command + * @param AID of instance, as String + * @param Logical Channel number, as String + * @return ResponseAPDU Object, containing the application response + */ + public APDUResponse selectApplication(String AID); + public APDUResponse selectApplication(String LogicalChannel, String AID); + + /** + * lock an application + * @param AID of application, as String + * @return ResponseAPDU Object, containing the application response + */ + public APDUResponse lockApplication(String appletAid); + + /** + * unlock an application + * @param AID of application, as String + * @return ResponseAPDU Object, containing the application response + */ + public APDUResponse unlockApplication(String appletAid); + + /** + * delete an applet specified by its AID + * @param AID of applet, as String + * @return ResponseAPDU Object + */ + public APDUResponse deleteApplet(String AID); + + /** + * delete a package specified by its path + * @param relative path of package, as String + * @return ResponseAPDU Object + */ + public APDUResponse deletePackage(String capFilePath); + + /** + * delete a package specified by its path, and all its related applications + * @param relative path of package, as String + * @return APDUResponse Object + */ + public APDUResponse deletePackageAndAllRelatedApplications(String capFilePath); +} diff --git a/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccCardManagementService.java b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccCardManagementService.java new file mode 100644 index 0000000..8a93f40 --- /dev/null +++ b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccCardManagementService.java @@ -0,0 +1,235 @@ +/** + * @author SCP WG3, ETSI + * @version 0.10 + * UiccCardManagementService defines Toolkit methods, among them ETSI TS 102 221 specification + */ +package org.etsi.scp.wg3.uicc.jcapi.userinterface; + + +public interface UiccCardManagementService { + + static final String SW_OK = "9000"; // normal ending of the command + static final String DEFAULT_TERMINAL_PROFILE = "0901"; // Default Terminal Profile + public final static String BASIC_CHANNEL = "00"; + public final static String LOGICAL_CHANNEL_1 = "01"; + public final static String LOGICAL_CHANNEL_2 = "02"; + public final static String LOGICAL_CHANNEL_3 = "03"; + + public final static String APPLICATION_PIN_1 = "01"; + public final static String APPLICATION_PIN_2 = "02"; + public final static String APPLICATION_PIN_3 = "03"; + public final static String APPLICATION_PIN_4 = "04"; + public final static String APPLICATION_PIN_5 = "05"; + public final static String APPLICATION_PIN_6 = "06"; + public final static String APPLICATION_PIN_7 = "07"; + public final static String APPLICATION_PIN_8 = "08"; + public final static String ADM1 = "0A"; + public final static String ADM2 = "0B"; + public final static String ADM3 = "0C"; + public final static String ADM4 = "0D"; + public final static String ADM5 = "0E"; + public final static String LOCAL_PIN_1 = "81"; + public final static String LOCAL_PIN_2 = "82"; + public final static String LOCAL_PIN_3 = "83"; + public final static String LOCAL_PIN_4 = "84"; + public final static String LOCAL_PIN_5 = "85"; + public final static String LOCAL_PIN_6 = "86"; + public final static String LOCAL_PIN_7 = "87"; + public final static String LOCAL_PIN_8 = "88"; + public final static String ADM6 = "8A"; + public final static String ADM7 = "8B"; + public final static String ADM8 = "8C"; + public final static String ADM9 = "8D"; + public final static String ADM10 = "8E"; + + + /** + * resets and powers the card + * @return ATR, as String + */ + public String reset(); + + /** + * select a file + * @param File Id, as String + * @param Logical Channel number, as String + * @return FCP, as APDUResponse Object + */ + public APDUResponse selectFile(String FileId); + public APDUResponse selectFile(String LogicalChannel, String FileId); + + /** + * select an application for activation + * @param DFname, as String + * @param LogicalChannel number, as String + * @return FCP, as APDUResponse Object + */ + public APDUResponse selectForActivation(String DFname); + public APDUResponse selectForActivation(String LogicalChannel, String DFname); + + /** + * select an application for termination + * @param DFname, as String + * @param Logical Channel number, as String + * @return FCP, as APDUResponse Object + */ + public APDUResponse selectForTermination(String DFname); + public APDUResponse selectForTermination(String LogicalChannel, String DFname); + + /** + * activate a file + * @param file Id, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse activate(String FileId); + public APDUResponse activate(String LogicalChannel, String FileId); + + /** + * deactivate a file + * @param File Id, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse deactivate(String FileId); + public APDUResponse deactivate(String LogicalChannel, String FileId); + + /** + * open and close logical channels + * @param Operation Code (open/close logical channel), as String + * @param ChannelNb (0 to 3), as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse manageChannel(String OperationCode, String ChannelNb); + public APDUResponse manageChannel(String LogicalChannel, String OperationCode, String ChannelNb); + + /** + * send a status APDU + * @param Application Status P1 , as String + * @param Returned Data P2, as String + * @param Length of the expected data, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse status(String AppStatus, String ReturnedData, String DataLength); + public APDUResponse status(String LogicalChannel, String AppStatus, String ReturnedData, String DataLength); + + /** + * reads the data bytes of the current transparent EF + * @param offset, as short + * @param length to be read, as short + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse readBinary(String sfiOffset, String length); + public APDUResponse readBinary(String logicalChannel, String sfiOffset, String length); + + /** + * reads a record of the current linear fixed/cyclic EF + * @param record number, as short + * @param record offset, as short + * @param length to be read, as short + * @param mode for reading record + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse readRecord(String recordNb, String mode, String length); + public APDUResponse readRecord(String logicalChannel, String recordNb, String mode, String length); + + + /** + * updates the data bytes of the current transparent EF + * @param offset, as short + * @param length to be updated, as short + * @param source data to update, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse updateBinary(String sfiOffset, String data); + public APDUResponse updateBinary(String logicalChannel, String sfiOffset, String data); + + + /** + * updates the data bytes of the record of the current linear fixed/cyclic EF + * @param record number + * @param record offset, as short + * @param lenght to be updated, as short + * @param mode for updating record, as byte + * @param source data to update, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse updateRecord(String recordNb, String mode, String data); + public APDUResponse updateRecord(String logicalChannel, String recordNb, String mode, String data); + + /** + * increases the current record of the current cyclic EF + * @param increase value + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse increase(String incValue); + public APDUResponse increase(String logicalChannel, String incValue); + + /** + * verify a PIN key + * @param Key reference, as byte + * @param value of the PIN key, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse verifyPIN(String keyRef, String PINValue); + public APDUResponse verifyPIN(String logicalChannel, String keyRef, String PINValue); + + /** + * Change the value of a PIN key + * @param Key reference, as byte + * @param old value of the PIN key, as String + * @param new value of the PIN key, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse changePIN(String keyRef, String OldPINValue, String NewPINValue); + public APDUResponse changePIN(String logicalChannel, String keyRef, String OldPINValue, String NewPINValue); + + /** + * Enable a PIN key + * @param Key reference, as byte + * @param value of the PIN key, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse enablePIN(String keyRef, String PINValue); + public APDUResponse enablePIN(String logicalChannel, String keyRef, String PINValue); + + /** + * Disable a PIN key + * @param Key reference, as byte + * @param value of the PIN key, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse disablePIN(String keyRef, String PINValue); + public APDUResponse disablePIN(String logicalChannel, String keyRef, String PINValue); + + /** + * Unblock a PIN key + * @param Key reference, as byte + * @param unblock value of the PIN key, as String + * @param value of the PIN key, as String + * @param Logical Channel number, as String + * @return APDUResponse Object + */ + public APDUResponse unblockPIN(String keyRef, String unblockPINValue, String PINValue); + public APDUResponse unblockPIN(String logicalChannel, String keyRef, String unblockPINValue, String PINValue); + + + /** + * sends any kind of APDU command + * @param apdu command, as String + * @return APDUResponse Object + */ + public APDUResponse sendApdu(String apduCommand); + +} diff --git a/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccToolkitService.java b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccToolkitService.java new file mode 100644 index 0000000..d0d411e --- /dev/null +++ b/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface/UiccToolkitService.java @@ -0,0 +1,212 @@ +/** + * @author SCP WG3, ETSI + * @version 0.10 + * UiccToolkitService defines Toolkit methods, among them ETSI TS 102 223 specification + */ +package org.etsi.scp.wg3.uicc.jcapi.userinterface; + + +public interface UiccToolkitService { + + /** + * perform Terminal Profile APDU command and all fetch/Terminal + * Response APDU until (90 00) status word + * @param Terminal Profile command parameters, as String + * @return APDUResponse Object + */ + public APDUResponse terminalProfileSession(String tpStr); + + /** + * perform a Terminal Profile APDU command + * @param Terminal Profile command parameters, as String + * @return APDUResponse Object + */ + public APDUResponse terminalProfile(String tpStr); + + /** + * perform a fetch APDU command + * @param length of expected data, as String + * @return APDUResponse Object + */ + public APDUResponse fetch(String expDataLength); + + /** + * perform a terminalResponse + * @param Terminal Response APDU Data, as String + * @return APDUResponse Object + */ + public APDUResponse terminalResponse(String cmd); + + /** + * perform an Envelope Menu Selection + * @param Item Identifier TLV, as String + * @param Help Request TLV, as String + * @return APDUResponse Object + * Send the following string : + * "D3 XX 82 02 01 81" + itemIdTLV + HelpRequestTLV + */ + public APDUResponse envelopeMenuSelection( + String itemIdTLV, // Item Identifier TLV + String HelpRequestTLV); // Help request TLV + + /** + * perform an Envelope Call Control by NAA + * @return APDUResponse Object + * Send the following string : + * "D4 11 82 02 82 81 86 02 81 01 93 07 81 F2 A3 34 05 76 67" + */ + public APDUResponse envelopeCallControlByNAA(); + + /** + * perform an Envelope Timer Expiration + * @param Timer Identifier TLV, as String + * @return APDUResponse Object + * Send the following string : + * "D7 0C 82 02 82 81" + TimerIdTLV + "25 03 00 00 00" + */ + public APDUResponse envelopeTimerExpiration( + String TimerIdTLV); // Timer Identifier TLV + + /** + * perform an Unrecognized Envelope + * @return APDUResponse Object + * Send the following string : + * "01 07 82 02 83 81 FF 01 01" + */ + public APDUResponse unrecognizedEnvelope(); + + /** + * perform an Envelope Event Download MT Call + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 00 82 02 83 81 9C 01 01" + */ + public APDUResponse envelopeEventDownloadMTCall(); + + /** + * perform an Envelope Event Download Call Connected + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 01 82 02 82 81 9C 01 01" + */ + public APDUResponse envelopeEventDownloadCallConnected(); + + /** + * perform an Envelope Event Download Call Disconnected + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 02 82 02 82 81 9C 01 01" + */ + public APDUResponse envelopeEventDownloadCallDisconnected(); + + /** + * perform an Envelope Event Download Location Status + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 03 82 02 82 81 1B 01 01" + */ + public APDUResponse envelopeEventDownloadLocationStatus(); + + /** + * perform an Envelope Event Download User Activity + * @return APDUResponse Object + * Send the following string : + * "D6 07 99 01 04 82 02 82 81" + */ + public APDUResponse envelopeEventDownloadUserActivity(); + + /** + * perform an Envelope Event Download Idle Screen Available + * @return APDUResponse Object + * Send the following string : + * "D6 07 99 01 05 82 02 02 81" + */ + public APDUResponse envelopeEventDownloadIdleScreenAvailable(); + + /** + * perform an Envelope Event Download Card Reader Status + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 06 82 02 82 81 20 01 FF" + */ + public APDUResponse envelopeEventDownloadCardReaderStatus(); + + /** + * perform an Envelope Event Download Language Selection + * @return APDUResponse Object + * Send the following string : + * "D6 0B 99 01 07 82 02 82 81 2D 02 46 52" + */ + public APDUResponse envelopeEventDownloadLanguageSelection(); + + /** + * perform an Envelope Event Download Browser Termination + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 08 82 02 82 81 34 01 00" + */ + public APDUResponse envelopeEventDownloadBrowserTermination(); + + /** + * perform an Envelope Event Download Data Available + * @param Channel Status TLV, as String + * @return APDUResponse Object + * Send the following string : + * "D6 0E 99 01 09 82 02 82 81" + ChannelStatusTLV + "37 01 0A" + */ + public APDUResponse envelopeEventDownloadDataAvailable( + String ChannelStatusTLV); // Channel Status TLV + + /** + * perform an Envelope Event Download Channel Status + * @param Channel Status TLV, as String + * @return APDUResponse Object + * Send the following string : + * "D6 0B 99 01 0A 82 02 82 81" + ChannelStatusTLV + */ + public APDUResponse envelopeEventDownloadChannelStatus( + String ChannelStatusTLV); // Channel Status TLV + + /** + * perform an Envelope Event Download Access Technology Change + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 0B 82 02 82 81 BF 01 00" + */ + public APDUResponse envelopeEventDownloadAccessTechnologyChange(); + + /** + * perform an Envelope Event Download Display Parameters Changed + * @return APDUResponse Object + * Send the following string : + * "D6 0C 99 01 0C 82 02 82 81 C0 03 10 10 01" + */ + public APDUResponse envelopeEventDownloadDisplayParametersChanged(); + + /** + * perform an Envelope Event Download Local Connection + * @param Service Record TLV, as String + * @return APDUResponse Object + * Send the following string : + * "D6 XX 99 01 0D 82 02 83 81" + ServiceRecordTLV + */ + public APDUResponse envelopeEventDownloadLocalConnection( + String ServiceRecordTLV); // Service Record TLV + + /** + * perform an Envelope Event Download Network Search Change Mode + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 0E 82 02 83 81 E5 01 00" + */ + public APDUResponse envelopeEventDownloadNetworkSearchModeChange(); + + /** + * perform an Envelope Event Download Browsing Status + * @return APDUResponse Object + * Send the following string : + * "D6 0A 99 01 0F 82 02 83 81 E4 01 00" + */ + public APDUResponse envelopeEventDownloadBrowsingStatus(); + +} diff --git a/source/Annex_D_UiccTestUtil/uicc/test/util/LoadUtil.java b/source/Annex_D_UiccTestUtil/uicc/test/util/LoadUtil.java new file mode 100644 index 0000000..96cbff7 --- /dev/null +++ b/source/Annex_D_UiccTestUtil/uicc/test/util/LoadUtil.java @@ -0,0 +1,36 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.util; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class LoadUtil extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/util"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public LoadUtil() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + + return (true); + } +} \ No newline at end of file diff --git a/source/Annex_D_UiccTestUtil/uicc/test/util/TestToolkitApplet.java b/source/Annex_D_UiccTestUtil/uicc/test/util/TestToolkitApplet.java new file mode 100644 index 0000000..8e6ee27 --- /dev/null +++ b/source/Annex_D_UiccTestUtil/uicc/test/util/TestToolkitApplet.java @@ -0,0 +1,117 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.util; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; + +/** + * Definition of the super class of all the test applets. + * The result of each and every test case is stored in an array. + * The results of the test can be obtained by selecting the test applet : + * the applet ID and the test cases results are then returned in the response data. + */ +abstract public class TestToolkitApplet extends javacard.framework.Applet implements +ToolkitInterface, ToolkitConstants { + + /* + * Generic variables for all test applets + */ + /** version Java Card 2.2 version */ + private final static short VERSION = 0x0202; + + /** obReg ToolktRegistry object */ + protected ToolkitRegistry obReg; + + /** + * baTestAppletId byte array to store the identifier of the test applet, + * the first byte is the length of the AID. + */ + private byte[] baTestAppletId = new byte[17]; + + /** + * baTestsResults byte array containing the result of each and every test case, + * the first byte is the number of test cases. + */ + private byte[] baTestsResults = new byte[128]; + + + /** + * Constructor of the applet + */ + public TestToolkitApplet() { + } + + /** + * Method called by the sub classes to initialize the AID + */ + public void init() throws SystemException { + + // Register to the UICC Toolkit Registry. Shall be called after register() method invocation. + this.obReg = ToolkitRegistrySystem.getEntry(); + + if (JCSystem.getVersion() < TestToolkitApplet.VERSION) { + SystemException.throwIt((short)SystemException.ILLEGAL_VALUE); + } + // Get the AID value + this.baTestAppletId[0] = JCSystem.getAID().getBytes(this.baTestAppletId, (short)1); + Util.arrayFillNonAtomic(this.baTestsResults, (short)0, (short)this.baTestsResults.length, (byte)0x00); + } + + /** + * Method called by the Toolkit Framework + * + * @param clientAID the AID of the calling application + * @param parameter + */ + public Shareable getShareableInterfaceObject(AID clientAID, byte parameter) { + // According to CAT Runtime Environment behaviour for ToolkitInterface object retrieval + if ((clientAID == null) && (parameter == (byte)0x01)) { + return((Shareable) this); + } else { + return(null); + } + } + + /** + * Method called by the test applet to report the result of each test case + * + * @param testCaseNumber test case number + * @param result true if successful, false otherwise + */ + protected void reportTestOutcome(byte testCaseNumber, boolean testCaseResult) { + // Update the total number of tests executed + this.baTestsResults[0] = testCaseNumber; + + // Set the Test Case Result byte to 0xCC (for Card Compliant...) if successful + if (testCaseResult) { + this.baTestsResults[testCaseNumber] = (byte)0xCC; + } + else { + this.baTestsResults[testCaseNumber] = (byte)0x00; + } + } + + /** + * Method called by the JCRE, once selected + * This method allows to retrieve the detailed results of the previous execution + * may be identical for all tests + */ + public void process(APDU apdu) { + if (selectingApplet()) { + /* Construct and send the results of the tests */ + apdu.setOutgoing(); + apdu.setOutgoingLength((short)((short)(this.baTestAppletId[0] + this.baTestsResults[0]) + + (short)2)); + apdu.sendBytesLong(this.baTestAppletId, (short)0, (short)((short)(this.baTestAppletId[0]) + (short)1)); + apdu.sendBytesLong(this.baTestsResults, (short)0, (short)((short)(this.baTestsResults[0]) + (short)1)); + } + else { + ISOException.throwIt(javacard.framework.ISO7816.SW_INS_NOT_SUPPORTED); + } + } +} diff --git a/source/Annex_D_UiccTestUtil/uicc/test/util/TestToolkitApplet.opt b/source/Annex_D_UiccTestUtil/uicc/test/util/TestToolkitApplet.opt new file mode 100644 index 0000000..5bf6ad8 --- /dev/null +++ b/source/Annex_D_UiccTestUtil/uicc/test/util/TestToolkitApplet.opt @@ -0,0 +1,3 @@ +-exportpath ..\..\Export;.\ +-out EXP CAP JCA +uicc.test.util 0xA0:0x00:0x00:0x00:0x09:0x00:0x05:0xFF:0xFF:0xFF:0xFF:0x89:0xF0:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_D_UiccTestUtil/uicc/test/util/UICCTestConstants.java b/source/Annex_D_UiccTestUtil/uicc/test/util/UICCTestConstants.java new file mode 100644 index 0000000..488fa44 --- /dev/null +++ b/source/Annex_D_UiccTestUtil/uicc/test/util/UICCTestConstants.java @@ -0,0 +1,118 @@ +package uicc.test.util; + +public class UICCTestConstants { + //MF + public final static short FID_MF = (short)0x3F00; + + // Reserved IDs + // These IDs are used to test that a DF/EF does not exist + // and are thus reserved. They shall not be used for perso. + public final static short FID_EF_RFU0 = (short)0x6F29; + public final static short FID_EF_RFU1 = (short)0x6F2A; + public final static short FID_EF_RFU2 = (short)0x6F2B; + + public final static short FID_DF_RFU1 = (short)0x5F01; + public final static short FID_DF_RFU2 = (short)0x5F02; + public final static short FID_DF_RFU3 = (short)0x5F03; + + // DF Ids + public final static short FID_DF_TEST = (short)0x7F4A; + public final static short FID_DF_SUB_TEST = (short)0x5F10; + + public final static short FID_DF_ADF2 = (short)0x7F4B; + + // File IDs + public final static short FID_EF_TNR = (short)0x6F01; + public final static short FID_EF_TNU = (short)0x6F02; + public final static short FID_EF_TARU = (short)0x6F03; + + public final static short FID_EF_CNR = (short)0x6F04; + public final static short FID_EF_CNU = (short)0x6F05; + public final static short FID_EF_CNIC = (short)0x6F1C; + public final static short FID_EF_CNDE = (short)0x6F07; + public final static short FID_EF_CNAC = (short)0x6F08; + public final static short FID_EF_CARU = (short)0x6F09; + + public final static short FID_EF_LNR = (short)0x6F0A; + public final static short FID_EF_LNU = (short)0x6F0B; + public final static short FID_EF_LARU = (short)0x6F0C; + + public final static short FID_EF_CINA = (short)0x6F0D; + + public final static short FID_EF_TRAC = (short)0x6F0E; + public final static short FID_EF_TDAC = (short)0x6F0F; + + public final static short FID_EF_CIAC = (short)0x6F10; + public final static short FID_EF_CIAA = (short)0x6F11; + public final static short FID_EF_CNRA = (short)0x6F12; + public final static short FID_EF_CUAC = (short)0x6F13; + + public final static short FID_EF_TAAC = (short)0x6F14; + + public final static short FID_EF_LADA = (short)0x6F15; + + public final static short FID_EF_TAAA = (short)0x6F16; + + public final static short FID_EF_LRUA = (short)0x6F17; + public final static short FID_EF_LUPC = (short)0x6F18; + + public final static short FID_EF_NOSH = (short)0x6F19; + + public final static short FID_EF_LSEA = (short)0x6F1A; + public final static short FID_EF_CSEA = (short)0x6F1B; + + public final static short FID_EF_TERM = (short)0x6F30; + public final static short FID_DF_TERM = (short)0x5F30; + + public final static short FID_EF_TAA = (short)0x4F10; + + public final static short FID_EF_LARR1 = (short)0x6FA1; + public final static short FID_EF_LARR2 = (short)0x6FA2; + public final static short FID_EF_LARR3 = (short)0x6FA3; + public final static short FID_EF_LARR4 = (short)0x6FA4; + public final static short FID_EF_LARR5 = (short)0x6FA5; + + public final static short FID_EF_TARR1 = (short)0x6FB1; + public final static short FID_EF_TARR2 = (short)0x6FB2; + public final static short FID_EF_TARR3 = (short)0x6FB3; + public final static short FID_EF_TARR4 = (short)0x6FB4; + public final static short FID_EF_TARR5 = (short)0x6FB5; + + public final static short FID_EF_CARR1 = (short)0x6FC1; + public final static short FID_EF_CARR2 = (short)0x6FC2; + public final static short FID_EF_CARR3 = (short)0x6FC3; + public final static short FID_EF_CARR4 = (short)0x6FC4; + public final static short FID_EF_CARR5 = (short)0x6FC5; + + public final static short FID_DF_ARR1 = (short)0x5F11; + public final static short FID_EF_TAR1T = (short)0x4F11; + + public final static short FID_DF_ARR2 = (short)0x5F12; + public final static short FID_EF_TAR2T = (short)0x4F12; + + public final static short FID_DF_ARR3 = (short)0x5F13; + public final static short FID_EF_TAR3T = (short)0x4F13; + + public final static short FID_DF_ARR4 = (short)0x5F14; + public final static short FID_EF_TAR4T = (short)0x4F14; + + public final static short FID_DF_ARR5 = (short)0x5F15; + public final static short FID_EF_TAR5T = (short)0x4F15; + + public final static short FID_EF_ARR_MF = (short)0x2F06; + public final static short FID_EF_ARR_ADF = (short)0x6F06; + + public final static short FID_EF_UICC = (short)0x2FE4; + + public final static short FID_ADF = (short)0x7FFF; + + public final byte[] AID_ADF1 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, + (byte)0xE0, (byte)0x00, (byte)0x00, (byte)0x02}; + + public final byte[] AID_ADF2 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, + (byte)0xD0, (byte)0x00, (byte)0x00, (byte)0x02}; +} diff --git a/source/Annex_D_UiccTestUtil/uicc/test/util/javacard/util.cap b/source/Annex_D_UiccTestUtil/uicc/test/util/javacard/util.cap new file mode 100644 index 0000000000000000000000000000000000000000..15588c1eef6005a13e8bbb40e395670dcfc07066 GIT binary patch literal 2836 zcmbuAe^8Tk9LGQ3=hvQX4ju??v%|;$5k;n1?L>~PF_a%eKd^u_EvF)F}&%M9T_s8?R zzCS;oPe~!mC4h)eWm(pfa9>IQ4y=}PQ$~JqUZ&MloS$b|Tt3U1H_{IfXkWVMj6Px8 z?>m3Xd8_cmFV5z@w`+Q^*9?sM%PZkc;H_ITj)Q%6!xZ`7aO(_Wvo@y_iHm$wd- zH##hXr90EVfp;%@D=u0{Pr=?9*8zH{NvKb<_F&#=8?8SJ@n^uk9) zrN-c1XSuGYbm@nI8}q*iCO2G~z3T(Z$HAepyyc$2D{-4glKnT6Cwdngcbpk+N-U^I zIrmA%WS#ZRc~|ypd;F$FZ(By%1}+JE9`YRA=j-;Kl{WsB_~Y)j#E9JW2?8>ZJw2x3mvwV4$myRt(L&#!T!-l50!Swnpn_!3z!0`zdSC^e-W=Bq?4XLag8b@Q zx5rCI;2@1d)}tGE--_K-X{bo+F}rK(ytW!|iQ8R82jp=f z@eE>7xNVq05)~2rqEhf{=$mEz0xS3>e6uK(0;NRpf?q*|MgXBf0>RJ9wpiUStjItj z)nn17RAsBHqjM1;-Hamu%M18N>z{~N&|*k1-@B>k5AGzgQ{|l zt{K!>I%K8bcPS>`)C?17m9}tL(dfp|_bRnwTr~tB#%D~zDYZbXR+3uP*{sxI$mUo> zHjffe3Q1|m7O@}+B4!E(Gm&OWnyF}}mUdu1K^nqbL%)onSuAhZ&i;Ss#Rs6AFZ^<@ zJ^$Si4W0_sv?!;u*lY8;?0GIn)z}et9jQxFTKmGRLYSw;ieO8hYqT zG}m~IsEiR5tX32gI5n$ctCv6wKZ#cgf;vNxG}s+JRz>pOCJD!)igvdwFO6HV3N+M| z(0(BawLhG9srPF8HSDHJMMau>uA|QGan+*pp;K4G5Ly9sGA!B}(;%WXaQHW*5gdy^ zDz#n)felzOLIUj)3EGcw%>4jQAQzqiHEmaNXjS4gi9hOLE<6ocW94kD8?nzw4)IQ@l^7Wl?}SRW zThDi!jU`ACJNJhXxvh!&9V)Oev~+H|M{?NQkn9 zMBe;RP?7WGkt4(#ioy$vBXXoXPK1yaCh`*&XYTo5U(N%FWkM96pjU5^bcxy8TY>tV=cfxDq^al literal 0 HcmV?d00001 diff --git a/source/Annex_D_UiccTestUtil/uicc/test/util/javacard/util.exp b/source/Annex_D_UiccTestUtil/uicc/test/util/javacard/util.exp new file mode 100644 index 0000000000000000000000000000000000000000..f12edda18bfd00e4def8db7b4e1b197af3418dde GIT binary patch literal 3333 zcmZ|Q*LoX86bJCLl5M${H0;C)q1y={S0FefsMv`Txu9ae281lH9oe$hk=6;JIdnqr zy`<7x5_kaG4G+N;55P4y=KN=Oy=RT__xT&?w`bmSTLrZ=9h2c?7`>XxdVvG-#o5r}VnH|6Xb7IxttT37o7K(a zk!(rNP8IZ6(bP*b*_>_-tkE7TTP|Cg4$hRa3;J=RG#?Dbq66VhHIFqa>N0-c;v7qz5b%ZAn(rAxmZy5LKNWyno z+sR#mOJ=?hL}xq3T6%ysYt+1U>jHFzMs3hF3voKN@ub&zyt>W+ZPRG`dcWoBUIu9U z|Aa)0V%f|V&2oUQ}7<3^WKA&WM-6c0sJM?Miw-EfqmEiT0qX+?ZOoTzwuOzl>y zOCzJngIFUUl+~!@pz65QrHD;@Se&TTU}6{@yKLgRu_?pk{L(xx4jSc+sJBao_c@{J z`Ha_8L7(*+YSlRBwLaK+ul2(&xW*-C<+$iImE)4vRF2DDQ#tsycjk=oRF0oqi#R!c z_L|D^i`P_+U%jSs{N^>4<9ByM?Gza<8Znh_oYzsOka*uY3|TW=NFuC9g*nA#g{i~O z#U;XeRhUz7Rv6}%;er!keJac;LMsf@&2SNluznTB)?okKJU71iI51enx4%HXO;`<9 zr=rra2&yyq7rz1#XhkfqX#aUTAQEo~=O*O~_y-={`wrn#dx^B>(?nE5l`H&r>Tmu` zmwm)%d<*%gmA3k+op#VpzJaNNpK(L=Xne#o;kOgyt?J%HN<3;^~D zxC5|Hz<$7;0z!bWfCwNeU=T1Q-~iyDfEeJAfWv^efMLLhfKkAhfV%(*0ZBkgKpHSE z;BLS@0`3J&2$%%iC*Xd-0|GLD2L)sSQvz~;X#qN5M!+oKh=4p`PQW~%AYcJd6kq@r z1snyG1e5`$fF-~&0mlIk2{-|GSimEIM+H0vcwE3T;G}>j08a{d3h=amX8_L%cn()V + // 16 + staticMethodRef 1.16.0()Luicc/toolkit/ToolkitRegistry;; // uicc/toolkit/ToolkitRegistrySystem.getEntry()Luicc/toolkit/ToolkitRegistry; + .descriptor Luicc/toolkit/ToolkitRegistry; 1.9; + + // 17 + staticMethodRef 0.3.0()V; // javacard/framework/Applet.()V + } + + .class public abstract TestToolkitApplet 0 extends 0.3 { // extends javacard/framework/Applet + + .shareable; + + .fields { + protected 1.9 obReg 0; // Luicc/toolkit/ToolkitRegistry; + private byte[] baTestAppletId 1; // [B + private byte[] baTestsResults 2; // [B + private static final short VERSION = 514; // S + } + + .publicMethodTable 5 { + equals(Ljava/lang/Object;)Z; + register()V; + register([BSB)V; + selectingApplet()Z; + deselect()V; + getShareableInterfaceObject(Ljavacard/framework/AID;B)Ljavacard/framework/Shareable;; + select()Z; + process(Ljavacard/framework/APDU;)V; + init()V; + reportTestOutcome(BZ)V; + processToolkit(S)V; + } + + .packageMethodTable 0 { + } + + .implementedInterfaceInfoTable { + .interface 0.2 { // javacard/framework/Shareable + } + + .interface 1.8 { // uicc/toolkit/ToolkitInterface + 10; // processToolkit(S)V + } + + .interface 1.7 { // uicc/toolkit/ToolkitConstants + } + + } + + .method public ()V 0 { + .stack 2; + .locals 0; + + L0: aload_0; + invokespecial 17; // javacard/framework/Applet.()V + aload_0; + bspush 17; + newarray 11; + putfield_a 0; // reference uicc/test/util/TestToolkitApplet.baTestAppletId + aload_0; + sspush 128; + newarray 11; + putfield_a 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + return; + } + + .method public init()V 8 { + .stack 5; + .locals 0; + + L0: aload_0; + invokestatic 16; // uicc/toolkit/ToolkitRegistrySystem.getEntry()Luicc/toolkit/ToolkitRegistry; + putfield_a 2; // reference uicc/test/util/TestToolkitApplet.obReg + invokestatic 5; // javacard/framework/JCSystem.getVersion()S + sspush 514; + if_scmpge L2; + L1: sconst_1; + invokestatic 6; // javacard/framework/SystemException.throwIt(S)V + L2: getfield_a_this 0; // reference uicc/test/util/TestToolkitApplet.baTestAppletId + sconst_0; + invokestatic 7; // javacard/framework/JCSystem.getAID()Ljavacard/framework/AID; + getfield_a_this 0; // reference uicc/test/util/TestToolkitApplet.baTestAppletId + sconst_1; + invokevirtual 8; // javacard/framework/AID.getBytes([BS)B + bastore; + getfield_a_this 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + sconst_0; + getfield_a_this 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + arraylength; + sconst_0; + invokestatic 9; // javacard/framework/Util.arrayFillNonAtomic([BSSB)S + pop; + return; + } + + .method public getShareableInterfaceObject(Ljavacard/framework/AID;B)Ljavacard/framework/Shareable; 5 { + .stack 2; + .locals 0; + + .descriptor Ljavacard/framework/AID; 0.6; + .descriptor Ljavacard/framework/Shareable; 0.2; + + L0: aload_1; + ifnonnull L3; + L1: sload_2; + sconst_1; + if_scmpne L3; + L2: aload_0; + areturn; + L3: aconst_null; + areturn; + } + + .method protected reportTestOutcome(BZ)V 9 { + .stack 3; + .locals 0; + + L0: getfield_a_this 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + sconst_0; + sload_1; + bastore; + sload_2; + ifeq L2; + L1: getfield_a_this 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + sload_1; + bspush -52; + bastore; + goto L3; + L2: getfield_a_this 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + sload_1; + sconst_0; + bastore; + L3: return; + } + + .method public process(Ljavacard/framework/APDU;)V 7 { + .stack 5; + .locals 0; + + .descriptor Ljavacard/framework/APDU; 0.10; + + L0: aload_0; + invokevirtual 10; // javacard/framework/Applet.selectingApplet()Z + ifeq L2; + L1: aload_1; + invokevirtual 11; // javacard/framework/APDU.setOutgoing()S + pop; + aload_1; + getfield_a_this 0; // reference uicc/test/util/TestToolkitApplet.baTestAppletId + sconst_0; + baload; + getfield_a_this 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + sconst_0; + baload; + sadd; + sconst_2; + sadd; + invokevirtual 12; // javacard/framework/APDU.setOutgoingLength(S)V + aload_1; + getfield_a_this 0; // reference uicc/test/util/TestToolkitApplet.baTestAppletId + sconst_0; + getfield_a_this 0; // reference uicc/test/util/TestToolkitApplet.baTestAppletId + sconst_0; + baload; + sconst_1; + sadd; + invokevirtual 13; // javacard/framework/APDU.sendBytesLong([BSS)V + aload_1; + getfield_a_this 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + sconst_0; + getfield_a_this 1; // reference uicc/test/util/TestToolkitApplet.baTestsResults + sconst_0; + baload; + sconst_1; + sadd; + invokevirtual 13; // javacard/framework/APDU.sendBytesLong([BSS)V + goto L3; + L2: sspush 27904; + invokestatic 14; // javacard/framework/ISOException.throwIt(S)V + L3: return; + } + + .method public abstract processToolkit(S)V 10 { + } + + } + + .class public UICCTestConstants 1 extends 2.0 { // extends java/lang/Object + + .fields { + public final byte[] AID_ADF1 0; // [B + public final byte[] AID_ADF2 1; // [B + public static final short FID_MF = 16128; // S + public static final short FID_EF_RFU0 = 28457; // S + public static final short FID_EF_RFU1 = 28458; // S + public static final short FID_EF_RFU2 = 28459; // S + public static final short FID_DF_RFU1 = 24321; // S + public static final short FID_DF_RFU2 = 24322; // S + public static final short FID_DF_RFU3 = 24323; // S + public static final short FID_DF_TEST = 32586; // S + public static final short FID_DF_SUB_TEST = 24336; // S + public static final short FID_DF_ADF2 = 32587; // S + public static final short FID_EF_TNR = 28417; // S + public static final short FID_EF_TNU = 28418; // S + public static final short FID_EF_TARU = 28419; // S + public static final short FID_EF_CNR = 28420; // S + public static final short FID_EF_CNU = 28421; // S + public static final short FID_EF_CNIC = 28444; // S + public static final short FID_EF_CNDE = 28423; // S + public static final short FID_EF_CNAC = 28424; // S + public static final short FID_EF_CARU = 28425; // S + public static final short FID_EF_LNR = 28426; // S + public static final short FID_EF_LNU = 28427; // S + public static final short FID_EF_LARU = 28428; // S + public static final short FID_EF_CINA = 28429; // S + public static final short FID_EF_TRAC = 28430; // S + public static final short FID_EF_TDAC = 28431; // S + public static final short FID_EF_CIAC = 28432; // S + public static final short FID_EF_CIAA = 28433; // S + public static final short FID_EF_CNRA = 28434; // S + public static final short FID_EF_CUAC = 28435; // S + public static final short FID_EF_TAAC = 28436; // S + public static final short FID_EF_LADA = 28437; // S + public static final short FID_EF_TAAA = 28438; // S + public static final short FID_EF_LRUA = 28439; // S + public static final short FID_EF_LUPC = 28440; // S + public static final short FID_EF_NOSH = 28441; // S + public static final short FID_EF_LSEA = 28442; // S + public static final short FID_EF_CSEA = 28443; // S + public static final short FID_EF_TERM = 28464; // S + public static final short FID_DF_TERM = 24368; // S + public static final short FID_EF_TAA = 20240; // S + public static final short FID_EF_LARR1 = 28577; // S + public static final short FID_EF_LARR2 = 28578; // S + public static final short FID_EF_LARR3 = 28579; // S + public static final short FID_EF_LARR4 = 28580; // S + public static final short FID_EF_LARR5 = 28581; // S + public static final short FID_EF_TARR1 = 28593; // S + public static final short FID_EF_TARR2 = 28594; // S + public static final short FID_EF_TARR3 = 28595; // S + public static final short FID_EF_TARR4 = 28596; // S + public static final short FID_EF_TARR5 = 28597; // S + public static final short FID_EF_CARR1 = 28609; // S + public static final short FID_EF_CARR2 = 28610; // S + public static final short FID_EF_CARR3 = 28611; // S + public static final short FID_EF_CARR4 = 28612; // S + public static final short FID_EF_CARR5 = 28613; // S + public static final short FID_DF_ARR1 = 24337; // S + public static final short FID_EF_TAR1T = 20241; // S + public static final short FID_DF_ARR2 = 24338; // S + public static final short FID_EF_TAR2T = 20242; // S + public static final short FID_DF_ARR3 = 24339; // S + public static final short FID_EF_TAR3T = 20243; // S + public static final short FID_DF_ARR4 = 24340; // S + public static final short FID_EF_TAR4T = 20244; // S + public static final short FID_DF_ARR5 = 24341; // S + public static final short FID_EF_TAR5T = 20245; // S + public static final short FID_EF_ARR_MF = 12038; // S + public static final short FID_EF_ARR_ADF = 28422; // S + public static final short FID_EF_UICC = 12260; // S + public static final short FID_ADF = 32767; // S + } + + .publicMethodTable 1 { + equals(Ljava/lang/Object;)Z; + } + + .packageMethodTable 0 { + } + + .method public ()V 0 { + .stack 5; + .locals 0; + + L0: aload_0; + invokespecial 15; // java/lang/Object.()V + aload_0; + bspush 16; + newarray 11; + dup; + sconst_0; + bspush -96; + bastore; + dup; + sconst_1; + sconst_0; + bastore; + dup; + sconst_2; + sconst_0; + bastore; + dup; + sconst_3; + sconst_0; + bastore; + dup; + sconst_4; + bspush 9; + bastore; + dup; + sconst_5; + sconst_0; + bastore; + dup; + bspush 6; + sconst_5; + bastore; + dup; + bspush 7; + sconst_m1; + bastore; + dup; + bspush 8; + sconst_m1; + bastore; + dup; + bspush 9; + sconst_m1; + bastore; + dup; + bspush 10; + sconst_m1; + bastore; + dup; + bspush 11; + bspush -119; + bastore; + dup; + bspush 12; + bspush -32; + bastore; + dup; + bspush 13; + sconst_0; + bastore; + dup; + bspush 14; + sconst_0; + bastore; + dup; + bspush 15; + sconst_2; + bastore; + putfield_a 3; // reference uicc/test/util/UICCTestConstants.AID_ADF1 + aload_0; + bspush 16; + newarray 11; + dup; + sconst_0; + bspush -96; + bastore; + dup; + sconst_1; + sconst_0; + bastore; + dup; + sconst_2; + sconst_0; + bastore; + dup; + sconst_3; + sconst_0; + bastore; + dup; + sconst_4; + bspush 9; + bastore; + dup; + sconst_5; + sconst_0; + bastore; + dup; + bspush 6; + sconst_5; + bastore; + dup; + bspush 7; + sconst_m1; + bastore; + dup; + bspush 8; + sconst_m1; + bastore; + dup; + bspush 9; + sconst_m1; + bastore; + dup; + bspush 10; + sconst_m1; + bastore; + dup; + bspush 11; + bspush -119; + bastore; + dup; + bspush 12; + bspush -48; + bastore; + dup; + bspush 13; + sconst_0; + bastore; + dup; + bspush 14; + sconst_0; + bastore; + dup; + bspush 15; + sconst_2; + bastore; + putfield_a 4; // reference uicc/test/util/UICCTestConstants.AID_ADF2 + return; + } + + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/Api_1_Cont_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/Api_1_Cont_1.java new file mode 100644 index 0000000..a9b467d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/Api_1_Cont_1.java @@ -0,0 +1,1662 @@ +/** + * uicc.access package, context tests + * applet 1 + */ + +package uicc.test.access.api_1_cont; + + +import javacard.framework.*; + +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.system.*; +import uicc.test.util.*; +import uicc.toolkit.*; + + +public class Api_1_Cont_1 extends TestToolkitApplet implements UICCConstants { + private boolean bRes; + private byte testCaseNb = 0; + private short i; + + private final byte SFI_EF_TNR = 0x01; + private final byte SFI_EF_TARU = 0x03; + private final byte SFI_EF_CNR = 0x04; + private final byte SFI_NA1 = 0x06; + private final byte SFI_NA2 = 0x08; + + private FileView uiccFileView1 = null; + private FileView uiccFileView2 = null; + private FileView adf1FileView1 = null; + private FileView adf1FileView2 = null; + private AdminFileView uiccAdminFileView1 = null; + private AdminFileView uiccAdminFileView2 = null; + private AdminFileView adf1AdminFileView1 = null; + private AdminFileView adf1AdminFileView2 = null; + + private static final short TLVHANDLER_MAX_SIZE = 50; + private EditHandler editHandler; + private byte[] data = null; + private byte[] resp = null; + private byte[] abExpected = null; + private byte[] abPatt = null; + private short[] asResp = null; + private byte[] checkFCP = null; + private short fcpLen; + private byte[] fcp = new byte[TLVHANDLER_MAX_SIZE]; + private byte[] adf1Aid = new byte[16]; + private UICCTestConstants uiccTestConstants; + + + private byte[] createFileEFBuffer = new byte[] { + (byte) 0x82, (byte) 0x02, (byte) 0x41, (byte) 0x21, // File Descriptor + (byte) 0x83, (byte) 0x02, (byte) 0x00, (byte) 0x00, // File ID + (byte) 0x8A, (byte) 0x01, (byte) 0x05, // Life Cycle Status Information + (byte) 0x8B, (byte) 0x03, (byte) 0x2F, (byte) 0x06, (byte) 0x01, // Security Attributes + (byte) 0x80, (byte) 0x02, (byte) 0x00, (byte) 0x20, // File Size + (byte) 0x88, (byte) 0x00 // Short File Identifier + }; + + private byte[] createFileEFBuffer_inADF = new byte[] { + (byte) 0x82, (byte) 0x02, (byte) 0x41, (byte) 0x21, // File Descriptor + (byte) 0x83, (byte) 0x02, (byte) 0x00, (byte) 0x00, // File ID + (byte) 0x8A, (byte) 0x01, (byte) 0x05, // Life Cycle Status Information + (byte) 0x8B, (byte) 0x03, (byte) 0x6F, (byte) 0x06, (byte) 0x01, // Security Attributes + (byte) 0x80, (byte) 0x02, (byte) 0x00, (byte) 0x20, // File Size + (byte) 0x88, (byte) 0x00 // Short File Identifier + }; + + private final short EF_FID_OFFSET = 6; + + private byte[] createFileDFBuffer = new byte[] { + (byte) 0x82, (byte) 0x02, (byte) 0x78, (byte) 0x21, + (byte) 0x83, (byte) 0x02, (byte) 0x00, (byte) 0x00, + (byte) 0x8A, (byte) 0x01, (byte) 0x05, + (byte) 0x8B, (byte) 0x03, (byte) 0x2F, (byte) 0x06, (byte) 0x01, + (byte) 0x81, (byte) 0x02, (byte) 0x00, (byte) 0x30, + (byte) 0xC6, (byte) 0x06, (byte) 0x90, (byte) 0x01, (byte) 0x80, (byte) 0x83, (byte) 0x01, (byte) 0x01 + }; + + private byte[] createFileDFBuffer_inADF = new byte[] { + (byte) 0x82, (byte) 0x02, (byte) 0x78, (byte) 0x21, + (byte) 0x83, (byte) 0x02, (byte) 0x00, (byte) 0x00, + (byte) 0x8A, (byte) 0x01, (byte) 0x05, + (byte) 0x8B, (byte) 0x03, (byte) 0x6F, (byte) 0x06, (byte) 0x01, + (byte) 0x81, (byte) 0x02, (byte) 0x00, (byte) 0x30, + (byte) 0xC6, (byte) 0x06, (byte) 0x90, (byte) 0x01, (byte) 0x80, (byte) 0x83, (byte) 0x01, (byte) 0x01 + }; + + private byte[] createFileDFBuffer2 = new byte[] { + (byte) 0x82, (byte) 0x02, (byte) 0x78, (byte) 0x21, + (byte) 0x83, (byte) 0x02, (byte) 0x00, (byte) 0x00, + (byte) 0x8A, (byte) 0x01, (byte) 0x05, + (byte) 0x8B, (byte) 0x03, (byte) 0x2F, (byte) 0x06, (byte) 0x01, + (byte) 0x81, (byte) 0x02, (byte) 0x00, (byte) 0x01, + (byte) 0xC6, (byte) 0x06, (byte) 0x90, (byte) 0x01, (byte) 0x80, (byte) 0x83, (byte) 0x01, (byte) 0x01 + }; + + private byte[] createFileDFBuffer2_inADF = new byte[] { + (byte) 0x82, (byte) 0x02, (byte) 0x78, (byte) 0x21, + (byte) 0x83, (byte) 0x02, (byte) 0x00, (byte) 0x00, + (byte) 0x8A, (byte) 0x01, (byte) 0x05, + (byte) 0x8B, (byte) 0x03, (byte) 0x6F, (byte) 0x06, (byte) 0x01, + (byte) 0x81, (byte) 0x02, (byte) 0x00, (byte) 0x01, + (byte) 0xC6, (byte) 0x06, (byte) 0x90, (byte) 0x01, (byte) 0x80, (byte) 0x83, (byte) 0x01, (byte) 0x01 + }; + + + private final short DF_FID_OFFSET = 6; + + private byte[] resizeFileBuffer = new byte[] { + (byte) 0x83, (byte) 0x02, (byte) 0x00, (byte) 0x00, + (byte) 0x80, (byte) 0x02, (byte) 0x00, (byte) 0x00 + }; + + private final short RESIZE_FID_OFFSET = 2; + private final short RESIZE_SIZE_OFFSET = 7; + + private final byte[] TEXT = new byte[] { + (byte) 'C', (byte) 'o', (byte) 'n', (byte) 't', (byte) '1' + }; + + + + /** + * Constructor of the applet + */ + public Api_1_Cont_1() { + editHandler = (EditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, + (short) TLVHANDLER_MAX_SIZE); + uiccTestConstants = new UICCTestConstants(); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, adf1Aid, (short) 0, + (short) adf1Aid.length); + + data = new byte[10]; + resp = new byte[10]; + abExpected = new byte[10]; + + abPatt = new byte[10]; + asResp = new short[10]; + + checkFCP = new byte[2]; + } + + + /** + * Method called by the JCRE at the installation of the applet + * + * @param bArray + * @param bOffset + * @param bLength + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance + Api_1_Cont_1 thisApplet = new Api_1_Cont_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short) (bOffset + 1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Check that the current DF present in the global array fcp[] of + * length fcpLen corresponds to the fid given as parameter. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP(short fid) { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + checkFCP[0] = (byte) ((fid >> 8) & 0x00FF); + checkFCP[1] = (byte) (fid & 0x00FF); + return (editHandler.findAndCompareValue((byte) 0x83, checkFCP, (short) 0) == 0); + } + + + private void prepareHandler(EditHandler handler, byte[] array, short offset, short fid) { + array[offset] = (byte) ((fid >> 8) & 0x00FF); + array[(short)(offset+1)] = (byte) ((fid) & 0x00FF); + handler.clear(); + handler.appendArray(array, (short) 0,(short) array.length); + } + + + /** + * Method called by the CAT RE + * + * @param event + */ + public void processToolkit(short event) { + switch (testCaseNb) { + /** Testcase 0 + * + */ + case 0: + uiccFileView1 = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + uiccFileView2 = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + adf1FileView1 = UICCSystem.getTheFileView(adf1Aid, (short) 0, (byte) adf1Aid.length, JCSystem.CLEAR_ON_RESET); + adf1FileView2 = UICCSystem.getTheFileView(adf1Aid, (short) 0, (byte) adf1Aid.length, JCSystem.CLEAR_ON_RESET); + + uiccAdminFileView1 = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + uiccAdminFileView2 = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + adf1AdminFileView1 = AdminFileViewBuilder.getTheAdminFileView(adf1Aid, (short) 0, (byte) adf1Aid.length, JCSystem.CLEAR_ON_RESET); + adf1AdminFileView2 = AdminFileViewBuilder.getTheAdminFileView(adf1Aid, (short) 0, (byte) adf1Aid.length, JCSystem.CLEAR_ON_RESET); + testCaseNb++; + break; + + /** Testcase 1 + * Select and status + */ + case 1: + bRes = true; + + //1 + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_TARU); + + //2 + try { + uiccFileView1.select(UICCTestConstants.FID_ADF); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //3 + uiccFileView2.select(UICCTestConstants.FID_EF_UICC); + + //4 + try { + uiccFileView2.select(UICCTestConstants.FID_ADF); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //5 + adf1FileView1.select(UICCConstants.FID_DF_TELECOM); + + //6 + try { + adf1FileView1.select(UICCTestConstants.FID_MF); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //7 + adf1FileView2.select(UICCTestConstants.FID_DF_TEST); + adf1FileView2.select(UICCTestConstants.FID_DF_SUB_TEST); + + //8 + try { + adf1FileView2.select(UICCTestConstants.FID_MF); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //9,10,11,12 + try { + fcpLen = uiccFileView1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_DF_TEST); + fcpLen = uiccFileView2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + fcpLen = adf1FileView1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCConstants.FID_DF_TELECOM); + fcpLen = adf1FileView2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_DF_SUB_TEST); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 2 + * Select SFI + */ + case 2: + bRes = true; + + //1 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(SFI_EF_TNR); + uiccFileView1.deactivateFile(); + } catch (Exception e) { + bRes = false; + } + + //2 + try { + uiccFileView1.select(SFI_NA1); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //3 + try { + uiccFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccFileView2.select(SFI_EF_TARU); + + // update EF TARU with 01 01 + data[0] = (byte) 0x01; + data[1] = (byte) 0x01; + uiccFileView2.updateBinary((short) 0, data, (short) 0, (short) 2); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + uiccFileView2.select(SFI_NA2); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //5 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(SFI_EF_CNR); + adf1FileView1.deactivateFile(); + } catch (Exception e) { + bRes = false; + } + + //6 + try { + adf1FileView1.select(SFI_NA1); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //7 + try { + adf1FileView2.select(UICCTestConstants.FID_DF_TEST); + adf1FileView2.select(SFI_EF_TARU); + + // update EF TARU with 02 02 + data[0] = (byte) 0x02; + data[1] = (byte) 0x02; + adf1FileView2.updateBinary((short) 0, data, (short) 0, (short) 2); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + adf1FileView2.select(SFI_NA2); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 3 + * ReadBinary and updateBinary + */ + case 3: + bRes = true; + + //3 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_TARU); + + // update EF TARU with 01 01 01 01 + data[0] = (byte) 0x01; + data[1] = (byte) 0x01; + data[2] = (byte) 0x01; + data[3] = (byte) 0x01; + uiccFileView1.updateBinary((short) 0, data, (short) 0, (short) 4); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + uiccFileView1.readBinary((short) 0, resp, (short) 0, (short) 4); + bRes &= (Util.arrayCompare(data, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //5 + try { + uiccFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccFileView2.select(UICCTestConstants.FID_EF_TARU); + + // update EF TARU with 02 02 at offset 2 + data[2] = (byte) 0x02; + data[3] = (byte) 0x02; + uiccFileView2.updateBinary((short) 2, data, (short) 2, (short) 2); + } catch (Exception e) { + bRes = false; + } + + //6 + try { + uiccFileView2.readBinary((short) 0, resp, (short) 0, (short) 4); + bRes &= (Util.arrayCompare(data, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //7 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_TARU); + + // update EF TARU with 03 03 03 03 + data[0] = (byte) 0x03; + data[1] = (byte) 0x03; + data[2] = (byte) 0x03; + data[3] = (byte) 0x03; + adf1FileView1.updateBinary((short) 0, data, (short) 0, (short) 4); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + adf1FileView1.readBinary((short) 0, resp, (short) 0, (short) 4); + bRes &= (Util.arrayCompare(data, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //9 + try { + adf1FileView2.select(UICCTestConstants.FID_DF_TEST); + adf1FileView2.select(UICCTestConstants.FID_EF_TARU); + + // update EF TARU with 04 04 at offset 2 + data[2] = (byte) 0x04; + data[3] = (byte) 0x04; + adf1FileView2.updateBinary((short) 2, data, (short) 2, (short) 2); + } catch (Exception e) { + bRes = false; + } + + //10 + try { + adf1FileView2.readBinary((short) 0, resp, (short) 0, (short) 4); + bRes &= (Util.arrayCompare(data, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 4 + * SearchRecord + */ + case 4: + bRes = true; + + //3 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_LUPC); + + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x22; + + uiccFileView1.searchRecord(SIMPLE_SEARCH_START_FORWARD, (short) 1, (short) 0, + abPatt, (short) 0, (short) abPatt.length, asResp, (short) 0, + (short) asResp.length); + bRes &= (asResp[0] == 2); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x33; + + uiccFileView1.updateRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, abPatt, + (short) 0, (short) abPatt.length); + } catch (Exception e) { + bRes = false; + } + + //5 + try { + uiccFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccFileView2.select(UICCTestConstants.FID_EF_LUPC); + uiccFileView2.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, abPatt, + (short) 0, (short) abPatt.length); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.RECORD_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //6 + try { + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x22; + + bRes &= (uiccFileView2.searchRecord(SIMPLE_SEARCH_START_FORWARD, (short) 1, (short) 0, + abPatt, (short) 0, (short) abPatt.length, asResp, (short) 0, + (short) asResp.length) == 0); + } catch (Exception e) { + bRes = false; + } + + //7 + try { + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x33; + + uiccFileView2.searchRecord(SIMPLE_SEARCH_START_FORWARD, (short) 1, (short) 0, + abPatt, (short) 0, (short) abPatt.length, asResp, (short) 0, + (short) asResp.length); + bRes &= (asResp[0] == 2); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_LUPC); + + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x33; + + bRes &= (adf1FileView1.searchRecord(SIMPLE_SEARCH_START_FORWARD, (short) 1, (short) 0, + abPatt, (short) 0, (short) abPatt.length, asResp, (short) 0, + (short) asResp.length)== 0); + } catch (Exception e) { + bRes = false; + } + + //9 + try { + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x22; + + adf1FileView1.searchRecord(SIMPLE_SEARCH_START_FORWARD, (short) 1, (short) 0, + abPatt, (short) 0, (short) abPatt.length, asResp, (short) 0, + (short) asResp.length); + bRes &= (asResp[0] == 2); + } catch (Exception e) { + bRes = false; + } + + //10 + try { + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x11; + + adf1FileView1.updateRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, abPatt, + (short) 0, (short) abPatt.length); + } catch (Exception e) { + bRes = false; + } + + //11 + try { + adf1FileView2.select(UICCTestConstants.FID_DF_TEST); + adf1FileView2.select(UICCTestConstants.FID_EF_LUPC); + + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x22; + + bRes &= (adf1FileView2.searchRecord(SIMPLE_SEARCH_START_FORWARD, (short) 1, (short) 0, + abPatt, (short) 0, (short) abPatt.length, asResp, (short) 0, + (short) asResp.length) == 0); + } catch (Exception e) { + bRes = false; + } + + //12 + try { + for (i = 0; i < 10; i++) + abPatt[i] = (byte) 0x11; + + adf1FileView2.searchRecord(SIMPLE_SEARCH_START_FORWARD, (short) 1, (short) 0, + abPatt, (short) 0, (short) abPatt.length, asResp, (short) 0, + (short) asResp.length); + bRes &= (asResp[0] == 1); + bRes &= (asResp[1] == 2); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 5 + * readRecord and updateRecord + */ + case 5: + bRes = true; + + //3 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_LARU); + + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0x66; + + uiccFileView1.updateRecord((short) 0, REC_ACC_MODE_NEXT, (short) 0, abPatt, + (short) 0, (short) 4); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + uiccFileView1.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 4); + bRes &= (Util.arrayCompare(abPatt, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //5 + try { + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0xAA; + + uiccFileView1.readRecord((short) 0, REC_ACC_MODE_NEXT, (short) 0, resp, (short) 0, + (short) 4); + bRes &= (Util.arrayCompare(abPatt, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //6 + try { + uiccFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccFileView2.select(UICCTestConstants.FID_EF_LARU); + uiccFileView2.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 4); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.RECORD_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //7 + try { + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0xBB; + + uiccFileView2.updateRecord((short) 2, REC_ACC_MODE_ABSOLUTE, (short) 0, abPatt, + (short) 0, (short) 4); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0x66; + + uiccFileView2.readRecord((short) 0, REC_ACC_MODE_NEXT, (short) 0, resp, (short) 0, + (short) 4); + bRes &= (Util.arrayCompare(abPatt, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //9 + try { + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0xBB; + + uiccFileView2.readRecord((short) 0, REC_ACC_MODE_NEXT, (short) 0, resp, (short) 0, + (short) 4); + bRes &= (Util.arrayCompare(abPatt, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //10 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_LARU); + + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0x44; + + adf1FileView1.updateRecord((short) 0, REC_ACC_MODE_NEXT, (short) 0, abPatt, + (short) 0, (short) 4); + } catch (Exception e) { + bRes = false; + } + + //11 + try { + adf1FileView1.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 4); + bRes &= (Util.arrayCompare(abPatt, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //12 + try { + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0xAA; + + adf1FileView1.readRecord((short) 0, REC_ACC_MODE_NEXT, (short) 0, resp, (short) 0, + (short) 4); + bRes &= (Util.arrayCompare(abPatt, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //13 + try { + adf1FileView2.select(UICCTestConstants.FID_DF_TEST); + adf1FileView2.select(UICCTestConstants.FID_EF_LARU); + adf1FileView2.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 4); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.RECORD_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //14 + try { + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0x99; + + adf1FileView1.updateRecord((short) 2, REC_ACC_MODE_ABSOLUTE, (short) 0, abPatt, + (short) 0, (short) 4); + } catch (Exception e) { + bRes = false; + } + + //15 + try { + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0x44; + + adf1FileView2.readRecord((short) 0, REC_ACC_MODE_NEXT, (short) 0, resp, (short) 0, + (short) 4); + bRes &= (Util.arrayCompare(abPatt, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //16 + try { + for (i = 0; i < 4; i++) + abPatt[i] = (byte) 0x99; + + adf1FileView2.readRecord((short) 0, REC_ACC_MODE_NEXT, (short) 0, resp, (short) 0, + (short) 4); + bRes &= (Util.arrayCompare(abPatt, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + + break; + + /** test case 6 + * ActivateFile and deactivateFile + */ + case 6: + bRes = true; + + //3 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_TNU); + uiccFileView1.deactivateFile(); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + uiccFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccFileView2.select(UICCTestConstants.FID_EF_TNU); + uiccFileView2.readBinary((short) 0, resp, (short) 0, (short) 3); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } catch (Exception e) { + bRes = false; + } + + //5 + try { + uiccFileView2.activateFile(); + uiccFileView2.readBinary((short) 0, resp, (short) 0, (short) 3); + + for (i = 0; i < 3; i++) + data[i] = (byte) 0x55; + + bRes &= (Util.arrayCompare(data, (short) 0, resp, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //6 + try { + uiccFileView2.deactivateFile(); + } catch (Exception e) { + bRes = false; + } + + //7 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_TNU); + adf1FileView1.readBinary((short) 0, resp, (short) 0, (short) 3); + + for (i = 0; i < 3; i++) + data[i] = (byte) 0x55; + + bRes &= (Util.arrayCompare(data, (short) 0, resp, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + adf1FileView1.deactivateFile(); + } catch (Exception e) { + bRes = false; + } + + //9 + try { + adf1FileView2.select(UICCTestConstants.FID_DF_TEST); + adf1FileView2.select(UICCTestConstants.FID_EF_TNU); + adf1FileView2.readBinary((short) 0, resp, (short) 0, (short) 3); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } catch (Exception e) { + bRes = false; + } + + //10 + try { + adf1FileView2.activateFile(); + adf1FileView2.readBinary((short) 0, resp, (short) 0, (short) 3); + + for (i = 0; i < 3; i++) + data[i] = (byte) 0x55; + + bRes &= (Util.arrayCompare(data, (short) 0, resp, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 7 + * Increase + */ + case 7: + bRes = true; + data[0] = (byte) 0; + data[1] = (byte) 0; + data[2] = (byte) 1; + + //3 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_CARU); + + for (i = 0; i < 3; i++) + abPatt[i] = (byte) 0x00; + + uiccFileView1.updateRecord((short) 0, REC_ACC_MODE_PREVIOUS, (short) 0, abPatt, + (short) 0, (short) 3); + uiccFileView1.updateRecord((short) 0, REC_ACC_MODE_PREVIOUS, (short) 0, abPatt, + (short) 0, (short) 3); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + uiccFileView1.increase(data, (short) 0, (short) 3, resp, (short) 0); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 1; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //5 + try { + uiccFileView1.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 3); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 1; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //6 + try { + uiccFileView1.readRecord((short) 0, REC_ACC_MODE_PREVIOUS, (short) 0, resp, + (short) 0, (short) 3); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 0; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //7 + try { + uiccFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccFileView2.select(UICCTestConstants.FID_EF_CARU); + uiccFileView2.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 3); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.RECORD_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + uiccFileView2.increase(data, (short) 0, (short) 3, resp, (short) 0); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 2; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //9 + try { + uiccFileView2.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 3); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 2; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //10 + try { + uiccFileView2.readRecord((short) 0, REC_ACC_MODE_PREVIOUS, (short) 0, resp, + (short) 0, (short) 3); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 1; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //11 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_CARU); + adf1FileView1.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 3); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.RECORD_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //12 + try { + adf1FileView1.updateRecord((short) 0, REC_ACC_MODE_PREVIOUS, (short) 0, abPatt, + (short) 0, (short) 3); + adf1FileView1.updateRecord((short) 0, REC_ACC_MODE_PREVIOUS, (short) 0, abPatt, + (short) 0, (short) 3); + } catch (Exception e) { + bRes = false; + } + + //13 + try { + data[0] = (byte) 0; + data[1] = (byte) 0; + data[2] = (byte) 2; + adf1FileView1.increase(data, (short) 0, (short) 3, resp, (short) 0); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 2; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //14 + try { + adf1FileView1.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 3); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 2; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //15 + try { + adf1FileView1.readRecord((short) 0, REC_ACC_MODE_PREVIOUS, (short) 0, resp, + (short) 0, (short) 3); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 0; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //16 + try { + adf1FileView2.select(UICCTestConstants.FID_DF_TEST); + adf1FileView2.select(UICCTestConstants.FID_EF_CARU); + adf1FileView2.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 3); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.RECORD_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //17 + try { + data[0] = (byte) 0; + data[1] = (byte) 0; + data[2] = (byte) 2; + adf1FileView2.increase(data, (short) 0, (short) 3, resp, (short) 0); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 4; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //18 + try { + adf1FileView2.readRecord((short) 0, REC_ACC_MODE_CURRENT, (short) 0, resp, + (short) 0, (short) 3); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 4; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + + //19 + try { + adf1FileView2.readRecord((short) 0, REC_ACC_MODE_PREVIOUS, (short) 0, resp, + (short) 0, (short) 3); + abExpected[0] = (byte) 0; + abExpected[1] = (byte) 0; + abExpected[2] = (byte) 2; + bRes &= (Util.arrayCompare(resp, (short) 0, abExpected, (short) 0, (short) 3) == 0); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 8 + * CreateFile EF + */ + case 8: + bRes = true; + + + //3 + try { + uiccAdminFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView1.select(UICCTestConstants.FID_EF_RFU0); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //4 & 5 + try { + prepareHandler(editHandler, createFileEFBuffer, EF_FID_OFFSET, UICCTestConstants.FID_EF_RFU0); + uiccAdminFileView1.createFile(editHandler); + uiccAdminFileView1.select(UICCTestConstants.FID_EF_RFU0); + } catch (Exception e) { + bRes = false; + } + + //6 + try { + uiccAdminFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView2.select(UICCTestConstants.FID_EF_RFU0); + } catch (Exception e) { + bRes = false; + } + + //7 + try { + uiccAdminFileView2.select(UICCTestConstants.FID_EF_RFU1); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + prepareHandler(editHandler, createFileEFBuffer, EF_FID_OFFSET, UICCTestConstants.FID_EF_RFU1); + uiccAdminFileView1.createFile(editHandler); + uiccAdminFileView1.select(UICCTestConstants.FID_EF_RFU1); + } catch (Exception e) { + bRes = false; + } + + //9 & 10 + try { + uiccAdminFileView1.select(UICCTestConstants.FID_EF_RFU1); + uiccAdminFileView1.select(UICCTestConstants.FID_EF_RFU0); + } catch (Exception e) { + bRes = false; + } + + //11 + try { + adf1AdminFileView1.select(UICCTestConstants.FID_DF_TEST); + adf1AdminFileView1.select(UICCTestConstants.FID_EF_RFU0); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //12 & 13 + try { + prepareHandler(editHandler, createFileEFBuffer_inADF, EF_FID_OFFSET, UICCTestConstants.FID_EF_RFU0); + adf1AdminFileView1.createFile(editHandler); + adf1AdminFileView1.select(UICCTestConstants.FID_EF_RFU0); + } catch (Exception e) { + bRes = false; + } + + //14 + try { + adf1AdminFileView2.select(UICCTestConstants.FID_DF_TEST); + adf1AdminFileView2.select(UICCTestConstants.FID_EF_RFU0); + } catch (Exception e) { + bRes = false; + } + + //15 + try { + adf1AdminFileView2.select(UICCTestConstants.FID_EF_RFU1); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //16 & 17 & 18 + try { + prepareHandler(editHandler, createFileEFBuffer_inADF, EF_FID_OFFSET, UICCTestConstants.FID_EF_RFU1); + adf1AdminFileView2.createFile(editHandler); + adf1AdminFileView2.select(UICCTestConstants.FID_EF_RFU1); + adf1AdminFileView2.select(UICCTestConstants.FID_EF_RFU0); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 9 + * CreateFile DF + */ + case 9: + bRes = true; + + //3 + try { + uiccAdminFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView1.select(UICCTestConstants.FID_DF_RFU1); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //4 & 5 + try { + prepareHandler(editHandler, createFileDFBuffer, DF_FID_OFFSET, UICCTestConstants.FID_DF_RFU1); + uiccAdminFileView1.createFile(editHandler); + uiccAdminFileView1.select(UICCTestConstants.FID_DF_RFU1); + } catch (Exception e) { + bRes = false; + } + + + //6 + try { + uiccAdminFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView2.select(UICCTestConstants.FID_DF_RFU1); + } catch (Exception e) { + bRes = false; + } + + + //7 + try { + uiccAdminFileView2.select(UICCTestConstants.FID_DF_RFU2); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + prepareHandler(editHandler, createFileDFBuffer2, DF_FID_OFFSET, UICCTestConstants.FID_DF_RFU2); + uiccAdminFileView2.createFile(editHandler); + uiccAdminFileView2.select(UICCTestConstants.FID_DF_RFU2); + } catch (Exception e) { + bRes = false; + } + + + //9 & 10 + try { + uiccAdminFileView1.select(UICCTestConstants.FID_DF_RFU2); + uiccAdminFileView1.select(UICCTestConstants.FID_DF_RFU1); + } catch (Exception e) { + bRes = false; + } + + //11 + try { + adf1AdminFileView1.select(UICCTestConstants.FID_DF_RFU1); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //12 & 13 + try { + prepareHandler(editHandler, createFileDFBuffer_inADF, DF_FID_OFFSET, UICCTestConstants.FID_DF_RFU1); + adf1AdminFileView1.createFile(editHandler); + adf1AdminFileView1.select(UICCTestConstants.FID_DF_RFU1); + } catch (Exception e) { + bRes = false; + } + + //14 + try { + adf1AdminFileView2.select(UICCTestConstants.FID_DF_RFU1); + } catch (Exception e) { + bRes = false; + } + + //15 + try { + adf1AdminFileView2.select(UICCTestConstants.FID_DF_RFU2); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //16 & 17 & 18 + try { + prepareHandler(editHandler, createFileDFBuffer2_inADF, DF_FID_OFFSET, UICCTestConstants.FID_DF_RFU2); + adf1AdminFileView2.createFile(editHandler); + adf1AdminFileView2.select(UICCTestConstants.FID_DF_RFU2); + adf1AdminFileView2.select(UICCTestConstants.FID_DF_RFU1); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 10 + * ResizeFile + */ + case 10: + bRes = true; + abExpected[0] = (byte) 0x00; + abExpected[1] = (byte) 0x00; + abExpected[2] = (byte) 0x00; + abExpected[3] = (byte) 0xFF; + abExpected[4] = (byte) 0xFF; + abExpected[5] = (byte) 0xFF; + + //3 + try { + uiccAdminFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView1.select(UICCTestConstants.FID_EF_TDAC); + uiccAdminFileView1.readBinary((short) 0, resp, (short) 0, (short) 6); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.OUT_OF_FILE_BOUNDARIES); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + resizeFileBuffer[RESIZE_FID_OFFSET] = (byte) ((UICCTestConstants.FID_EF_TDAC >> 8) & 0x00FF); + resizeFileBuffer[RESIZE_FID_OFFSET+1] = (byte) (UICCTestConstants.FID_EF_TDAC & 0x00FF); + resizeFileBuffer[RESIZE_SIZE_OFFSET]= (byte) 0x06; // new size: add 3 + prepareHandler(editHandler, resizeFileBuffer, RESIZE_FID_OFFSET, UICCTestConstants.FID_EF_TDAC); + uiccAdminFileView1.resizeFile(editHandler); + uiccAdminFileView1.readBinary((short) 0, resp, (short) 0, (short) 6); + bRes &= (Util.arrayCompare(abExpected, (short) 0, resp, (short) 0, (short) 6) == 0); + } catch (Exception e) { + bRes = false; + } + + //5 + try { + uiccAdminFileView2.select(UICCTestConstants.FID_MF); + uiccAdminFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView2.select(UICCTestConstants.FID_EF_TDAC); + uiccAdminFileView2.readBinary((short) 0, resp, (short) 0, (short) 6); + bRes &= (Util.arrayCompare(abExpected, (short) 0, resp, (short) 0, (short) 6) == 0); + } catch (Exception e) { + bRes = false; + } + + //6 + try { + resizeFileBuffer[RESIZE_SIZE_OFFSET] = (byte) 0x04; // new size: remove 2 + prepareHandler(editHandler, resizeFileBuffer, RESIZE_FID_OFFSET, UICCTestConstants.FID_EF_TDAC); + uiccAdminFileView1.resizeFile(editHandler); + } catch (Exception e) { + bRes = false; + } + + //7 + try { + adf1AdminFileView1.select(UICCTestConstants.FID_DF_TEST); + adf1AdminFileView1.select(UICCTestConstants.FID_EF_LNU); + adf1AdminFileView1.readRecord((short) 4, REC_ACC_MODE_ABSOLUTE, (short) 0, abPatt, + (short) 0, (short) 4); + bRes = false; + } catch (UICCException e) { + bRes &= (e.getReason() == UICCException.RECORD_NOT_FOUND); + } catch (Exception e) { + bRes = false; + } + + //8 + try { + resizeFileBuffer[RESIZE_FID_OFFSET] = (byte) ((UICCTestConstants.FID_EF_LNU >> 8) & 0x00FF); + resizeFileBuffer[RESIZE_FID_OFFSET+1] = (byte) (UICCTestConstants.FID_EF_LNU & 0x00FF); + resizeFileBuffer[RESIZE_SIZE_OFFSET] = (byte) 0x10; // new size: add 2 records + prepareHandler(editHandler, resizeFileBuffer, RESIZE_FID_OFFSET, UICCTestConstants.FID_EF_LNU); + adf1AdminFileView1.resizeFile(editHandler); + adf1AdminFileView1.readRecord((short) 4, REC_ACC_MODE_ABSOLUTE, (short) 0, resp, + (short) 0, (short) 4); + abExpected[0] = (byte) 0xFF; + abExpected[1] = (byte) 0xFF; + abExpected[2] = (byte) 0xFF; + abExpected[3] = (byte) 0xFF; + bRes &= (Util.arrayCompare(abExpected, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //9 + try { + adf1AdminFileView2.select(UICCTestConstants.FID_DF_TEST); + adf1AdminFileView2.select(UICCTestConstants.FID_EF_LNU); + adf1AdminFileView2.readRecord((short) 4, REC_ACC_MODE_ABSOLUTE, (short) 0, resp, + (short) 0, (short) 4); + bRes &= (Util.arrayCompare(abExpected, (short) 0, resp, (short) 0, (short) 4) == 0); + } catch (Exception e) { + bRes = false; + } + + //10 + try { + resizeFileBuffer[RESIZE_SIZE_OFFSET] = (byte) 0x0C; // new size: remove 1 record + prepareHandler(editHandler, resizeFileBuffer, RESIZE_FID_OFFSET, UICCTestConstants.FID_EF_LNU); + adf1AdminFileView2.resizeFile(editHandler); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + + + /** test case 11 + * Non-shareable files (UICCFileView - UICCFileView) + */ + case 11: + bRes = true; + + //3 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_NOSH); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + uiccFileView2.select(UICCTestConstants.FID_DF_TEST); + uiccFileView2.select(UICCTestConstants.FID_EF_NOSH); + bRes = false; + } catch (UICCException e) { + bRes =true;//&= ((e.getReason() == UICCException.FILE_NOT_FOUND)||(e.getReason() == UICCException.INTERNAL_ERROR)); // TODO: clarification Cf AP22 -> NOT_FOUND OR INTERNAL_ERROR + } catch (Exception e) { + bRes = false; + } + + //5 & 6 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_NOSH); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 12 + * Non-shareable files (FileView - FileView) + */ + case 12: + bRes = true; + + //3 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_NOSH); + } catch (Exception e) { + bRes = false; + } + + //4 + try { + adf1FileView2.select(UICCTestConstants.FID_DF_TEST); + adf1FileView2.select(UICCTestConstants.FID_EF_NOSH); + bRes = false; + } catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.FILE_NOT_FOUND)||(e.getReason() == UICCException.INTERNAL_ERROR)); // TODO: clarification Cf AP22 -> NOT_FOUND OR INTERNAL_ERROR + } catch (Exception e) { + bRes = false; + } + + //5 & 6 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_NOSH); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 13 + * Non-shareable files (UICCFileView - MF) + */ + case 13: + bRes = true; + + //2 & 3 + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_NOSH); + + ProactiveHandler proactiveHandler = ProactiveHandlerSystem.getTheHandler(); + proactiveHandler.initDisplayText((byte) 0x80, (byte) 0x04, TEXT, (short) 0x00, + (short) TEXT.length); + proactiveHandler.send(); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 14 + * Non-shareable files (FileView - ADF) + */ + case 14: + bRes = true; + + //2 & 3 + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_NOSH); + + ProactiveHandler proactiveHandler = ProactiveHandlerSystem.getTheHandler(); + proactiveHandler.initDisplayText((byte) 0x80, (byte) 0x04, TEXT, (short) 0x00, + (short) TEXT.length); + proactiveHandler.send(); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 15 + * Non-shareable files (MF - UICCFileView) + */ + case 15: + bRes = true; + + try { + uiccFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccFileView1.select(UICCTestConstants.FID_EF_NOSH); + bRes = false; + } catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.FILE_NOT_FOUND)||(e.getReason() == UICCException.INTERNAL_ERROR)); // TODO: clarification Cf AP22 -> NOT_FOUND OR INTERNAL_ERROR + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + + break; + + /** test case 16 + * Non-shareable files (ADF - FileView) + */ + case 16: + bRes = true; + + try { + adf1FileView1.select(UICCTestConstants.FID_DF_TEST); + adf1FileView1.select(UICCTestConstants.FID_EF_NOSH); + bRes = false; + } catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.FILE_NOT_FOUND)||(e.getReason() == UICCException.INTERNAL_ERROR)); // TODO: clarification Cf AP22 -> NOT_FOUND OR INTERNAL_ERROR + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb++; + break; + + + /** test case 17 + * Terminated EF/DF + */ + case 17: + bRes = true; + + try { + uiccAdminFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView1.select(UICCTestConstants.FID_EF_TERM); + } catch (Exception e) { + bRes = false; + } + + try { + uiccAdminFileView1.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView1.select(UICCTestConstants.FID_DF_TERM); + } catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + break; + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/Test_Api_1_Cont.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/Test_Api_1_Cont.java new file mode 100644 index 0000000..46afa88 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/Test_Api_1_Cont.java @@ -0,0 +1,560 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.access package part 1 + * Test source for context tests + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_cont; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_1_Cont extends UiccTestModel { + static final String CAP_FILE_PATH = "uicc/test/access/api_1_cont"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + static final String AID_ADF_1 = "A0000000 090005FF FFFFFF89 E0000002"; + static final String DF_TELECOM = "7F10"; + static final String MF = "3F00"; + static final String DF_TEST = "7F4A"; + static final String EF_TNR = "6F01"; + static final String EF_TNU = "6F02"; + static final String EF_TARU = "6F03"; + static final String EF_CNR = "6F04"; + static final String EF_CARU = "6F09"; + static final String EF_LNU = "6F0B"; + static final String EF_LARU = "6F0C"; + static final String EF_TDAC = "6F0F"; + static final String EF_LUPC = "6F18"; + static final String EF_NOSH = "6F19"; + static final String EF_RFU0 = "6F29"; + static final String EF_RFU1 = "6F2A"; + static final String DF_RFU1 = "5F01"; + static final String DF_RFU2 = "5F02"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_1_Cont() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00" + // LV ADF1 access domain DAP + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + /** test case 0 + * Init + */ + // select DF_TELECOM + test.selectFile(MF); + test.selectFile(DF_TELECOM); + test.unrecognizedEnvelope(); + + /** test case 1 + * Select and status + */ + test.unrecognizedEnvelope(); + + + /** test case 2 + * Select SFI + */ + test.unrecognizedEnvelope(); + + //9 + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_TNR); + + //10 + response = test.activate(EF_TNR); + result &= response.checkSw("9000"); + + //11 + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_TARU); + + //12 + response = test.readBinary("0000", "02"); + result &= response.checkData("0101"); + + //13 + test.updateBinary("0000", "FFFFFF"); + + //14 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + test.selectFile(EF_CNR); + + //15 + response = test.activate(EF_CNR); + result &= response.checkSw("9000"); + + //16 + test.selectFile(EF_TARU); + + //17 + response = test.readBinary("0000", "02"); + result &= response.checkData("0202"); + + //18 + test.updateBinary("0000", "FFFFFF"); + + /** test case 3 + * ReadBinary and updateBinary + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.unrecognizedEnvelope(); + + //11 + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_TARU); + response = test.readBinary("0000", "04"); + result &= response.checkData("01010202"); + + //12 + test.updateBinary("0000", "FFFFFFFF"); + + //13 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + test.selectFile(EF_TARU); + response = test.readBinary("0000", "04"); + result &= response.checkData("03030404"); + + //14 + test.updateBinary("0000", "FFFFFFFF"); + + /** test case 4 + * SearchRecord + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + test.verifyPIN("01","31313131FFFFFFFF"); + //Verify ADM2 + test.verifyPIN("0B","3232323232323232"); + //2 + test.unrecognizedEnvelope(); + + + + //13 + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_LUPC); + response = test.readRecord("01", "04", "0A"); + result &= response.checkData("11111111 11111111 1111"); + + //14 + response = test.readRecord("02", "04", "0A"); + result &= response.checkData("33333333 33333333 3333"); + + //15 + test.updateRecord("01", "04", "11111111 11111111 1111"); + + //16 + test.updateRecord("02", "04", "22222222 22222222 2222"); + + //17 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + test.selectFile(EF_LUPC); + response = test.readRecord("01", "04", "0A"); + result &= response.checkData("11111111 11111111 1111"); + + //18 + response = test.readRecord("02", "04", "0A"); + result &= response.checkData("11111111 11111111 1111"); + + //19 + test.updateRecord("01", "04", "11111111 11111111 1111"); + + //20 + test.updateRecord("02", "04", "22222222 22222222 2222"); + + /** test case 5 + * readRecord and updateRecord + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.unrecognizedEnvelope(); + + //17 + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_LARU); + response = test.readRecord("00", "02", "04"); + result &= response.checkData("66666666"); + + //18 + response = test.readRecord("00", "02", "04"); + result &= response.checkData("BBBBBBBB"); + + //19 + test.updateRecord("01", "04", "55555555"); + + //20 + test.updateRecord("02", "04", "AAAAAAAA"); + + //21 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + test.selectFile(EF_LARU); + response = test.readRecord("00", "02", "04"); + result &= response.checkData("44444444"); + + //22 + response = test.readRecord("00", "02", "04"); + result &= response.checkData("99999999"); + + //23 + test.updateRecord("01", "04", "55555555"); + + //24 + test.updateRecord("02", "04", "AAAAAAAA"); + + /** test case 6 + * ActivateFile and deactivateFile + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.unrecognizedEnvelope(); + + //11 + test.selectFile(DF_TEST); + response = test.selectFile(EF_TNU); + result &= response.checkSw("6283"); + + //12 + response = test.activate(EF_TNU); + result &= response.checkSw("9000"); + + //13 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + response = test.selectFile(EF_TNU); + result &= response.checkSw("9000"); + + /** test case 7 + * Increase + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.unrecognizedEnvelope(); + + //20 + test.selectFile(DF_TEST); + test.selectFile(EF_CARU); + response = test.readRecord("00", "04", "03"); + result &= response.checkSw("6A83"); + + //21 + response = test.readRecord("00", "03", "03"); + result &= response.checkData("000001"); + + //22 + response = test.readRecord("00", "03", "03"); + result &= response.checkData("000002"); + + //23 + response = test.updateRecord("00", "03", "AAAAAA"); + result &= response.checkSw("9000"); + + //24 + response = test.updateRecord("00", "03", "555555"); + result &= response.checkSw("9000"); + + //25 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + test.selectFile(EF_CARU); + response = test.readRecord("00", "04", "03"); + result &= response.checkSw("6A83"); + + //26 + response = test.readRecord("00", "03", "03"); + result &= response.checkData("000002"); + + //27 + response = test.readRecord("00", "03", "03"); + result &= response.checkData("000004"); + + //28 + response = test.updateRecord("00", "03", "AAAAAA"); + result &= response.checkSw("9000"); + + //29 + response = test.updateRecord("00", "03", "555555"); + result &= response.checkSw("9000"); + + + + /** test case 8 + * CreateFile EF + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.unrecognizedEnvelope(); + + //21 + test.selectFile(DF_TEST); + result &= test.selectFile(EF_RFU0).checkSw("9000"); + + //22 + result &= test.selectFile(EF_RFU1).checkSw("9000"); + + //23 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + result &= test.selectFile(EF_RFU0).checkSw("9000"); + + //24 + result &= test.selectFile(EF_RFU1).checkSw("9000"); + + /** test case 9 + * CreateFile DF + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.unrecognizedEnvelope(); + + //21 + test.selectFile(DF_TEST); + result &= test.selectFile(DF_RFU1).checkSw("9000"); + + //22 + result &= test.selectFile(DF_RFU2).checkSw("9000"); + + //23 + test.selectApplication(AID_ADF_1); + result &= test.selectFile(DF_RFU1).checkSw("9000"); + + //24 + result &= test.selectFile(DF_RFU2).checkSw("9000"); + + + /** test case 10 + * ResizeFile + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.unrecognizedEnvelope(); + + //11 + test.selectFile(DF_TEST); + test.selectFile(EF_TDAC); + response = test.readBinary("0000", "06"); + result &=(response.checkSw("9000")||response.checkSw("6282")||response.checkSw("6700")); + if (response.checkSw("9000")) + { + result &= response.checkData("000000FF"); + } + + //12 + result &= test.readBinary("0000", "04").checkData("000000FF"); + + //13 + result &= test.resizeFile(EF_TDAC, "03").checkSw("9000"); + + //14 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + test.selectFile(EF_LNU); + response = test.readRecord("00", "04", "04"); + result &= response.checkSw("6A83"); + + //15 + response = test.readRecord("00", "03", "04"); + result &= response.checkData("FFFFFFFF"); + + //16 + result &= test.resizeFile(EF_LNU, "08").checkSw("9000"); + + + + /** test cases 11 & 12 + * Non-shareable files (UICCFileView - UICCFileView) + * Non-shareable files (FileView - FileView) + */ + test.reset(); + test.terminalProfileSession("0101"); + test.unrecognizedEnvelope(); + test.reset(); + test.terminalProfileSession("010101"); + test.unrecognizedEnvelope(); + + /** test case 13 + * Non-shareable files (UICCFileView - MF) + */ + //1 + test.unrecognizedEnvelope(); + + //4 + test.selectFile(DF_TEST); + result &= test.selectFile(EF_NOSH).checkSw("6985"); + + //5 + test.fetch("13"); + response = test.terminalResponse("81030121 80820282 81830100"); + + /** test case 14 + * Non-shareable files (FileView - ADF) + */ + //1 + test.unrecognizedEnvelope(); + + //4 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + result &= test.selectFile(EF_NOSH).checkSw("6985"); + + //5 + test.fetch("13"); + response = test.terminalResponse("81030121 80820282 81830100"); + + /** test case 15 + * Non-shareable files (MF - UICCFileView) + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.selectFile(DF_TEST); + result &= test.selectFile(EF_NOSH).checkSw("9000"); + + //3 + test.unrecognizedEnvelope(); + + /** test case 16 + * Non-shareable files (ADF - FileView) + */ + //1 + test.reset(); + test.terminalProfileSession("0101"); + + //2 + test.selectApplication(AID_ADF_1); + test.selectFile(DF_TEST); + result &= test.selectFile(EF_NOSH).checkSw("9000"); + + //3 + test.unrecognizedEnvelope(); + + + /** test case 17 + * Terminated EF/DF + */ + + test.reset(); + test.terminalProfileSession("0101"); + test.unrecognizedEnvelope(); + + /** Remove the created test EF + * + */ + + test.selectFile(MF); + test.selectFile(DF_TEST); + test.deleteFile(DF_RFU1); + test.deleteFile(EF_RFU0); + test.deleteFile(EF_RFU1); + + + test.selectApplication(AID_ADF_1); + test.deleteFile(DF_RFU1); + test.selectFile(DF_TEST); + test.deleteFile(EF_RFU0); + test.deleteFile(EF_RFU1); + + + + /** + * Check Results and delete packages + */ + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "11CCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCC"); + + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/applet.opt new file mode 100644 index 0000000..85eff8f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_cont.Api_1_Cont_1 +uicc.test.access.api_1_cont +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/javacard/api_1_cont.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_cont/javacard/api_1_cont.cap new file mode 100644 index 0000000000000000000000000000000000000000..df2149848761b2463405f6892c61e7baf9da905b GIT binary patch literal 14298 zcmd5@d3amZl|OpBp0+1hwx8rp-W{io9Vv^m7{}Oz1PBd;Wja99V4N=@X>1ZhX{H@6 zNgx|BAkqLshOaZw45bLt!cZu~^1(nU5EzEFr5kP8%F^Y7X(>{>Eh#7oHk?G;!mC+ zO08Hnx~0c_;F>=+Z2r0b(W>A%qfcGAZDhvke>!LBitnvE@X!e}|MrJ7dpbiyXWuhx z(Txv0^U{-hFF*Iu3i-i%P8te_Sl4;c!JmBhHz)pe^W(?#R{57VEIjm_aguz^DI1rB zf7SL-;Q9~NM-TjI;D`I!X+1BVvia|~#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<@y?!7+ zCHWET044b;Y=e?Ppdjt%=dnYSOyI}FYnWIIRLi6~wAC@O9;lv)4L}V{i~+@%*a+0fM1Fp|iAl|%nwiuB z)WW1zpjIZe0ktuSE|o5zTcu6hEiSkAI^9N%{Q9uqcGDwtQs(+hdX_r*weE6nrB`sY zbOOX6?I`%}qV#tHZTy?eeD~(AlC&>(&9C-Z^mVi!*WbqV&9v|EVLAY~6?)uCxAM8h zKXeD(N%zwIyaxRqp-1U)dJ5Oi(o2UAyL#j`JtVJLM6QFbhg^%~HL;kyh791VTruUY zyM|nbbk|H}&Q@~Yl|WZz&Nl065edhNaRWUD)mdv|eD literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/Api_1_Fvw_Actf_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/Api_1_Fvw_Actf_1.java new file mode 100644 index 0000000..74d1681 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/Api_1_Fvw_Actf_1.java @@ -0,0 +1,173 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Actf_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_actf; + +import uicc.test.util.* ; +import javacard.framework.*; +import uicc.access.* ; + + +public class Api_1_Fvw_Actf_1 extends TestToolkitApplet +{ + private FileView UiccFileView = null; + + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_1_Fvw_Actf_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_1_Fvw_Actf_1 thisApplet = new Api_1_Fvw_Actf_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes = false; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + + // ----------------------------------------------------------------- + // Test Case 1 : No EF Selected + // ----------------------------------------------------------------- + testCaseNb = 1; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + try + { + UiccFileView.activateFile(); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.NO_EF_SELECTED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2 : Activate a deactivated file + // ----------------------------------------------------------------- + testCaseNb = 2; + bRes = false; + UiccFileView.select((short)UICCTestConstants.FID_MF); + UiccFileView.select((short)UICCTestConstants.FID_EF_UICC); + // Points 2 and 3 + try + { + byte rdBuff[] = new byte [1]; + UiccFileView.readBinary((short)0, rdBuff, (short)0, (short)1); + UiccFileView.deactivateFile(); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + // Point 4 + try + { + byte rdBuff[] = new byte [1]; + UiccFileView.readBinary((short)0, rdBuff, (short)0, (short)1); + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.REF_DATA_INVALIDATED) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + // Point 5 and 6 + try + { + byte rdBuff[] = new byte [1]; + UiccFileView.activateFile(); + UiccFileView.readBinary((short)0, rdBuff, (short)0, (short)1); + bRes &= true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3 : Activate an activated file + // ----------------------------------------------------------------- + testCaseNb = 3; + bRes = false; + try + { + UiccFileView.activateFile(); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4 : Access condition not fulfilled + // ----------------------------------------------------------------- + testCaseNb = 4; + bRes = false; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + UiccFileView.select((short)UICCTestConstants.FID_EF_LADA); + try + { + UiccFileView.activateFile(); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.SECURITY_STATUS_NOT_SATISFIED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/Test_Api_1_Fvw_Actf.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/Test_Api_1_Fvw_Actf.java new file mode 100644 index 0000000..00c6eba --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/Test_Api_1_Fvw_Actf.java @@ -0,0 +1,93 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_actf; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_1_Fvw_Actf extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_actf"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Actf() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "811E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402FFFDFF" + // LV Access Domain for UICC file system = All except ADM2 + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402FFFDFF" + // LV Access Domain for ADF1 file system = All except ADM22 + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "04" + "CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/applet.opt new file mode 100644 index 0000000..530c9a9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_actf.Api_1_Fvw_Actf_1 +uicc.test.access.api_1_fvw_actf +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/javacard/api_1_fvw_actf.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_actf/javacard/api_1_fvw_actf.cap new file mode 100644 index 0000000000000000000000000000000000000000..c65c6914ef45b249589c039b76a549edb3f2f26f GIT binary patch literal 4729 zcmb7H3sh9s72Wr}H~#^K5pWO(6@$SK45P)UAPOic@(BtmYKRWwLq?DpXGTPgl}{r6 z0;bVejRv$aPKo%LjN!j&zBp~mh(TljIw9q)`Te-H`YmDSt7o5X zE!uPSUm;0l=KUL7hiX3m%Y^J~+%#Uzj2v?Q{@s*;50CX}eM_fd8TJQDQ|JD=Sll(` zxNhQ&y9&1HxMEw_o2-Atf#oM7;|)ol>@28j{ADk3_wj_u*IwQI;1~xeD&P4v>hMb8gg*(iQ}iNGe+Lnvi#A{Q*$>Sy1$lx z_hrLWPjglJgM04g{daGF{qerrA6|8jn)=z94_SiI0Ft03I&s`LizR$qkGZ}iMq84 zX)afV=#@ZugvqRD1Xa}8zFC8AY?(+H5_JnFYo5#L_TdP~Q^?l2m85Y@)k2>VMyQ=O z!AQNbu25f>e?C}e4a4WnIyj!jB^pW8H82y7DD|GYm6)gIu=`FX6f{uRHI|X^sOaY11+ni|IN^G2Gbg-OsoMW zeg#{swl;wuy#_);l*uflnar`Pp@>=yWmG-41Ztk>r#zKLH8jfP#fli-Y7*Xnp4f#I zY%fBWO=#p0M6E`KARTXYg(nbuuu!fPtS$}xD-wuhAB$d%5R+mBTl_Nrc2MA9b007zSmzI$9_Q!1(9+6nRpZZ_blyDE(^qCbmO# zXsBw}@UdB;&hV!isC=4%i#wmPa&6C*;dC}68qu9oR^YXH9rjFzS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000..e7d3c2d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/Api_1_Fvw_Dacf_1.java @@ -0,0 +1,153 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Dacf_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_dacf; + +import uicc.test.util.* ; +import javacard.framework.*; +import uicc.access.* ; + + +public class Api_1_Fvw_Dacf_1 extends TestToolkitApplet +{ + private FileView UiccFileView = null; + + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_1_Fvw_Dacf_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_1_Fvw_Dacf_1 thisApplet = new Api_1_Fvw_Dacf_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes = false; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + + // ----------------------------------------------------------------- + // Test Case 1 : No EF Selected + // ----------------------------------------------------------------- + testCaseNb = 1; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + try + { + UiccFileView.deactivateFile(); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.NO_EF_SELECTED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2 : Deactivate an activated file + // ----------------------------------------------------------------- + testCaseNb = 2; + bRes = false; + UiccFileView.select((short)UICCTestConstants.FID_MF); + UiccFileView.select((short)UICCTestConstants.FID_EF_UICC); + // Points 2, 3 and 4 + try + { + byte rdBuff[] = new byte [1]; + UiccFileView.readBinary((short)0, rdBuff, (short)0, (short)1); + UiccFileView.deactivateFile(); + UiccFileView.readBinary((short)0, rdBuff, (short)0, (short)1); + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.REF_DATA_INVALIDATED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3 : Deactivate a deactivated file + // ----------------------------------------------------------------- + testCaseNb = 3; + bRes = false; + try + { + UiccFileView.deactivateFile(); + bRes = true; + // Restore EFuicc in its initial state + UiccFileView.activateFile(); + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4 : Access condition not fulfilled + // ----------------------------------------------------------------- + testCaseNb = 4; + bRes = false; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + UiccFileView.select((short)UICCTestConstants.FID_EF_LADA); + try + { + UiccFileView.deactivateFile(); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.SECURITY_STATUS_NOT_SATISFIED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/Test_Api_1_Fvw_Dacf.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/Test_Api_1_Fvw_Dacf.java new file mode 100644 index 0000000..f0c9e0e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/Test_Api_1_Fvw_Dacf.java @@ -0,0 +1,93 @@ +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_dacf; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_1_Fvw_Dacf extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_dacf"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Dacf() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "811E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402FFFDFF" + // LV Access Domain for UICC file system = All except ADM2 + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402FFFDFF" + // LV Access Domain for ADF1 file system = All except ADM2 + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "04" + "CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/applet.opt new file mode 100644 index 0000000..8da9816 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_dacf.Api_1_Fvw_Dacf_1 +uicc.test.access.api_1_fvw_dacf +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/javacard/api_1_fvw_dacf.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_dacf/javacard/api_1_fvw_dacf.cap new file mode 100644 index 0000000000000000000000000000000000000000..f3fa8750fae68e4a98ee481c127948fb49a091d4 GIT binary patch literal 4581 zcmb7H3s6+&75@Hv@4j~d71mXPpp*nrSQkxn7)7VVXDN4r|?L_Ih3uN6pCbIuOXYT(z z-}ztXeAimS3-M4>KEAU4aom^UA)stVWnN}+d6Bs+ue`WuMnz>-S<$`sfJ1Z2JWba@F$a1wVQT-ZWuj1 z@rCqDyZ-hcU-xk9JBb(9@4n|uI+vE=%02SS-z=|GmmTaVJ+(oFcv^ed#$=a##23iM1cI&d+{6 zYI|VPWk=d`?Xy2he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dMM%b|ltu$&gPvQ(|e;0qn27HK%gz*V3qXmDb+)8_Q zm5~04FA41{{F?|sC*`fQx!3VBx^SDY?@-=uEn!?d9drM$)cq7)`jv`I-}YlAY0>uG zy$8|xu$DiOiw?V_0h4< no record) + (byte)0x88,(byte)0x00}; // Tag, Length - SFI (no SFI) + byte testCaseNb = (byte) 0x00; + byte incr[] = null; + byte resp[] = null; + byte data[] = null; + byte comp[] = null; + short incrOffset = 0; + short respOffset = 0; + short incrLength = 0; + short respLength = 0; + + /** + * Constructor of the applet + */ + public Api_1_Fvw_Incr_1() + { + incr = new byte[4]; + resp = new byte[4]; + comp = new byte[4]; + data = new byte[3]; + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_1_Fvw_Incr_1 thisApplet = new Api_1_Fvw_Incr_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes = false; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + UiccAdminFileView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + + // ----------------------------------------------------------------- + // Test Case 1 : No EF Selected + // ----------------------------------------------------------------- + testCaseNb = 1; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + try + { + incrLength = 2; + UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.NO_EF_SELECTED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2 : increase , verify response + // ----------------------------------------------------------------- + testCaseNb = 2; + UiccFileView.select((short)UICCTestConstants.FID_EF_CARU); + try + { + // Set records to 00 00 00 + Util.arrayFillNonAtomic(data, (short)0, (short)data.length, (byte)0); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incr[2] = (byte)1; + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + + // Verify result + Util.arrayFillNonAtomic(comp, (short)0, (short)comp.length, (byte)0); + comp[2] = (byte)1; + if ((respLength == (short)3) && + (Util.arrayCompare(resp, (short)0, comp, (short)0, (short)4) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3 : increase , verify file + // ----------------------------------------------------------------- + testCaseNb = 3; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incr[3] = (byte)2; + incrOffset = 1; + incrLength = 3; + respOffset = 1; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + + // Verify result + Util.arrayFillNonAtomic(resp, (short)0, (short)resp.length, (byte)0); + Util.arrayFillNonAtomic(comp, (short)0, (short)comp.length, (byte)0); + comp[2] = (byte)3; + UiccFileView.readRecord((short)0, REC_ACC_MODE_CURRENT, (short)0, resp, (short)0, (short)3); + if ((respLength == (short)3) && + (Util.arrayCompare(resp, (short)0, comp, (short)0, (short)4) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4 : incr[] is null + // ----------------------------------------------------------------- + testCaseNb = 4; + try + { + // increase + incrOffset = 0; + incrLength = 1; + respOffset = 0; + respLength = UiccFileView.increase(null, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (NullPointerException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 5 : incrLength < 0 + // ----------------------------------------------------------------- + testCaseNb = 5; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 0; + incrLength = -1; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 6 : incrOffset < 0 + // ----------------------------------------------------------------- + testCaseNb = 6; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = -1; + incrLength = 1; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 7 : IncrOffset + incrLength > incr.length + // ----------------------------------------------------------------- + testCaseNb = 7; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 1; + incrLength = 4; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 8 : Reach Maximum Value + // ----------------------------------------------------------------- + testCaseNb = 8; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0xFF); + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.MAX_VALUE_REACHED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + + try + { + // Set records to FF FF FF + Util.arrayFillNonAtomic(data, (short)0, (short)data.length, (byte)0xFF); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incr[2] = (byte)1; + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.MAX_VALUE_REACHED) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 9 : resp[] is null + // ----------------------------------------------------------------- + testCaseNb = 9; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0xFF); + incrOffset = 0; + incrLength = 1; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, null, respOffset); + bRes = false; + } + catch (NullPointerException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 10 : incrLength < 0 + // ----------------------------------------------------------------- + testCaseNb = 10; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 0; + incrLength = 1; + respOffset = -1; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 11 : respOffset + recordLength > resp.length + // ----------------------------------------------------------------- + testCaseNb = 11; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 0; + incrLength = 3; + respOffset = 2; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 12 : Ef is not cyclic + // ----------------------------------------------------------------- + testCaseNb = 12; + try + { + UiccFileView.select((short)UICCTestConstants.FID_EF_TARU); + incr = new byte[3]; + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.COMMAND_INCOMPATIBLE) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + try + { + UiccFileView.select((short)UICCTestConstants.FID_EF_LARU); + // increase + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.COMMAND_INCOMPATIBLE) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 13 : Access condition not fulfilled + // ----------------------------------------------------------------- + testCaseNb = 13; + try + { + UiccFileView.select((short)UICCTestConstants.FID_EF_CNIC); + // increase + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 14 : EF is deactivated + // ----------------------------------------------------------------- + testCaseNb = 14; + try + { + UiccFileView.select((short)UICCTestConstants.FID_EF_CARU); + // deactivated + UiccFileView.deactivateFile(); + // increase + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.REF_DATA_INVALIDATED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + try + { + // activate + UiccFileView.activateFile(); + // Restore Ef content + // Set records to 55 55 55 + Util.arrayFillNonAtomic(data, (short)0, (short)data.length, (byte)0x55); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + // Set records to AA AA AA + Util.arrayFillNonAtomic(data, (short)0, (short)data.length, (byte)0xAA); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + bRes &= true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 15 : incrLength out of range + // ----------------------------------------------------------------- + testCaseNb = 15; + try + { + // Create EF 0x2CFD + incr = new byte[128]; + resp = new byte[0xFF]; + comp = new byte[0xFF]; + createEFCmd = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, (short)abCreateEF.length, abCreateEF, (short)0x00, (short)abCreateEF.length); + UiccAdminFileView.createFile(createEFCmd); + UiccAdminFileView.select((short)0x2C7F); + + Util.arrayFillNonAtomic(comp, (short)0, (short)127, (byte)0xFF); + comp[0] = (byte)0x00; + UiccAdminFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, comp, (short)0, (short)127); + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + Util.arrayFillNonAtomic(resp, (short)0, (short)resp.length, (byte)0); + Util.arrayFillNonAtomic(comp, (short)0, (short)resp.length, (byte)0); + incr[127] = (byte)0x01; + comp[0] = (byte)0x01; + incrOffset = 1; + incrLength = 127; + respOffset = 0; + respLength = UiccAdminFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + // Check result + if ((respLength == (short)0x7F) && + (Util.arrayCompare(resp, (short)0, comp, (short)0, respLength) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + try + { + // increase + incrOffset = 0; + incrLength = 128; + respOffset = 0; + respLength = UiccAdminFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (Exception e) + { + bRes &= true; + } + reportTestOutcome(testCaseNb, bRes); + UiccAdminFileView.deleteFile((short)0x2C7F); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/Test_Api_1_Fvw_Incr.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/Test_Api_1_Fvw_Incr.java new file mode 100644 index 0000000..9290f49 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/Test_Api_1_Fvw_Incr.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_incr; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_1_Fvw_Incr extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_incr"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Incr() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" + // LV Access Domain DAP field + "8218" + // TLV UICC Admin Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "0F" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/applet.opt new file mode 100644 index 0000000..7c80a12 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_incr.Api_1_Fvw_Incr_1 +uicc.test.access.api_1_fvw_incr +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/javacard/api_1_fvw_incr.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_incr/javacard/api_1_fvw_incr.cap new file mode 100644 index 0000000000000000000000000000000000000000..059938114a750cd20092b1f6da0bf8695001c433 GIT binary patch literal 9139 zcmb6<2|$$9*5}-976urUWn@RP++f5l3NaNyQBVT2G7Se9lpx>@gC?4cV21lrR<^p7 zYvWS1XzP2gXUj{iZ2vX0(w=Fi{rxTPRs83hMPRb0e8c&^d(L<7Ip>~p=FGk4QZSy2 zaM07Ib+oRFK7T{I~*Kj-(i0Nh3SHBAF7FW+-6q2WkK z_LLFNeP%hl&>lVLz^uXfeKxOS{Spp0zOwQ91--xc;tBlzhdV#}x;bt6=r<0V<~!Cc zN$&|gHt(FX=I}DzIr}a1cL$63@;PFE)0^o>H}@#s^6JV5&Tp;UH*`bggb}Hh)ArjY ztsJ=jaO;@vdqynX{qwYzmfUG`H_5x=*WwQ!<@W#Q`J%U8KD8!GOlw;Uby@i()o<@V zKX0C+<+T%)LGPj=KW>Y@zbNyUTTZR1@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wf8Jwzq*A2*2!Vj?~v3dGI0 zO-vEfaEG{6*zieFBJAiEu}Cb%RUcohFC9ur&fHL*=RiTj0H?8eu{9?^<#h-btb_@;PMyp3;(1L6R_ zEe?wJ@u2uXe2j<0C*lacD~^hzcvyTUj^PL5b8!+s5?_nccto5L|A)uKkK$K6E`F1M zUrLk$zmihw@q{$USUf4?WFmeolVlQ}l09V~JT3dm6g(qSWg4E91LZ(GCkM&F_`Mt= zGw>%lOpd{S%dzrC{Exgzmf~-+OxEG=(kbU)n{1E`ly>IId5p_DWiyjK44RSXNlY8V|)=ln{e`nq0Yw`e#kO$>^EK(kp$61v8LY`qgAk|n4p70nV=j7num%BlvlWHm&MWLKzBDx39E zIVzW3rN*gotdAP6@>oBWuL{@zb-kL*($tM=3LB_yQPpgas! zQ1jWfs!_GD47FG-W|;-!k%fDfBi@7Yj%Tad!FcEE&yLA8E=J$t=VIru?OZ;>E}T8J zpUMUb2s~PC7htCapJy9!Imf=84q5|c1RkTd%Q)H<8SRIvfdT^0Pum4#^Da!H{WLXD zK;Xe}6ZYzhCnoa|VhDJX>rRbG}Pr{3nfp`~y!D+xZt$#o@B2(SEiVC?K$$ z*Dm0?kS+)aDDDMH39RI`OWEEPDFJo8Kq-Nhpmr(m(0?#owy`?bg#v{HmO$Et45JhJ bE(q}zL<+`BDjET8hfJ`DVkS!4FTwu<+f-+( literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/Api_1_Fvw_Redb_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/Api_1_Fvw_Redb_1.java new file mode 100644 index 0000000..65aa4de --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/Api_1_Fvw_Redb_1.java @@ -0,0 +1,361 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Redb_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_redb; + +import javacard.framework.*; +import uicc.access.*; +import uicc.test.util.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.api_1_fvw_redb + * + * @version 0.0.1 - 6 déc. 2005 + * @author 3GPP T3 SWG API + */ + +public class Api_1_Fvw_Redb_1 extends TestToolkitApplet implements UICCConstants +{ + private FileView UiccFileView = null; + + final short RESP_BUFFER_LENGTH = (short)0x0104; + + byte[] resp = new byte[RESP_BUFFER_LENGTH]; + byte[] compareBuffer = new byte[RESP_BUFFER_LENGTH]; + byte[] nullBuffer = null; + + /** + * Constructor of the applet + */ + public Api_1_Fvw_Redb_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_1_Fvw_Redb_1 thisApplet = new Api_1_Fvw_Redb_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + short result = 0; + short respOffset = 0; + short respLength = 0; + short fileOffset = 0; + + // Result of tests + boolean bRes = false; + byte testCaseNb = 0; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + /*------------------------------------------------------------------ + * TEST CASE 01: Read from a transparent file at offset 0 + *----------------------------------------------------------------*/ + testCaseNb = (byte)0x01; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + + fileOffset = 0; + respOffset = 10; + respLength = 250; + + // Initialise compareBuffer + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)compareBuffer.length,(byte)0xFF); + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)10,(byte)0x55); + // Initialise resp buffer + Util.arrayFillNonAtomic(resp,(short)0,(short)resp.length,(byte)0x55); + + // Call the readBinary() method + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + if (result == (short)(respOffset + respLength)) + bRes = true; + + if (Util.arrayCompare(resp, (short)0, compareBuffer, (short)0, RESP_BUFFER_LENGTH) == 0) + bRes &= true; + + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 02: Read from a transparent file at a given offset + *----------------------------------------------------------------*/ + testCaseNb = (byte)0x02; + bRes = false; + try { + + fileOffset = (short)0x80; + respOffset = (short)0x80; + respLength = 5; + + // Initialise compareBuffer + Util.arrayFillNonAtomic(compareBuffer,(short)respOffset,(short)respLength,(byte)0xFF); + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + if (result == (short)(respOffset + respLength)) + bRes = true; + + if (Util.arrayCompare(resp, (short)0, compareBuffer, (short)0, RESP_BUFFER_LENGTH) == 0) + bRes &= true; + + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 03: Errorcase, fileOffset is negative + *----------------------------------------------------------------*/ + testCaseNb = (byte)0x03; + bRes = false; + try { + fileOffset = (short)-1; + respOffset = 0; + respLength = 10; + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_FILE_BOUNDARIES); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 04: Errorcase, fileOffset + respLength > EF length + *------------------------------------------------------------------*/ + testCaseNb = (byte)0x04; + bRes = false; + try { + fileOffset = (short)259; + respOffset = 0; + respLength = 2; + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_FILE_BOUNDARIES); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 05: Errorcase, resp is null + *------------------------------------------------------------------*/ + testCaseNb = (byte)0x05; + bRes = false; + try { + fileOffset = 0; + respOffset = 0; + respLength = 10; + result = UiccFileView.readBinary(fileOffset, nullBuffer, respOffset, respLength); + bRes = false; + } + catch (NullPointerException npe) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 06: Errorcase, respOffset < 0 + *-------------------------------------------------------------------*/ + testCaseNb = (byte)0x06; + bRes = false; + try { + fileOffset = 0; + respOffset = (short)-1; + respLength = 10; + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 07: Errorcase, respLength < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x07; + bRes = false; + try { + fileOffset = 0; + respOffset = 0; + respLength = (short)-1; + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 08: Errorcase, respOffset + respLength > resp.Length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x08; + bRes = false; + try { + fileOffset = 0; + respOffset = 0xFA; + respLength = 0x0B; + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 09: Errorcase, EF is not transparent + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x09; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + fileOffset = 0; + respOffset = 0; + respLength = 1; + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 10: Errorcase, Access condition not fulfilled + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0A; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TNR); + + fileOffset = 0; + respOffset = 0; + respLength = 1; + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 11: Errorcase, EF is invalidated + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0B; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_TNU); + UiccFileView.deactivateFile(); + + try { + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } + finally { + UiccFileView.activateFile(); + } + + reportTestOutcome(testCaseNb,bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 12: Errorcase, No EF selected + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0C; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.NO_EF_SELECTED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb,bRes); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/Test_Api_1_Fvw_Redb.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/Test_Api_1_Fvw_Redb.java new file mode 100644 index 0000000..3d627a4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/Test_Api_1_Fvw_Redb.java @@ -0,0 +1,94 @@ +//----------------------------------------------------------------------------- +//Test_Api_1_Tvw_Redb.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_redb; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.api_1_fvw_redb + * + * @version 0.0.1 - 6 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_1_Fvw_Redb extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_redb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Redb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" // LV Access Domain DAP field + ); + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 to 12 */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + test.reset(); + test.terminalProfileSession("0101"); + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/applet.opt new file mode 100644 index 0000000..80e1bc3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_redb.Api_1_Fvw_Redb_1 +uicc.test.access.api_1_fvw_redb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/javacard/api_1_fvw_redb.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redb/javacard/api_1_fvw_redb.cap new file mode 100644 index 0000000000000000000000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u8DoVVLm$(yWST=Fx43ETP(1Wy}b(RZJHgZ9?yA zB96u`Dc#7DA`bdkWu}MIAdEQ+7&Nv@V)b(I>Q#-cS39ED$37SK3G{HFmmXa!P4I+& z`p9w_RoDbc{&cI<1gdoDS61!t+uDG3WO2*75&ff|Sj@M=W`4wbI;NE^u?I-~z-K3t za1&-IK*YTnR|eg|I?v)dZ$o646!FL&EwL1&{?NXlyX?%@rBi3L} zFtcAJiqtYelG2H&B^sJe@+7?F(goB>^XV*FK(nQBv>*aCooSRPEK!S(lnJ8hNvfk_ zMyh1c>XMBaCWJZJWJxxeEf$N}l4X%4LvrTuO`WXI(#pxnnX#VzW@**8zeTSYoXPE+tqlG;o%ElXGbpwc}(CTkKltq9>qkAhA76P z4+`N4Y{XL#Zo(Xx$m$Y@l8c-HBMJtv<0+dLx$=jGaQqxZAIZrma+aIm=@{b zig{ep8r5yxraqra record length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x11; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = (short)0x01; + recOffset = (short)0x02; + respLength = (short)0x04; + + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_RECORD_BOUNDARIES); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 18: Read with invalid mode + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x12; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + recNumber = (short)0x00; + recOffset = (short)0x00; + respLength = (short)0x04; + + try { + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,(byte)1,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.INVALID_MODE); + } + catch (Exception e) { + bRes = false; + } + + try { + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,(byte)5,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.INVALID_MODE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 19: resp buffer is null + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x13; + bRes = false; + + try { + recNumber = 1; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,null,respOffset,respLength); + bRes = false; + } + catch(NullPointerException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 20: respOffset < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x14; + bRes = false; + + try { + recNumber = 1; + respOffset = (short)-1; + respLength = 4; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 21: respLength < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x15; + bRes = false; + + try { + recNumber = 1; + respOffset = (short)0; + respLength = (short)-1; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 22: respLength + respOffset > resp.length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x16; + bRes = false; + + try { + recNumber = 1; + respOffset = (short)0x11; + respLength = (short)4; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 23: EF is not a record file + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x17; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + + try { + recNumber = 1; + respOffset = (short)0; + respLength = (short)4; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(UICCException e){ + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 24: Access not fulfilled + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x18; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_CNR); + + try { + recNumber = 1; + respOffset = (short)0; + respLength = (short)3; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(UICCException e){ + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 25: EF is deactivated + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x19; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_CNU); + UiccFileView.deactivateFile(); + + try { + recNumber = 1; + respOffset = (short)0; + respLength = (short)3; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } + finally { + UiccFileView.activateFile(); + } + reportTestOutcome(testCaseNb,bRes); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/Test_Api_1_Fvw_Redr.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/Test_Api_1_Fvw_Redr.java new file mode 100644 index 0000000..97768fc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/Test_Api_1_Fvw_Redr.java @@ -0,0 +1,95 @@ +//----------------------------------------------------------------------------- +//Test_Api_1_Fvw_Redr.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_redr; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.api_1_fvw_redr + * + * @version 0.0.1 - 6 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_1_Fvw_Redr extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_redr"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Redr() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" // LV Access Domain DAP field + ); + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 to 12 */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "19CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCC"); + + test.reset(); + test.terminalProfileSession("0101"); + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/applet.opt new file mode 100644 index 0000000..67f8ab1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_redr.Api_1_Fvw_Redr_1 +uicc.test.access.api_1_fvw_redr +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/javacard/api_1_fvw_redr.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_redr/javacard/api_1_fvw_redr.cap new file mode 100644 index 0000000000000000000000000000000000000000..d0ba5bfd99479878a9abc09d0c8fa871c4256475 GIT binary patch literal 6327 zcmb_g3v83u6+Zv_VLSO9JATA*3@uQbKtfW=Gn8h5tbve*M@73w!8Oie5@P4EwtxbE zl2s`Up&gmD@e+M#;?bl~$aodHR%k>1xm=*-v)Mn>8F^+%7#FqO1 zKL5Sv`rhxHd(OH4{qLz<%&=w<@&4!fvd3V=Wd;_OEL>4MwXC8ve@SsgS?R*%EAp0< ze%lAov+Re#)@iopM?RlFP`}ZA?4?@{-_FAyUwq|CZeUTtMe{Q!%Ll)aOS!l9cSr$s z_olzk{iWTo@WU?irurSPxF>+)$;-9p1AWc+j^u6{(BFJ>{7Vf-m5px*$`1nybyLSp#tq<+pe=eKa_(fjJmQSwjertJmsqvlnUb}Q6`yc18 zE!ul(W$U4phq$ZFmES*nrK-N`QmxPVi?>7TSL}PH{`8Fl8OM)*GTFIn@;OUi!L6bJ z*Ea_)bPouwf8Bfa#H;_S%I&@DzFTne=C>_3Z&VB%+Sk}-II~f_^<|CoV9n;r#e(>k zpv%%s0R%aKN_3$db{uixs)|2ea3V+OQKX*+e7^i9e`8a=*XQ#$Hs*UnfmH>os$O_; zRfB&`L;hOt3tpeMVNL#%e(xH8L!QqYq9E(DzQM04ngvRE12H7v2JzaWU_Dma;{~<9 ze+XL%%|J?8+JZoX-`5muSWg7f;DRh9GgQD2z^*R?nW{vz14wvrltyaCwmEJq{y`|E zITnXPwf-g|k^!@3ZWK^dSM2OoPrk8dDas&}lAN-2paz!;kTQLbH*Qwtq>muCd8m*Hjq{))ISgXm|^a2uLgv zg+wDUw2BP2^FY-zD$qzGPuf}~pxS7lenv<@;(%{sunh;b(G>QR_!fmh(s*yq>DiaE z5s^?KQt~?2dK(*wvOL%qsK5a$qh{2x78+VbN^TXPO&cj&{`1ja%k=<+Qu5#ue^YgE z4G|{j%krpC!A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GcuMbq!Sr1(O64l ztYS=Eur)lG1UeJ_$V%wL$Tt=jXYa^2mSVdP$VLIl1~Y06RabLAPLXoI|ny% zg1|Z_$tGc@oWY1PBMO;}NfvBOK34K&d?-U)v7j@Py3WcdRHic%1X;h zmrb(HXf+$N>^WAu)o3-6TAIV9vlxv!yG>`eyV4wXStlE<4xQbRWzW)CB1C$`)D>&m zBqduhr#Z0ZP_n}Gu##V^AUg9P*H{;Ij~>hwmAKgV?_aX%0yZ4P7uFTMMBCN?{RKJq@TQ zsKZ?KxYsF#?JeMEv;iKkxZaW{_}<O`EiUm;{(shBmR*H5Th)U^CMT%xq&`Qz1!=h3)m{OQa>>I6eF~<`i9p01B<{Qm~`#)9> BBMbll literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/Api_1_Fvw_Sear_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/Api_1_Fvw_Sear_1.java new file mode 100644 index 0000000..9f310d0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/Api_1_Fvw_Sear_1.java @@ -0,0 +1,1841 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Sear_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_sear; + +import javacard.framework.*; +import uicc.toolkit.*; +import uicc.access.* ; +import uicc.test.util.* ; + + +public class Api_1_Fvw_Sear_1 extends TestToolkitApplet implements UICCConstants +{ + private FileView UiccFileView = null; + + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private byte[] RecValue1 = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08, + (byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + private byte[] RecValue2 = {(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x01,(byte)0x02, + (byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09}; + private byte[] RecValue3 = {(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B, + (byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x01,(byte)0x02,(byte)0x03}; + private byte[] RecValue4 = {(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x0F,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06}; + private byte[] RecValue5 = {(byte)0x0A,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x0B,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x0C,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x0D,(byte)0x01,(byte)0x02}; + private byte[] RecValue6 = {(byte)0x03,(byte)0x02,(byte)0x01,(byte)0x03,(byte)0x02,(byte)0x01,(byte)0x03,(byte)0x02, + (byte)0x01,(byte)0x03,(byte)0x02,(byte)0x01,(byte)0x03,(byte)0x02,(byte)0x01}; + + byte testCaseNb = (byte) 0x00; + byte patt[] = null; + short resp[] = null; + short comp[] = null; + byte mode = 0; + short recordNumber = 0; + short searchIndication = 0; + short pattOffset = 0; + short respOffset = 0; + short pattLength = 0; + short respLength = 0; + short nbRecFound = 0; + + /** + * Constructor of the applet + */ + public Api_1_Fvw_Sear_1() + { + comp = new short[5]; + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_1_Fvw_Sear_1 thisApplet = new Api_1_Fvw_Sear_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes = false; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + + // ----------------------------------------------------------------- + // Test Case 1 : No EF Selected + // ----------------------------------------------------------------- + testCaseNb = 1; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + try + { + // searchRecord + patt = new byte[3]; + resp = new short[4]; + Util.arrayFillNonAtomic(patt, (short)0, (short)patt.length, (byte)0xAA); + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.NO_EF_SELECTED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + // -- Fixed linear EF + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + + // ----------------------------------------------------------------- + // Test Case 2 : Simple mode search forward + // ----------------------------------------------------------------- + testCaseNb = 2; + UiccFileView.select((short)UICCTestConstants.FID_EF_LSEA); + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + patt[0] = (byte)0x10; + patt[1] = (byte)0x03; + patt[2] = (byte)0x04; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + recordNumber = 1; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 4; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 2; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)2; + comp[2] = (short)4; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)2; + comp[2] = (short)4; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3 : Simple mode search backward + // ----------------------------------------------------------------- + testCaseNb = 3; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_BACKWARD; + searchIndication = 0; + patt[0] = (byte)0x08; + patt[1] = (byte)0x0A; + patt[2] = (byte)0x0B; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 2; + respLength = 2; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_BACKWARD; + searchIndication = 0; + patt = new byte[4]; + patt[0] = (byte)0x08; + patt[1] = (byte)0x09; + patt[2] = (byte)0x0A; + patt[3] = (byte)0x0B; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + recordNumber = 6; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)4; + comp[2] = (short)3; + comp[3] = (short)1; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_BACKWARD; + searchIndication = 0; + patt = new byte[4]; + patt[0] = (byte)0x08; + patt[1] = (byte)0x09; + patt[2] = (byte)0x0A; + patt[3] = (byte)0x0B; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)4; + comp[2] = (short)3; + comp[3] = (short)1; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // --------------------------------------------------------------------------------------------------- + // Test Case 4 : Enhanced Mode, search backward from previous record, start search at offset in record + // --------------------------------------------------------------------------------------------------- + testCaseNb = 4; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0009; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + patt[3] = (byte)0x04; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x03; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0000; + recordNumber = 0; + pattOffset = 0; + pattLength = 5; + respOffset = 2; + respLength = 2; + patt = new byte[6]; + patt[0] = (byte)0x0C; + patt[1] = (byte)0x0D; + patt[2] = (byte)0x0E; + patt[3] = (byte)0x0F; + patt[4] = (byte)0x01; + patt[5] = (byte)0x02; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[2] = (byte)0x02; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // -------------------------------------------------------------------------------------------------- + // Test Case 5 : Enhanced Mode, search backward from previous record, start search at value in record + // -------------------------------------------------------------------------------------------------- + testCaseNb = 5; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0810; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt = new byte[4]; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + patt[3] = (byte)0x04; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // 3 readRecord() to set record pointer to record 5 + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)4); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)4); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)4); + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x080E; + recordNumber = 0; + pattOffset = 3; + pattLength = 1; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + patt[3] = (byte)0x04; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x04; + comp[1] = (byte)0x02; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // -------------------------------------------------------------------------------------------------- + // Test Case 6 : Enhanced Mode, search backward from previous given record, start at offset in record + // -------------------------------------------------------------------------------------------------- + testCaseNb = 6; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0000; + recordNumber = 1; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 4; + patt = new byte[3]; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x01; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0004; + recordNumber = 6; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short)5; + comp[1] = (short)4; + comp[2] = (short)3; + comp[3] = (short)2; + if ((nbRecFound == (short)4) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ------------------------------------------------------------------------------------------------- + // Test Case 7 : Enhanced Mode, search backward from previous given record, start at value in record + // ------------------------------------------------------------------------------------------------- + testCaseNb = 7; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x080D; + recordNumber = 1; + pattOffset = 1; + pattLength = 1; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x0E; + patt[1] = (byte)0x0E; + patt[2] = (byte)0x0E; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x01; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0800; + recordNumber = 6; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // --------------------------------------------------------------------------------------- + // Test Case 8 : Enhanced Mode, search forward from next record, start at offset in record + // --------------------------------------------------------------------------------------- + testCaseNb = 8; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0003; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 2; + patt[0] = (byte)0x00; + patt[1] = (byte)0x0A; + patt[2] = (byte)0x0B; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[2] = (short) 3; + comp[3] = (short) 4; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0003; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 0; + respLength = 4; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short) 4; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // -------------------------------------------------------------------------------------- + // Test Case 9 : Enhanced Mode, search forward from next record, start at value in record + // -------------------------------------------------------------------------------------- + testCaseNb = 9; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0804; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 2; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0801; + recordNumber = 0; + pattOffset = 2; + pattLength = 1; + respOffset = 0; + respLength = 4; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short) 5; + comp[1] = (short) 6; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ---------------------------------------------------------------------------------------------- + // Test Case 10 : Enhanced Mode, search forward from next given record, start at offset in record + // ---------------------------------------------------------------------------------------------- + testCaseNb = 10; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x0007; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 1; + respLength = 3; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)3; + comp[2] = (short)4; + comp[3] = (short)5; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x000C; + recordNumber = 3; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x03; + patt[1] = (byte)0x02; + patt[2] = (byte)0x01; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x06; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // --------------------------------------------------------------------------------------------- + // Test Case 11 : Enhanced Mode, search forward from next given record, start at value in record + // --------------------------------------------------------------------------------------------- + testCaseNb = 11; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x080D; + recordNumber = 5; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x080C; + recordNumber = 5; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x05; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ---------------------------------------------------------------------------- + // Test Case 12 : Simple mode, total number of found patterns exceed response[] + // ---------------------------------------------------------------------------- + testCaseNb = 12; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short)1; + comp[1] = (short)2; + comp[2] = (short)3; + comp[3] = (short)4; + if ((nbRecFound == (short)4) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + resp = new short[5]; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short)1; + comp[1] = (short)2; + comp[2] = (short)3; + comp[3] = (short)4; + if ((nbRecFound == (short)4) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 13 : Invalid mode + // ----------------------------------------------------------------- + testCaseNb = 13; + try + { + // searchRecord + mode = (byte)0x14; + searchIndication = 0; + recordNumber = 2; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 2; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.INVALID_MODE) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 14 : Pattern array is null + // ----------------------------------------------------------------- + testCaseNb = 14; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 2; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, null, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (NullPointerException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 15 : Response array is null + // ----------------------------------------------------------------- + testCaseNb = 15; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, null, respOffset, respLength); + bRes = false; + } + catch (NullPointerException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 16 : pattOffset<0 + // ----------------------------------------------------------------- + testCaseNb = 16; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = -1; + pattLength = 1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 17 : pattLength<0 + // ----------------------------------------------------------------- + testCaseNb = 17; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = -1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 18 : respOffset<0 + // ----------------------------------------------------------------- + testCaseNb = 18; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 1; + respOffset = -1; + respLength = 4; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 19 : respLength<0 + // ----------------------------------------------------------------- + testCaseNb = 19; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = -1; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 20 : PattOffset + pattLength > patt[] + // ----------------------------------------------------------------- + testCaseNb = 20; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 2; + respOffset = 1; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 21 : respOffset + respLength > resp[] + // ----------------------------------------------------------------- + testCaseNb = 21; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 1; + respOffset = 3; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 22 : recordNum < 0 + // ----------------------------------------------------------------- + testCaseNb = 22; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = -1; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.RECORD_NOT_FOUND) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 23 : RecordNum > total number of file records + // ----------------------------------------------------------------- + testCaseNb = 23; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 7; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.RECORD_NOT_FOUND) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 24 : pattlength > record length + // ----------------------------------------------------------------- + testCaseNb = 24; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + patt = new byte[16]; + Util.arrayFillNonAtomic(patt, (short)0, (short)patt.length, (byte)0x55); + recordNumber = 3; + pattOffset = 0; + pattLength = 16; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.OUT_OF_RECORD_BOUNDARIES) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x000E; + recordNumber = 3; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 5; + patt = new byte[3]; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.OUT_OF_RECORD_BOUNDARIES) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 25 : Wrong file structure + // ----------------------------------------------------------------- + testCaseNb = 25; + try + { + // Select EF TDAC + UiccFileView.select((short)UICCTestConstants.FID_EF_TDAC); + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.COMMAND_INCOMPATIBLE) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 26 : Security status not satisfied + // ----------------------------------------------------------------- + testCaseNb = 26; + try + { + // Select EF LNR + UiccFileView.select((short)UICCTestConstants.FID_EF_LNR); + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 27 : File deactivated + // ----------------------------------------------------------------- + testCaseNb = 27; + try + { + // Select EF LARU and deactivate it + UiccFileView.select((short)UICCTestConstants.FID_EF_LARU); + UiccFileView.deactivateFile(); + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.REF_DATA_INVALIDATED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + // Re active EF LARU + UiccFileView.activateFile(); + + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + // -- Cyclic EF + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + + // ----------------------------------------------------------------- + // Test Case 28 : Simple mode search forward + // ----------------------------------------------------------------- + testCaseNb = 28; + try + { + // Select EF CSEA + UiccFileView.select((short)UICCTestConstants.FID_EF_CSEA); + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + patt[0] = (byte)0x10; + patt[1] = (byte)0x03; + patt[2] = (byte)0x04; + resp = new short[5]; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 2; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 3; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)3) + { + comp[2] = (short)2; + comp[3] = (short)4; + comp[4] = (short)1; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)2) + { + comp[2] = (short)2; + comp[3] = (short)4; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + + // Update record in previous mode to set pointer 1 to previous record 6 + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue6, (short)0, (short)RecValue6.length); + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 2; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 3; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[2] = (short)2; + comp[3] = (short)3; + comp[4] = (short)5; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 29 : Simple mode search backward + // ----------------------------------------------------------------- + testCaseNb = 29; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_BACKWARD; + searchIndication = 0; + recordNumber = 3; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 4; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)3) + { + comp[1] = (short)3; + comp[2] = (short)2; + comp[3] = (short)5; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)2) + { + comp[1] = (short)3; + comp[2] = (short)2; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 30 : Enhanced mode, search forward, start at offset in record + // ----------------------------------------------------------------- + testCaseNb = 30; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0009; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 2; + respLength = 3; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[2] = (short)4; + comp[3] = (short)5; + comp[4] = (short)6; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 31 : Enhanced mode, search forward, start at value in record + // ----------------------------------------------------------------- + testCaseNb = 31; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0810; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 2; + respLength = 3; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 32 : Enhanced mode, search forward given record, start at offset in record + // ----------------------------------------------------------------- + testCaseNb = 32; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x0005; + recordNumber = 3; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)5) + { + comp[0] = (short)3; + comp[1] = (short)4; + comp[2] = (short)5; + comp[3] = (short)6; + comp[4] = (short)1; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)4) + { + comp[0] = (short)3; + comp[1] = (short)4; + comp[2] = (short)5; + comp[3] = (short)6; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 33 : Enhanced mode, search forward given record, start at value in record + // ----------------------------------------------------------------- + testCaseNb = 33; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x0805; + recordNumber = 6; + pattOffset = 0; + pattLength = 2; + respOffset = 0; + respLength = 5; + patt[0] = (byte)0x0E; + patt[1] = (byte)0x0F; + patt[2] = (byte)0x00; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)2) + { + comp[0] = (short)2; + comp[1] = (short)4; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)0) + { + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + + // 5 Update record in previous mode to set pointer 1 its initial value + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue5, (short)0, (short)RecValue5.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue4, (short)0, (short)RecValue4.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue3, (short)0, (short)RecValue3.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue2, (short)0, (short)RecValue2.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue1, (short)0, (short)RecValue1.length); + + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 34 : Enhanced mode, search backward, start at offset in record + // ----------------------------------------------------------------- + testCaseNb = 34; + try + { + patt = new byte[15]; + // 5 readRecord() to set record pointer to record 6 + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0003; + recordNumber = 0; + pattOffset = 0; + pattLength = 2; + respOffset = 3; + respLength = 2; + patt[0] = (byte)0x02; + patt[1] = (byte)0x01; + patt[2] = (byte)0x00; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)1) + { + comp[3] = (short)6; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)0) + { + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 35 : Enhanced mode, search backward, start at value in record + // ----------------------------------------------------------------- + testCaseNb = 35; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0801; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 0; + respLength = 5; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short)5; + comp[1] = (short)4; + comp[2] = (short)3; + comp[3] = (short)2; + comp[4] = (short)1; + if ((nbRecFound == (short)5) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 36 : Enhanced mode, search backward given record, start at offset in record + // ----------------------------------------------------------------- + testCaseNb = 36; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0003; + recordNumber = 5; + pattOffset = 0; + pattLength = 2; + respOffset = 3; + respLength = 2; + patt[0] = (byte)0x02; + patt[1] = (byte)0x01; + patt[2] = (byte)0x00; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)1) + { + comp[3] = (short)6; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)0) + { + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 37 : Enhanced mode, search backward given record, start at value in record + // ----------------------------------------------------------------- + testCaseNb = 37; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0801; + recordNumber = 3; + pattOffset = 1; + pattLength = 2; + respOffset = 0; + respLength = 5; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)5) + { + comp[0] = (short)3; + comp[1] = (short)2; + comp[2] = (short)1; + comp[3] = (short)5; + comp[4] = (short)4; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)3) + { + comp[0] = (short)3; + comp[1] = (short)2; + comp[2] = (short)1; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + + private void shortArrayFill(short buff[], short buffOffset, short fillLength, short value) + { + for (short i = buffOffset; i < (short)(fillLength + buffOffset); i++) + { + buff[i] = value; + } + } + + private byte shortArrayCompare(short buff1[], short buff1Offset, short buff2[], short buff2Offset, short compLength) + { + byte ret = 0; + + for (byte i = 0; ((i < compLength) && (ret == 0)); i++) + { + byte j = (byte)(i+buff1Offset); + byte k = (byte)(i+buff2Offset); + if (buff1[j] != buff2[k]) + ret = 1; + } + return ret; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/Test_Api_1_Fvw_Sear.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/Test_Api_1_Fvw_Sear.java new file mode 100644 index 0000000..03241f5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/Test_Api_1_Fvw_Sear.java @@ -0,0 +1,97 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_sear; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_1_Fvw_Sear extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_sear"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Sear() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "25" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/applet.opt new file mode 100644 index 0000000..37d8b9a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_sear.Api_1_Fvw_Sear_1 +uicc.test.access.api_1_fvw_sear +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/javacard/api_1_fvw_sear.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_sear/javacard/api_1_fvw_sear.cap new file mode 100644 index 0000000000000000000000000000000000000000..75ee8846ac34aed4458e63faa1b7258d5bb4bcb4 GIT binary patch literal 22451 zcmd742YeL8`#3y(%Wc2Ay&5_Q2!t-Z_uiFGfFOZDLP)5h2}qZsf(i-Ncqp+T}TK)!JpsH``+H%J@d@$^E~s+GyU1^&>9mD5c#!b?5JuW z&&LA@Xxp?)!}2ZLHH&ZCuwBb$O*?m~(6-sN_W{W6)H`KjMbCtLzO8>@#Q4&m%oubk zG+^P&Z3av^RH!BPecC2#{+yF<_C2twfhXhqi&;NjSUkR7sXDefu;w+gV0wu`)BG#e z)wITFMIS!Y#rIUh{gdwBJ-8TJF!0%OQ@c(%TBBm2jJ98_c!(RX ze)TWY3(tS^Vb<&C!=d<^qqZpL zulCoP@mc#*W7c%&_}AD)2U~t;d9rs`Sun2{d2fHqjw~@kjN>n=3D#S$0Xhc%W(-^Tlb3 z|74X98htc)_NpYUy;N((kS?o(uXUOA+v-ABvolsdQuNP3XKFovwRYD>_g9#DWbLMz z8QbETZfQPY#-bIi_s-w8X!0MQZ`hEwuk-9nE0G25z1|*Ig8K01v)VEUKL8C_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X^0Fhi9Xb`a9-Z4GP~Hp@^-6{FLWL`6*?QfRRq@o6>fJUwFv?usve? zpyvfhpksIoe(V=`aSf!}X%H^=!zpi^!ukrt0*h}h(7<~$_Rpmu^oN~)@Yv2lcodl) z218=tWN|7+NyBly1woKG4$JstQ55@LVT2^JAf{4bkW3?}9Am(&NeaXQ#wIx; zW{4>=HqjIr7drSas*hg1j00yHg&O!zU*PmQ>RcYYR@m4La4}$4c>MeMMy^T5pFR)@ zm?a=kfWJE0v?6B9cqn7$jM-|mzkmpi*cA z3)o;R=78wH4UfT{>>cgRdYDfd0Zk*M!Gyl20N7Im#dz11K}F!PVH+FR*d^QB3y%ll zSuh97D&Vm|ZXU@Z9|$$ZIYLd^I-w>D$V0?PJ1ydU&A?|H4K+pw7K)vn`COj0gmAHV zm-c&hw|WcAvkMKk^Yd6Q`o0tPf1X9Km%X^01K*>dpP?maorxe}ByP>X2_de97NT_> zf{^#Zf&?82EkWxu1PO6`IMWDv5L$xv$`2B{!y;%M04+y*`vy51@DvSvL-PCYVl6;> z=>`G4VF7|yu$G`Twn2gmjlsaDpfSB#jMm-;F$crKXsoXmqqU4d%qlsY*@W6jYl*;2 P6d3Ty!gW8!%pCj&F+R0q literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/Api_1_Fvw_Slctb_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/Api_1_Fvw_Slctb_Bss_1.java new file mode 100644 index 0000000..ec1efd7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/Api_1_Fvw_Slctb_Bss_1.java @@ -0,0 +1,811 @@ +//----------------------------------------------------------------------------- +// Api_1_Fvw_Slctb_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_slctb_bss; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.access.* ; +import uicc.test.util.* ; + + + +public class Api_1_Fvw_Slctb_Bss_1 extends TestToolkitApplet{ + + public static byte[] FDescriptor = {(byte) 0x82, (byte) 0xFF, (byte) 0xFF, (byte) 0x21, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; + public static byte[] FId_MF = {(byte) 0x83, (byte) 0x02, (byte) 0x3F, (byte) 0x00}; + public static byte[] FId_DFTelecom = {(byte) 0x83, (byte) 0x02, (byte) 0x7F, (byte) 0x10}; + public static byte[] FId_DFTest = {(byte) 0x83, (byte) 0x02, (byte) 0x7F, (byte) 0x4A}; + public static byte[] FId_EFTaru = {(byte) 0x83, (byte) 0x02, (byte) 0x6F, (byte) 0x03}; + public static byte[] FId_EFLaru = {(byte) 0x83, (byte) 0x02, (byte) 0x6F, (byte) 0x0C}; + public static byte[] DFName = {(byte) 0x84, (byte) 0x10, (byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, (byte)0xE0, (byte)0x00, (byte)0x00, (byte)0x02}; + public static byte[] lifeCycle = {(byte) 0x8A, (byte) 0x01, (byte) 0x05}; + public static byte[] fileSize = {(byte) 0x80, (byte) 0x02, (byte) 0x01, (byte) 0x04}; + public static byte[] secAttributesLARR1a = {(byte) 0x8B, (byte) 0x03, (byte) 0x6F, (byte) 0x06, (byte) 0x01}; + public static byte[] secAttributesLARR1b = {(byte) 0x8B, (byte) 0x06, (byte) 0x6F, (byte) 0x06, (byte) 0x00, (byte) 0x01, (byte) 0x01, (byte) 0x01}; + public static byte[] secAttributesLARR1c = {(byte) 0x8B, (byte) 0x06, (byte) 0x6F, (byte) 0x06, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x01}; + public static byte[] secAttributesTARR3a = {(byte) 0x8B, (byte) 0x03, (byte) 0x2F, (byte) 0x06, (byte) 0x03}; + public static byte[] secAttributesTARR3b = {(byte) 0x8B, (byte) 0x06, (byte) 0x2F, (byte) 0x06, (byte) 0x00, (byte) 0x03, (byte) 0x01, (byte) 0x03}; + public static byte[] secAttributesTARR3c = {(byte) 0x8B, (byte) 0x06, (byte) 0x2F, (byte) 0x06, (byte) 0x01, (byte) 0x03, (byte) 0x00, (byte) 0x03}; + + public static byte[] fcp; + public static byte[] normalBuffer = new byte[132]; + public static byte[] nullBuffer = null; + + + byte[] resp = new byte[4]; + byte[] data = new byte[4]; + + short dataOffset; + short dataLength; + short fileOffset; + short respOffset; + short respLength; + short recNumber; + byte mode; + short recOffset; + + AID AidADF1; + + private FileView theUiccView; + private FileView theFileView; + + private short findTLV (byte tag, byte[] buffer, short offset) { + + short index=1; + short len; + + index = (short)(index + offset); + + if (buffer[(byte)index]==(byte)0x81) { + index++; + len = (short) (buffer[(byte)index] + index + (short)1); + }else if (buffer[(byte)index]==(byte)0x82){ + index = (short)(index + (short)2); + len = (short) (Util.getShort(buffer,(byte)index) + index); + } + else{ + len = (short) (buffer[(byte)index] + index + (short)1); + } + + + index++; + + while (index < len) { + + if ( (buffer[(byte)index] & (byte)0x7F) == (tag & (byte)0x7F) ) { + return(index); + } + index = (short) (index + (short) buffer[(byte)(index + (byte)1)] + (short)2); + } + + return(0); + + } + + + + /** + * Constructor of the applet + */ + public Api_1_Fvw_Slctb_Bss_1(){ + + UICCTestConstants objectConstants = new UICCTestConstants(); + AidADF1 = new AID(objectConstants.AID_ADF1, (short) 0, (byte) objectConstants.AID_ADF1.length); + + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + + // Create a new applet instance. + Api_1_Fvw_Slctb_Bss_1 thisApplet = new Api_1_Fvw_Slctb_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + public void processToolkit(short event){ + + + boolean bRes = false; + byte bTestCaseNb = (byte)0; + + EnvelopeHandler envHdlr; + short fcpOffset = 0; + short fcpLength = 0; + short result = 0; + + + short FDOffset = (short)2; //offset of File descriptor TLV in fcp + short FDByteOffset = (short)4; //offset of File descriptor byte in fcp + short FIdOffset = (short)6; //offset of File Identifier TLV in fcp + + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + /*------------------------------------------------------------------ + * TEST CASE 0:Get a FileView object, UICC file system + *----------------------------------------------------------------*/ + theUiccView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + + /*------------------------------------------------------------------ + * TEST CASE 1: Select EFTARU in MF (Transparent EF) + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + result = theUiccView.select(UICCTestConstants.FID_EF_TARU, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x41; + if ((result >= 19) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)4)==0) + &&(Util.arrayCompare(FId_EFTaru, (short)0, fcp, FIdOffset, (short)FId_EFTaru.length)==0)) { + + bRes = true; + } + + fcpOffset=findTLV((byte)0x8A, fcp, (short)0);//life cycle + if ((fcpOffset !=0) && (Util.arrayCompare(lifeCycle, (short)0, fcp, fcpOffset, (short)lifeCycle.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + fcpOffset=findTLV((byte)0x80, fcp, (short)0);//file size + if ((fcpOffset !=0) && (Util.arrayCompare(fileSize, (short)0, fcp, fcpOffset, (short)fileSize.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x01; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 2: Select EFTaru in MF (Transparent EF) + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 7; + result = theUiccView.select(UICCTestConstants.FID_EF_TARU, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x41; + if ((result == fcpLength) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)4)==0)) { + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x02; + reportTestOutcome(bTestCaseNb, bRes); + + + + /*------------------------------------------------------------------ + * TEST CASE 3: Select DF Test in MF + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + result = theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x78; + if ((result >= 17) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)4)==0) + &&(Util.arrayCompare(FId_DFTest, (short)0, fcp, FIdOffset, (short)FId_DFTest.length)==0)) { + + bRes = true; + } + fcpOffset=findTLV((byte)0x8A, fcp, (short)0);//life cycle + if ((fcpOffset !=0) && (Util.arrayCompare(lifeCycle, (short)0, fcp, fcpOffset, (short)lifeCycle.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x03; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 4: Select EF CARU in DF Test(Cyclic EF) + *----------------------------------------------------------------*/ + bRes = false; + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 11; + result = theUiccView.select(UICCTestConstants.FID_EF_CARU, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDOffset++; + } + FDescriptor[1] = 0x05; + FDescriptor[2] = 0x46; + FDescriptor[4] = 0x00;// record + FDescriptor[5] = 0x03;// length + FDescriptor[6] = 0x02;// number of records + if ((result == fcpLength) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)7)==0)) { + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x04; + reportTestOutcome(bTestCaseNb, bRes); + + + + + /*------------------------------------------------------------------ + * TEST CASE 5: Select ADF1 + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 5; + fcpLength = 127; + theFileView = UICCSystem.getTheFileView(AidADF1, JCSystem.CLEAR_ON_RESET); + result = theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + + fcp[0]=fcp[1]=fcp[2]=fcp[3]=fcp[4]=0x00; + + if (fcp[(byte)(1 + fcpOffset)] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x78; + if ((result >= 27) + &&(fcp[0]==(byte)0x00) && (fcp[1]==(byte)0x00) && (fcp[2]==(byte)0x00) && (fcp[3]==(byte)0x00) && (fcp[4]==(byte)0x00) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, (short)(FDOffset + fcpOffset), (short)4)==0)) { + + bRes = true; + } + fcpOffset=findTLV((byte)0x84, fcp, fcpOffset); //DF Name + if ((fcpOffset !=0) && (Util.arrayCompare(DFName, (short)0, fcp, fcpOffset, (short)DFName.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + fcpOffset = 5; + fcpOffset=findTLV((byte)0x8A, fcp, fcpOffset);//life cycle + if ((fcpOffset !=0) && (Util.arrayCompare(lifeCycle, (short)0, fcp, fcpOffset, (short)lifeCycle.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x05; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 6: Select MF + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 11; + result = theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[(byte)(FDByteOffset+fcpOffset)]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x78; + if ((result == fcpLength) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, (short) (fcpOffset+FDOffset), (short)4)==0) + &&(Util.arrayCompare(FId_MF, (short)0, fcp, (short) (fcpOffset+FIdOffset), (short)FId_MF.length)==0)) { + + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x06; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 7: Select DF TELECOM in MF + *----------------------------------------------------------------*/ + bRes = false; + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcp[0] = fcp[1] = (byte)0x05; + fcpOffset = 2; + fcpLength = 13; + result = theUiccView.select(UICCConstants.FID_DF_TELECOM, fcp, fcpOffset, fcpLength); + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[(byte)(FDByteOffset+fcpOffset)]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x78; + if ((result == fcpLength) + &&(fcp[0]==(byte)0x05) && (fcp[1]==(byte)0x05) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, (short) (fcpOffset+FDOffset), (short)4)==0) + &&(Util.arrayCompare(FId_DFTelecom, (short)0, fcp, (short) (fcpOffset+FIdOffset), (short)FId_DFTelecom.length)==0)) { + + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x07; + reportTestOutcome(bTestCaseNb, bRes); + /*------------------------------------------------------------------ + * TEST CASE 8: Select EF LARU in DF TEST (Linear FixedEF) + *----------------------------------------------------------------*/ + bRes = false; + try { + FDOffset = (short)2; + FIdOffset = (short)9; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 14; + theUiccView.select(UICCTestConstants.FID_DF_TEST); + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDOffset++; + FIdOffset++; + } + FDescriptor[1] = 0x05; + FDescriptor[2] = 0x42; + FDescriptor[4] = 0x00;// record + FDescriptor[5] = 0x04;// length + FDescriptor[6] = 0x02;// number of records + if ((result == fcpLength) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)7)==0) + &&(Util.arrayCompare(FId_EFLaru, (short)0, fcp, (short) FIdOffset, (short)FId_EFLaru.length)==0)) { + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x08; + reportTestOutcome(bTestCaseNb, bRes); + + + + /*------------------------------------------------------------------ + * TEST CASE 9: fcp is null + *----------------------------------------------------------------*/ + try { + fcp = nullBuffer; + fcpOffset = 0; + fcpLength = 15; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (NullPointerException npe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x09; + reportTestOutcome(bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 10: fcpOffset < 0 + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = -1; + fcpLength = 15; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0A; + reportTestOutcome(bTestCaseNb, bRes); + /*------------------------------------------------------------------ + * TEST CASE 11: fcpLength < 0 + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = -1; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0B; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 12: fcpOffset + fcpLength > fcp.length + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = 115; + fcpLength = 18; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0C; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 13: fcpOffset + fcpLength > fcp.length + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = (short) (fcp.length+1); + fcpLength = 0; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0D; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 14: Selection possiblities + *----------------------------------------------------------------*/ + + + try { + fcpOffset = 0; + + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + + theUiccView.select(UICCTestConstants.FID_EF_UICC, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_CNU, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_SUB_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + bRes = true; + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0E; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 15: EF not selected after MF/DF selection + *----------------------------------------------------------------*/ + + try { + + fileOffset = (short) 0; + respOffset = (short) 0; + respLength = (short) 3; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 20; + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCConstants.FID_EF_ICCID, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + + theUiccView.readBinary((short) fileOffset, (byte[]) resp, (short) respOffset, (short) respLength); + + bRes = false; + + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.NO_EF_SELECTED); + } + bTestCaseNb = 0x0F; + reportTestOutcome(bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 16: No selection of non-reachable file + *----------------------------------------------------------------*/ + + try { + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 20; + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_CARU, fcp, fcpOffset, fcpLength); + bRes = false; + + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.FILE_NOT_FOUND); + } + bTestCaseNb = 0x10; + reportTestOutcome(bTestCaseNb, bRes); + + /*--------------------------------------------------------------------- + * TEST CASE 17: No record is selected afterselecting linear fixed EF + *--------------------------------------------------------------------*/ + + try { + + recNumber = (short) 0; + mode = (byte) UICCConstants.REC_ACC_MODE_CURRENT; + recOffset = (short) 0; + respOffset = (short) 0; + respLength = (short) 4; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 20; + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + theUiccView.readRecord(recNumber, mode, recOffset, resp, respOffset, respLength); + bRes = false; + + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.RECORD_NOT_FOUND); + } + bTestCaseNb = 0x11; + reportTestOutcome(bTestCaseNb, bRes); + + + /*--------------------------------------------------------------------- + * TEST CASE 18: Record pointer in selected cyclic EF + *--------------------------------------------------------------------*/ + bRes = false; + + recNumber = (short) 0; + recOffset = (short) 0; + dataOffset = (short) 0; + dataLength = (short) 3; + respOffset = (short) 0; + respLength = (short) 3; + + try { + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_CARU, fcp, fcpOffset, fcpLength); + + data[0] = 1; + data[1] = 2; + data[2] = 3; + mode = UICCConstants.REC_ACC_MODE_PREVIOUS; + theUiccView.updateRecord(recNumber, mode, recOffset, data, dataOffset, dataLength); + + theUiccView.select(UICCTestConstants.FID_EF_CARU, fcp, fcpOffset, fcpLength); + + mode = UICCConstants.REC_ACC_MODE_PREVIOUS; + theUiccView.readRecord(recNumber, mode, recOffset, resp, respOffset, respLength); + theUiccView.readRecord(recNumber, mode, recOffset, resp, respOffset, respLength); + + if (Util.arrayCompare(data, (short)0, resp, (short)0, (short)3)==0) { + bRes = true; + } + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x12; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 19: EF not selected after ADF/DF selection + *----------------------------------------------------------------*/ + + try { + + fileOffset = (short) 0; + respOffset = (short) 0; + respLength = (short) 3; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 20; + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_EF_UICC, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + + theFileView.readBinary((short) fileOffset, (byte[]) resp, (short) respOffset, (short) respLength); + + bRes = false; + + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.NO_EF_SELECTED); + } + bTestCaseNb = 0x13; + reportTestOutcome(bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 20: Reselection + *----------------------------------------------------------------*/ + + + try { + + //ADF FileView + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + + //UICC FileView + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + + bRes = true; + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x14; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 21: Security attributes + *----------------------------------------------------------------*/ + + try { + + bRes = false; + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + //ADF FileView + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_EF_LARR1, fcp, fcpOffset, fcpLength); + + fcpOffset=findTLV((byte)0x8B, fcp, fcpOffset); //security attributes + if ( (fcpOffset !=0) + && ((Util.arrayCompare(secAttributesLARR1a, (short)0, fcp, fcpOffset, (short)secAttributesLARR1a.length)==0) + ||(Util.arrayCompare(secAttributesLARR1b, (short)0, fcp, fcpOffset, (short)secAttributesLARR1b.length)==0) + ||(Util.arrayCompare(secAttributesLARR1c, (short)0, fcp, fcpOffset, (short)secAttributesLARR1c.length)==0)) ){ + + bRes = true; + } + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x15; + reportTestOutcome(bTestCaseNb, bRes); + + + try { + + bRes = false; + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + //UICC FileView + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TARR3, fcp, fcpOffset, fcpLength); + + fcpOffset=findTLV((byte)0x8B, fcp, fcpOffset); //security attributes + if ( (fcpOffset !=0) + && ((Util.arrayCompare(secAttributesTARR3a, (short)0, fcp, fcpOffset, (short)secAttributesTARR3a.length)==0) + ||(Util.arrayCompare(secAttributesTARR3b, (short)0, fcp, fcpOffset, (short)secAttributesTARR3b.length)==0) + ||(Util.arrayCompare(secAttributesTARR3c, (short)0, fcp, fcpOffset, (short)secAttributesTARR3c.length)==0)) ){ + + bRes = true; + } + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x16; + reportTestOutcome(bTestCaseNb, bRes); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/Test_Api_1_Fvw_Slctb_Bss.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/Test_Api_1_Fvw_Slctb_Bss.java new file mode 100644 index 0000000..13c1af6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/Test_Api_1_Fvw_Slctb_Bss.java @@ -0,0 +1,115 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_slctb_bss; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_1_Fvw_Slctb_Bss extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_slctb_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + static final String MF = "3F00"; + static final String DFTEST = "7F4A"; + static final String EFCARU = "6F09"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Slctb_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" // LV Access Domain DAP field + ); + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 Select EFTARU in MF (Transparent EF) */ + /** Testcase 2 Select EFTaru in MF (Transparent EF) */ + /** Testcase 3 Select DF Test in MF */ + /** Testcase 4 Select EF CARU in DF Test(Cyclic EF) */ + /** Testcase 5 Select ADF1 */ + /** Testcase 6 Select MF */ + /** Testcase 7 Select DF TELECOM in MF */ + /** Testcase 8 Select EF LARU in DF TEST (Linear FixedEF) */ + /** Testcase 9 fcp is null */ + /** Testcase 10 fcpOffset < 0 */ + /** Testcase 11 fcpLength < 0 */ + /** Testcase 12 fcpOffset + fcpLength > fcp.length */ + /** Testcase 13 fcpOffset + fcpLength > fcp.length */ + /** Testcase 14 Selection possiblities */ + /** Testcase 15 EF not selected after MF/DF selection */ + /** Testcase 16 No selection of non-reachable file */ + /** Testcase 17 No record is selected afterselecting linear fixed EF */ + /** Testcase 18 Record pointer in selected cyclic EF */ + /** Testcase 19 EF not selected after ADF/DF selection */ + /** Testcase 20 Reselection */ + /** Testcase 21 Security attributes */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "16CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + //Select EF CARU + test.selectFile(MF); + test.selectFile(DFTEST); + test.selectFile(EFCARU); + test.updateRecord("00", "03", "AAAAAA");//Mode previous + test.updateRecord("00", "03", "555555");//Mode previous + + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/applet.opt new file mode 100644 index 0000000..b23f4fc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_slctb_bss.Api_1_Fvw_Slctb_Bss_1 +uicc.test.access.api_1_fvw_slctb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/javacard/api_1_fvw_slctb_bss.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_slctb_bss/javacard/api_1_fvw_slctb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..c1da56e12e3e5b4567a86483fc52d45e8d3059ac GIT binary patch literal 7697 zcmd5BYjhOV`J0(LuYDww&1SRY34w$JFd^ZQKzN0aD38Pllmk*tmLy7=$c{-snw%z+ z1i~W$Jb&+bI_ycu~pQ@SF2Tv_T`~H+9PWE-I?9&&g`aTPycjw zzxnR{?&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_1.java new file mode 100644 index 0000000..de12b66 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/Api_1_Fvw_Stat_1.java @@ -0,0 +1,466 @@ +//----------------------------------------------------------------------------- +// Api_1_Fvw_Stat_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_stat; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.access.* ; +import uicc.test.util.* ; + + +public class Api_1_Fvw_Stat_1 extends TestToolkitApplet { + + public static byte[] FDescriptor = {(byte) 0x82, (byte) 0x02, (byte) 0xFF, (byte) 0x21}; + public static byte[] FId_MF = {(byte) 0x83, (byte) 0x02, (byte) 0x3F, (byte) 0x00}; + public static byte[] FId_DFTelecom = {(byte) 0x83, (byte) 0x02, (byte) 0x7F, (byte) 0x10}; + public static byte[] FId_DFTest = {(byte) 0x83, (byte) 0x02, (byte) 0x7F, (byte) 0x4A}; + public static byte[] DFName = {(byte) 0x84, (byte) 0x10, (byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, (byte)0xE0, (byte)0x00, (byte)0x00, (byte)0x02}; + public static byte[] lifeCycle = {(byte) 0x8A, (byte) 0x01, (byte) 0x05}; + public static byte[] secAttributesARR2a = {(byte) 0x8B, (byte) 0x03, (byte) 0x6F, (byte) 0x06, (byte) 0x02}; + public static byte[] secAttributesARR2b = {(byte) 0x8B, (byte) 0x06, (byte) 0x6F, (byte) 0x06, (byte) 0x00, (byte) 0x02, (byte) 0x01, (byte) 0x02}; + public static byte[] secAttributesARR2c = {(byte) 0x8B, (byte) 0x06, (byte) 0x6F, (byte) 0x06, (byte) 0x01, (byte) 0x02, (byte) 0x00, (byte) 0x02}; + public static byte[] secAttributesARR4a = {(byte) 0x8B, (byte) 0x03, (byte) 0x2F, (byte) 0x06, (byte) 0x04}; + public static byte[] secAttributesARR4b = {(byte) 0x8B, (byte) 0x06, (byte) 0x2F, (byte) 0x06, (byte) 0x00, (byte) 0x04, (byte) 0x01, (byte) 0x04}; + public static byte[] secAttributesARR4c = {(byte) 0x8B, (byte) 0x06, (byte) 0x2F, (byte) 0x06, (byte) 0x01, (byte) 0x04, (byte) 0x00, (byte) 0x04}; + + public static byte[] normalBuffer = new byte[127]; + public static byte[] nullBuffer = null; + public static byte[] fcp; + AID AidADF1; + + private FileView theUiccView; + private FileView theFileView; + + /** + * The Constructor register the application for the Event. + */ + public Api_1_Fvw_Stat_1 () { + + UICCTestConstants objectConstants = new UICCTestConstants (); + AidADF1 = new AID (objectConstants.AID_ADF1, (short) 0, (byte) objectConstants.AID_ADF1.length); + + } + + private short findTLV (byte tag, byte[] buffer, short offset) { + + short index=1; + short len; + + index = (short)(index + offset); + + if (buffer[(byte)index]==(byte)0x81) { + index++; + len = (short) (buffer[(byte)index] + index + (short)1); + }else if (buffer[(byte)index]==(byte)0x82){ + index = (short)(index + (short)2); + len = (short) (Util.getShort(buffer,(byte)index) + index); + } + else{ + len = (short) (buffer[(byte)index] + index + (short)1); + } + + + index++; + + while (index < len) { + + if ( (buffer[(byte)index] & (byte)0x7F) == (tag & (byte)0x7F) ) { + return(index); + } + index = (short) (index + (short) buffer[(byte)(index + (byte)1)] + (short)2); + } + + return(0); + + } + + + + public static void install (byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance. + Api_1_Fvw_Stat_1 thisApplet = new Api_1_Fvw_Stat_1 (); + + // Register the new applet instance to the JCRE + thisApplet.register (bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init (); + + thisApplet.obReg.setEvent (EVENT_UNRECOGNIZED_ENVELOPE); + + } + + public void processToolkit (short event) throws ToolkitException { + + boolean bRes = false; + byte bTestCaseNb = (byte)0; + + EnvelopeHandler envHdlr; + short fcpOffset = 0; + short fcpLength = 0; + short result = 0; + + + short FDOffset = (short)2; //offset of File descriptor TLV in fcp + short FDByteOffset = (short)4; //offset of File descriptor byte in fcp + short FIdOffset = (short)6; //offset of File Identifier TLV in fcp + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + /*------------------------------------------------------------------ + * TEST CASE 01: Status of MF + *----------------------------------------------------------------*/ + + theUiccView = UICCSystem.getTheUICCView (JCSystem.CLEAR_ON_RESET); + + try { + fcp = normalBuffer; + fcpOffset = 3; + fcpLength = 11; + fcp[0]=fcp[1]=fcp[2]= (byte)0xCC; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + + if (fcp[(byte)(0x01 + fcpOffset)] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[(byte)(FDByteOffset+fcpOffset)]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[2]= 0x78; + if ((result == fcpLength) + &&(Util.arrayCompare (FDescriptor, (short)0, fcp, (short) (fcpOffset+FDOffset), (short)FDescriptor.length)==0) + &&(Util.arrayCompare (FId_MF, (short)0, fcp, (short) (fcpOffset+FIdOffset), (short)FId_MF.length)==0) + &&(fcp[0]==(byte)0xCC) && (fcp[1]==(byte)0xCC) && (fcp[2]==(byte)0xCC)) { + + bRes = true; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x01; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 02: Status after select EF TARU in MF + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + + theUiccView.select (UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select (UICCTestConstants.FID_EF_TARU, fcp, fcpOffset, fcpLength); + + result = theUiccView.status (fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[FDByteOffset]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[2]= 0x78; + if ((result >= 19) + &&(Util.arrayCompare (FDescriptor, (short)0, fcp, FDOffset, (short)FDescriptor.length)==0) + &&(Util.arrayCompare (FId_DFTest, (short)0, fcp, FIdOffset, (short)FId_DFTest.length)==0)) { + + bRes = true; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x02; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 03: Status of DF Telecom + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + theUiccView.select (UICCConstants.FID_DF_TELECOM, fcp, fcpOffset, fcpLength); + + result = theUiccView.status (fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + if ((result >= 17) + &&(Util.arrayCompare (FId_DFTelecom, (short)0, fcp, FIdOffset, (short)FId_DFTelecom.length)==0)) { + + bRes = true; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x03; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 04: Status DF Telecom + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 11; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[FDByteOffset]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[2]= 0x78; + if ((result == fcpLength) + &&(Util.arrayCompare (FDescriptor, (short)0, fcp, FDOffset, (short)FDescriptor.length)==0) + &&(Util.arrayCompare (FId_DFTelecom, (short)0, fcp, FIdOffset, (short)FId_DFTelecom.length)==0)) { + + bRes = true; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x04; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 05: Status ADF1 + *----------------------------------------------------------------*/ + bRes = false; + + theFileView = UICCSystem.getTheFileView (AidADF1, JCSystem.CLEAR_ON_RESET); + + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + result = theFileView.status (fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[FDByteOffset]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[2]= 0x78; + //File Descriptor + if ((result >= 27) && (Util.arrayCompare (FDescriptor, (short)0, fcp, FDOffset, (short)FDescriptor.length)==0)) { + + bRes = true; + } + fcpOffset=findTLV ((byte)0x84, fcp, (short)0);//DF Name + if ((fcpOffset !=0) && (Util.arrayCompare (DFName, (short)0, fcp, fcpOffset, (short)DFName.length)==0)) { + + bRes &= true; + } else { + bRes = false; + } + + fcpOffset=findTLV ((byte)0x8A, fcp, (short)0);//life cycle + if ((fcpOffset !=0) && (Util.arrayCompare (lifeCycle, (short)0, fcp, fcpOffset, (short)lifeCycle.length)==0)) { + + bRes &= true; + } else { + bRes = false; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x05; + reportTestOutcome (bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 06: fcp is null + *----------------------------------------------------------------*/ + try { + fcp = nullBuffer; + fcpOffset = 0; + fcpLength = 34; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (NullPointerException npe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x06; + reportTestOutcome (bTestCaseNb, bRes); + /*------------------------------------------------------------------ + * TEST CASE 07: fcpOffset < 0 + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = -1; + fcpLength = 34; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x07; + reportTestOutcome (bTestCaseNb, bRes); + /*------------------------------------------------------------------ + * TEST CASE 08: fcpLength < 0 + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = -1; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x08; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 09: fcpOffset + fcpLength > fcp.length + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = (short)(fcp.length - 1); + fcpLength = 15; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x09; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 10: fcpOffset + fcpLength > fcp.length + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = (short)(fcp.length+1); + fcpLength = 0; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0A; + reportTestOutcome (bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 11: Security attributes + *----------------------------------------------------------------*/ + + try { + + bRes = false; + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + //ADF FileView + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_DF_ARR2, fcp, fcpOffset, fcpLength); + + fcpOffset=findTLV((byte)0x8B, fcp, fcpOffset); //security attributes + if ( (fcpOffset !=0) + && ((Util.arrayCompare(secAttributesARR2a, (short)0, fcp, fcpOffset, (short)secAttributesARR2a.length)==0) + ||(Util.arrayCompare(secAttributesARR2b, (short)0, fcp, fcpOffset, (short)secAttributesARR2b.length)==0) + ||(Util.arrayCompare(secAttributesARR2c, (short)0, fcp, fcpOffset, (short)secAttributesARR2c.length)==0)) ) { + + bRes = true; + } + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0B; + reportTestOutcome(bTestCaseNb, bRes); + + + try { + + bRes = false; + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + //UICC FileView + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_ARR4, fcp, fcpOffset, fcpLength); + + fcpOffset=findTLV((byte)0x8B, fcp, fcpOffset); //security attributes + if ( (fcpOffset !=0) + && ((Util.arrayCompare(secAttributesARR4a, (short)0, fcp, fcpOffset, (short)secAttributesARR4a.length)==0) + ||(Util.arrayCompare(secAttributesARR4b, (short)0, fcp, fcpOffset, (short)secAttributesARR4b.length)==0) + ||(Util.arrayCompare(secAttributesARR4c, (short)0, fcp, fcpOffset, (short)secAttributesARR4c.length)==0)) ) { + + bRes = true; + } + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0C; + reportTestOutcome(bTestCaseNb, bRes); + + + + } // end if + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/Test_Api_1_Fvw_Stat.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/Test_Api_1_Fvw_Stat.java new file mode 100644 index 0000000..64ec511 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/Test_Api_1_Fvw_Stat.java @@ -0,0 +1,94 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_stat; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_1_Fvw_Stat extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_stat"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Stat() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" // LV Access Domain DAP field + ); + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 Status of MF */ + /** Testcase 2 Status after select EF TARU in MF */ + /** Testcase 3 Status of DF Telecom */ + /** Testcase 4 Status DF Telecom */ + /** Testcase 5 Status ADF1 */ + /** Testcase 6 fcp is null */ + /** Testcase 7 fcpOffset < 0 */ + /** Testcase 8 fcpLength < 0 */ + /** Testcase 9 fcpOffset + fcpLength > fcp.length */ + /** Testcase 10 fcpOffset + fcpLength > fcp.length */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/applet.opt new file mode 100644 index 0000000..34d03f4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_stat.Api_1_Fvw_Stat_1 +uicc.test.access.api_1_fvw_stat +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/javacard/api_1_fvw_stat.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_stat/javacard/api_1_fvw_stat.cap new file mode 100644 index 0000000000000000000000000000000000000000..efff8da701f35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;yFU}XJ7Y|Ua`KhhYg0o3ou2!O{h3INsHQjMa1 sTSQP!8b^VmdUvQ%)X&uj$}Q6h{IsgCw literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/Api_1_Fvw_Updb_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/Api_1_Fvw_Updb_1.java new file mode 100644 index 0000000..b864414 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/Api_1_Fvw_Updb_1.java @@ -0,0 +1,387 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Updb_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_updb; + +import javacard.framework.*; +import uicc.access.*; +import uicc.test.util.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.api_1_fvw_updb + * + * @version 0.0.1 - 8 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_1_Fvw_Updb_1 extends TestToolkitApplet implements UICCConstants +{ + private FileView UiccFileView = null; + + final short DATA_BUFFER_LENGTH = (short)0x14; + + byte[] data = new byte[DATA_BUFFER_LENGTH]; + byte[] compareBuffer = new byte[DATA_BUFFER_LENGTH]; + byte[] resp = new byte[DATA_BUFFER_LENGTH]; + + private short respOffset; + private short respLength; + + /** + * Constructor of the applet + */ + public Api_1_Fvw_Updb_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_1_Fvw_Updb_1 thisApplet = new Api_1_Fvw_Updb_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + short dataOffset = 0; + short dataLength = 10; + short fileOffset = 0; + + // Result of tests + boolean bRes = false; + byte testCaseNb = 0; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + + Util.arrayFillNonAtomic(data,(short)0,(short)data.length,(byte)0); + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + /*----------------------------------------------------------------------------------- + * TEST CASE 01: Errorcase, No EF selected + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x01; + bRes = false; + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + try { + data[0] = (byte)0x55; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.NO_EF_SELECTED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb,bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 02: Update transparent file at a given offset + *----------------------------------------------------------------*/ + testCaseNb = (byte)0x02; + bRes = false; + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + try { + + fileOffset = (short)0x03; + dataOffset = (short)0; + dataLength = (short)1; + + // Initialise data buffer + data[0] = (byte)0x55; + + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + // Read the updated file + respOffset = (short)0; + respLength = (short)1; + Util.arrayFillNonAtomic(resp,(short)0,(short)resp.length,(byte)0); + UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + // Initialise the compare buffer and check the readbinary() result + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)compareBuffer.length,(byte)0); + compareBuffer[0] = (byte)0x55; + if (Util.arrayCompare(resp, (short)0, compareBuffer, (short)0, DATA_BUFFER_LENGTH) == 0) + bRes = true; + + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 03: fileOffset = 254 + *----------------------------------------------------------------*/ + testCaseNb = (byte)0x03; + bRes = false; + try { + fileOffset = (short)0xFE; + dataOffset = 0; + dataLength = 3; + data[0] = (byte)0x55; + data[1] = (byte)0xAA; + data[2] = (byte)0x66; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + // Read the updated file + respOffset = (short)0; + respLength = (short)3; + Util.arrayFillNonAtomic(resp,(short)0,(short)resp.length,(byte)0); + UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + // Initialise the compare buffer and check the readbinary() result + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)compareBuffer.length,(byte)0); + compareBuffer[0] = (byte)0x55; + compareBuffer[1] = (byte)0xAA; + compareBuffer[2] = (byte)0x66; + if (Util.arrayCompare(resp, (short)0, compareBuffer, (short)0, DATA_BUFFER_LENGTH) == 0) + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 04: Errorcase, fileOffset < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x04; + bRes = false; + try { + fileOffset = (short)-1; + dataOffset = 0; + dataLength = 10; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_FILE_BOUNDARIES); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 05: Errorcase, fileOffset + dataLength > EF length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x05; + bRes = false; + try { + fileOffset = (short)259; + dataOffset = 0; + dataLength = 2; + + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_FILE_BOUNDARIES); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 06: Errorcase, data is null + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x06; + bRes = false; + try { + fileOffset = 0; + dataOffset = 0; + dataLength = 10; + UiccFileView.updateBinary(fileOffset, null, dataOffset, dataLength); + bRes = false; + } + catch (NullPointerException npe) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 07: Errorcase, dataOffset < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x07; + bRes = false; + try { + fileOffset = 0; + dataOffset = (short)-1; + dataLength = 10; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 08: Errorcase, dataLength < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x08; + bRes = false; + try { + fileOffset = 0; + dataOffset = 0; + dataLength = (short)-1; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 09: Errorcase, dataOffset + dataLength > data.Length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x09; + bRes = false; + try { + fileOffset = 0; + dataOffset = 0x0A; + dataLength = 0x0B; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 10: Errorcase, EF is not transparent + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0A; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + fileOffset = 0; + dataOffset = 0; + dataLength = 1; + + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 11: Errorcase, Access condition not fulfilled + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0B; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TNU); + + fileOffset = 0; + dataOffset = 0; + dataLength = 1; + + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 12: Errorcase, EF is invalidated + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0C; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_TNR); + UiccFileView.deactivateFile(); + + try { + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } + finally { + UiccFileView.activateFile(); + } + + reportTestOutcome(testCaseNb,bRes); + + /*---------------------------------------------------------------------------------- + * Reset the file content + *---------------------------------------------------------------------------------*/ + fileOffset = (short)0x00; + dataOffset = (short)0; + + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + // Initialise data buffer + byte[] toto = new byte[0x0104]; + Util.arrayFillNonAtomic(toto,(short)0,(short)toto.length,(byte)0xFF); + // Reset the file content + UiccFileView.updateBinary(fileOffset, toto, dataOffset, (short)toto.length); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/Test_Api_1_Fvw_Updb.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/Test_Api_1_Fvw_Updb.java new file mode 100644 index 0000000..85f040f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/Test_Api_1_Fvw_Updb.java @@ -0,0 +1,93 @@ +//----------------------------------------------------------------------------- +//Test_Api_1_Fvw_Updb.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_updb; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.api_1_fvw_updb + * + * @version 0.0.1 - 8 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_1_Fvw_Updb extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_updb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Updb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" // LV Access Domain DAP field + ); + + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 to 12 */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + test.reset(); + test.terminalProfileSession("0101"); + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/applet.opt new file mode 100644 index 0000000..74e0064 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_updb.Api_1_Fvw_Updb_1 +uicc.test.access.api_1_fvw_updb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/javacard/api_1_fvw_updb.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updb/javacard/api_1_fvw_updb.cap new file mode 100644 index 0000000000000000000000000000000000000000..35cd26670260922dca85a39a56336c8c98158d4c GIT binary patch literal 4357 zcmbVP4OA4@6~6P{o0x+9QcIY3iSH?nc+9@AXf+*2N5V7H`e({S}GNKlb25;~8(g`eJ_|YvAD< z561?otH<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{#X}zyW-GX(<3qC865PimzgD+v9B2huC_SLTPdlAOJN!jJ~ zNIWV=c~KNoQVESS2yB@}U`9r$juE1xI)Ua0LS%~|&_%3>6&0{Nmd~;c7FM8&$eam= zWT+B#GnCYY%*1qwruaCsJ;ojvV~S14!Fy_g-Ry9f9rk2LvOPIDSu$A7_RviCknEc#7hwkB75z zhI8Oj6ap@a6$KYVHppbA5CdLj0#<^|pdCiQ4GZuUJdoiE+ynEKX9I`YYL*5zRBU+M z7vL-@*K&L+z_;AsRw!nuKnZ+pY6{!S@$Nyf==LvN{VTo zBn%Ce5O-BMN36&nr+;N`=f}#gOk|nu$40SYxV6S+;?iL&zr>WxIniNetp(81=P record.length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0E; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = (short)1; + dataOffset = 0; + dataLength = 0x04; + recOffset = (short)2; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_RECORD_BOUNDARIES); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 15: Invalid mode, linear fixed file + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0F; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x04; + recOffset = (short)0; + // Call the updateRecord() method with mode set to 1 + UiccFileView.updateRecord(recNumber,(byte)1,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.INVALID_MODE); + } + catch (Exception e) { + bRes = false; + } + + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x04; + recOffset = (short)0; + // Call the updateRecord() method with mode set to 5 + UiccFileView.updateRecord(recNumber,(byte)5,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.INVALID_MODE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 16: Invalid mode cyclic file + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x10; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_CARU); + Util.arrayFillNonAtomic(data,(short)0,(short)data.length,(byte)0); + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x03; + recOffset = (short)0; + // Call the updateRecord() method with mode NEXT + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_NEXT,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes = ((e.getReason() == UICCException.INVALID_MODE) + ||(e.getReason() == UICCException.COMMAND_INCOMPATIBLE)); + } + catch (Exception e) { + bRes = false; + } + + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x03; + recOffset = (short)0; + // Call the updateRecord() method with mode CURRENT, recNumber set to 0 + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.INVALID_MODE) + ||(e.getReason() == UICCException.COMMAND_INCOMPATIBLE)); + } + catch (Exception e) { + bRes = false; + } + + try { + recNumber = (short)2; + dataOffset = 0; + dataLength = 0x03; + recOffset = (short)0; + // Call the updateRecord() method with mode ABSOLUTE, recNumber set to 2 + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.INVALID_MODE) + ||(e.getReason() == UICCException.COMMAND_INCOMPATIBLE)); + } + catch (Exception e) { + bRes = false; + } + + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x03; + recOffset = (short)0; + // Call the updateRecord() method with mode set to 5, recNumber set to 0 + UiccFileView.updateRecord(recNumber,(byte)5,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.INVALID_MODE) + ||(e.getReason() == UICCException.COMMAND_INCOMPATIBLE)); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 17: data is null + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x11; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = 1; + dataOffset = 0; + dataLength = 4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,null,dataOffset,dataLength); + bRes = false; + } + catch(NullPointerException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 18: dataOffset < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x12; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = 1; + dataOffset = (short)-1; + dataLength = 4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 19: dataLength < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x13; + bRes = false; + + try { + recNumber = 1; + dataOffset = (short)0; + dataLength = (short)-1; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 20: dataOffset + dataLength > data.length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x14; + bRes = false; + + try { + recNumber = 1; + dataOffset = (short)18; + dataLength = 4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 21: EF is neither cylic or linear fixed + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x15; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + + try { + recNumber = 1; + dataOffset = (short)0; + dataLength = (short)4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(UICCException e){ + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 22: Access not fulfilled + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x16; + bRes = false; + + // Select cylic file, Update access set to NEV + UiccFileView.select(UICCTestConstants.FID_EF_CNU); + + try { + recNumber = 0; + dataOffset = (short)0; + dataLength = (short)3; + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_PREVIOUS,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(UICCException e){ + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) { + bRes = false; + } + + // Select linear fixed file, Update access set to NEV + UiccFileView.select(UICCTestConstants.FID_EF_LNU); + + try { + recNumber = 1; + dataOffset = (short)0; + dataLength = (short)4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(UICCException e){ + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 23: EF is deactivated + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x17; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_CNR); + UiccFileView.deactivateFile(); + + try { + recNumber = 0; + dataOffset = (short)0; + dataLength = (short)3; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_PREVIOUS,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } + finally { + UiccFileView.activateFile(); + } + reportTestOutcome(testCaseNb,bRes); + + /*----------------------------------------- + * Restore the file content + *-----------------------------------------*/ + // Restore EF_LARU + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + recNumber = 1; + dataOffset = (short)0; + dataLength = (short)4; + Util.arrayFillNonAtomic(data,(short)0,dataLength,(byte)0x55); + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + + Util.arrayFillNonAtomic(data,(short)0,dataLength,(byte)0xAA); + recNumber = 2; + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + + // Restore EF CARU + UiccFileView.select(UICCTestConstants.FID_EF_CARU); + recNumber = 0; + dataLength = 3; + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_PREVIOUS,recOffset,data,dataOffset,dataLength); + + Util.arrayFillNonAtomic(data,(short)0,dataLength,(byte)0x55); + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_PREVIOUS,recOffset,data,dataOffset,dataLength); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/Test_Api_1_Fvw_Updr.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/Test_Api_1_Fvw_Updr.java new file mode 100644 index 0000000..5180ffe --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/Test_Api_1_Fvw_Updr.java @@ -0,0 +1,96 @@ +//----------------------------------------------------------------------------- +//Test_Api_1_Fvw_Updr.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_fvw_updr; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.api_1_fvw_updr + * + * @version 0.0.1 - 8 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_1_Fvw_Updr extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_fvw_updr"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Fvw_Updr() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" // LV Access Domain DAP field + ); + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 to 23 */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "17CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC"); + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/applet.opt new file mode 100644 index 0000000..68ccb3e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_fvw_updr.Api_1_Fvw_Updr_1 +uicc.test.access.api_1_fvw_updr +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/javacard/api_1_fvw_updr.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_fvw_updr/javacard/api_1_fvw_updr.cap new file mode 100644 index 0000000000000000000000000000000000000000..3764a0af33ee5410c1d24c6da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?6a|6jCcusHdSn3_u@-GCs>$7|bGLN8(RH78DqXf0+BknlV22 z#`>_5aYhVs)*!@7fq1-A3vwu0=d-V)p?tYvAq}Pf^}6Vy7YnkTxYEfFAQLU?;>DMG7G8E<}LS z!2onoMOUvOg^@N5B1{1$P{4keyIKgTercy5>OT>Tez9+m0!S;m2q55b4%h)neV3w0 zi@At$Cm0k-X_ul%>$r$A4O_y1eetjAQV?m06+v{0pg=kcZb6O=jRRy{4K(1MPWMsp Ee{?+%j{pDw literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/Api_1_Uex_Thit_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/Api_1_Uex_Thit_1.java new file mode 100644 index 0000000..bbec5b6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/Api_1_Uex_Thit_1.java @@ -0,0 +1,150 @@ +//----------------------------------------------------------------------------- +//Api_4_Aex_Thit_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_uex_thit; + +import uicc.test.util.* ; +import uicc.toolkit.*; +import uicc.access.*; +import javacard.framework.* ; + + +public class Api_1_Uex_Thit_1 extends TestToolkitApplet +{ + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_1_Uex_Thit_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_1_Uex_Thit_1 thisApplet = new Api_1_Uex_Thit_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false,(byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Number of tests + byte testCaseNb = (byte)0; + // Result of tests + boolean bRes = false; + + /** Test Case 1 : Throws the JCRE instance of UICCException with the specified reason 0 */ + testCaseNb = (byte)1; + bRes = false ; + try { + UICCException.throwIt((short) 0); + } + catch (UICCException UiccEx) { + bRes= (UiccEx.getReason() == (short)0); + } + catch( Exception e ) { + // Error, throw not as a UICCException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 2 : Throws the JCRE instance of UICCException with the specified reason 1*/ + testCaseNb = (byte)2; + bRes = false ; + + try { + UICCException.throwIt((short) 1); + } + catch (UICCException UiccEx) { + bRes = (UiccEx.getReason() == (short)1 ); + } + catch( Exception e ) { + // Error, throw not as a UICCException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 3 : Throws the JCRE instance of UICCException with the specified reason 0xA55A*/ + testCaseNb = (byte)3; + bRes = false ; + + try { + UICCException.throwIt((short) 0xA55A); + } + catch (UICCException UiccEx) { + bRes = (UiccEx.getReason() == (short)0xA55A ); + } + catch( Exception e ) { + // Error, throw not as a UICCException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 4 : UICCException extends javacard.framework.CardRuntimeException reason 0*/ + testCaseNb = (byte)4; + bRes = false ; + + try { + UICCException.throwIt((short) 0); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)0 ); + } + catch( Exception e ) { + // Error, throw not as a UICCException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 5 : UICCException extends javacard.framework.CardRuntimeException reason 1*/ + testCaseNb = (byte)5; + bRes = false ; + + try { + UICCException.throwIt((short) 1); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)1 ); + } + catch( Exception e ) { + // Error, throw not as a UICCException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 6 : UICCException extends javacard.framework.CardRuntimeException reason 0xA55A*/ + testCaseNb = (byte)6; + bRes = false ; + + try { + UICCException.throwIt((short) 0xA55A); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)0xA55A ); + } + catch( Exception e ) { + // Error, throw not as a UICCException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/Test_Api_1_Uex_Thit.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/Test_Api_1_Uex_Thit.java new file mode 100644 index 0000000..07ccc6b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/Test_Api_1_Uex_Thit.java @@ -0,0 +1,86 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_uex_thit; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_1_Uex_Thit extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/api_1_uex_thit"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_1_Uex_Thit() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1-6 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "06" + "CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/applet.opt new file mode 100644 index 0000000..3453f74 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_uex_thit.Api_1_Uex_Thit_1 +uicc.test.access.api_1_uex_thit +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/javacard/api_1_uex_thit.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_uex_thit/javacard/api_1_uex_thit.cap new file mode 100644 index 0000000000000000000000000000000000000000..824e036462cde228ef8581661ce69ba62608cfcf GIT binary patch literal 4605 zcmb7H32;-_6+M5^VtEr-U>h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o z0h#sSx?rH|fSnCI8ugr^QKt%sC*R@rCemOM(n00RN`-3~!_slh>i>iK4=IuUhx!le^;{UODHd8T0pVP1y_QR+emeE7)K8~=5%neLIXm?w z(q9V$Z;X2z+BjhYR_iUz;9q(hLdxK{1koCoFlIBv!JDBO+{CScP9SL!sBNL#txaDo zj1nwDnn)tNg9!J)L~($)8Ih7kbPGb7Tbn2fX>mh`ZAO%a=`o$yZXL1m`$}3;>UUs1 zQ;Y9bqi!#XIu&AcFNk^-Vsvka#_vN$_YS$bXM|T8VmA(;vu83blqf1zB*ku;$D3g$&isbS2bsiagoh36>2Kt<>)tiA047sO`h07$WUtL*cT-knYY0aTOK7}6 zP74iuqrOqsIUKOVv~i-^v-q6Bh0mZ{=PV(u_U*Y2J1te3u9?2`LL?$z|2cnJW=g2S&WG zG9mRvJ7x8i#!@PcB~%)hSTH;|qgt^$%q3JuODG>!+7*AHzyS4}6jo3%V=9H(6Y zzaRtJnRa@e1tD?#>kz5Jdy$qG^rCkTp!OjhIy+1L4hM9J3o?o`$dhVam(3QCo}Uo zC04XJJu6%k@4lcXeoGY!I!f98MhTl9*1{>cIY>N3KL-JbL==s(s~}Lt5ou10k24QK zG+hC@96a3(W)A&)7LqwiCNZR*%oA&2_LBulP*LblBbqXS?$1Pe zCQv_?Fn98F!Hld_`Jp>G!es_KdEbJ0vHKyda(^Mh8-5yN@Wg@2Zvf}~#!pl0qtfI>b5fF3+vjiF}gL5z!` zU<5h48bD3Yg8->?sr$T3L9(s}P_yeGz>QD<0?9qVwbd|cq8x;AQULYYkIVpVR@+yz z9!{uM;o9|}rOHl_wq glcFGqLe-?t8}^JM73OMaqd^Hg0zaoSl_FX1|AQE@H~;_u literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/Api_1_Usy_Getf_Bsbb_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/Api_1_Usy_Getf_Bsbb_1.java new file mode 100644 index 0000000..d620d67 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/Api_1_Usy_Getf_Bsbb_1.java @@ -0,0 +1,576 @@ +/** + * uicc.access package, getTheFileView tests + * applet 1 + */ + +package uicc.test.access.api_1_usy_getf_bsbb; + + +import javacard.framework.*; + +import uicc.access.*; +import uicc.system.*; +import uicc.test.util.*; +import uicc.toolkit.*; + + +public class Api_1_Usy_Getf_Bsbb_1 extends TestToolkitApplet implements UICCConstants { + + private boolean bRes; + private static boolean bRes1; + private short counter; + private short event_code; + private byte testCaseNb = 1; + private byte nbProcessCalls = 0; + private byte nbProcessTKCalls = 0; + private short transientAvailable; + private FileView fileView_1 = null; + private FileView fileView_2 = null; + private FileView fileView_3 = null; + private short fcpLen; + private byte[] fcp = new byte[TLVHANDLER_MAX_SIZE]; + private byte[] adf1Aid = new byte[16]; + private static byte[] buffer = new byte[20]; + private byte[] unknownAid = {(byte)'U',(byte)'n',(byte)'k',(byte)'n',(byte)'o',(byte)'w',(byte)'n',(byte)'A',(byte)'I',(byte)'D'}; + private byte[] comp = new byte[10]; + private byte[] checkFCP = new byte[2]; + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private UICCTestConstants uiccTestConstants; + private EditHandler editHandler; + private static final short DATA_SIZE = 10; + private static byte[] data = new byte[DATA_SIZE]; + private static final short TLVHANDLER_MAX_SIZE = 50; + + + /** + * Constructor of the applet + */ + public Api_1_Usy_Getf_Bsbb_1() { + //check this + editHandler = (EditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, + (short) TLVHANDLER_MAX_SIZE); + uiccTestConstants = new UICCTestConstants(); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, adf1Aid, (short) 0, + (short) adf1Aid.length); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, buffer, (short) 0, + (short) 16); + //check this + + } + + + /** + * Method called by the JCRE at the installation of the applet + * + * @param bArray + * @param bOffset + * @param bLength + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance + Api_1_Usy_Getf_Bsbb_1 thisApplet = new Api_1_Usy_Getf_Bsbb_1(); + + + /** Test case 1 + * Method returns null if called before register + */ + + try { + bRes1 = (UICCSystem.getTheFileView(buffer, (short) 0, (byte) 16, JCSystem.CLEAR_ON_RESET) == null); + } + catch(Exception e) { + bRes1 = false; + } + + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short) (bOffset + 1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + + + /** + * Method called by the JCRE, once selected + * This method allows to retrieve the detailed results of the previous execution + * may be identical for all tests + */ + public void process(APDU apdu) { + if (selectingApplet()) { + switch (++nbProcessCalls) { + + + /** Testcase 2 + * subpart 5 + */ + case 1: + + + try { + fileView_3 = UICCSystem.getTheFileView(buffer, (short) 0, (byte) 16, JCSystem.CLEAR_ON_DESELECT); + fcpLen = fileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + fileView_3.select(UICCTestConstants.FID_DF_TEST); + fileView_3.select(UICCTestConstants.FID_EF_TARU); + fileView_3.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + /** Testcase 2 + * subpart 6 + */ + case 2: + + try { + fcpLen = fileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_3.select(UICCTestConstants.FID_MF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + /** Testcase 6 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_DESELECT FileView object + */ + + case 3: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT); + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_DESELECT); + + try { + UICCSystem.getTheFileView(adf1Aid, (short) 0, (byte) 16, JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + + reportTestOutcome(testCaseNb++, bRes); + break; + + default: + super.process(apdu); + } + } + else { + ISOException.throwIt(javacard.framework.ISO7816.SW_INS_NOT_SUPPORTED); + } + } + + + + /** + * Method called by the CAT RE + * + * @param event + */ + public void processToolkit(short event) { + switch (++nbProcessTKCalls) { + + + /** Testcase 1 : Report result + * cf. install(...) + */ + + case 1: + bRes = false; + + try { + bRes = (UICCSystem.getTheFileView(unknownAid,(short) 0, (byte) 10, JCSystem.NOT_A_TRANSIENT_OBJECT) == null); + } + catch(Exception e) { + bRes = false; + } + + bRes &= bRes1; + + reportTestOutcome(testCaseNb++, bRes1); + break; + + + + /** Testcase 2 + * Normal execution + */ + + case 2: + + bRes = true; + + try { + fileView_1 = UICCSystem.getTheFileView(adf1Aid,(short) 0, (byte) 16, JCSystem.NOT_A_TRANSIENT_OBJECT); + fcpLen = fileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + fileView_1.select(UICCTestConstants.FID_DF_TEST); + fileView_1.select(UICCTestConstants.FID_EF_TARU); + fileView_1.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + case 3: + + try { + fcpLen = fileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_DF_TEST); + fileView_1.readBinary((short)0, data, (short)0, (short) 3); + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_1.select(UICCTestConstants.FID_MF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + + + try { + fileView_2 = UICCSystem.getTheFileView(adf1Aid,(short) 0, (byte) 16, JCSystem.CLEAR_ON_RESET); + fcpLen = fileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + fileView_2.select(UICCTestConstants.FID_DF_TEST); + fileView_2.select(UICCTestConstants.FID_EF_TARU); + fileView_2.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + case 4: + + try { + fcpLen = fileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_2.readBinary((short)0, data, (short)0, (short) 3); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.NO_EF_SELECTED); + } + + try { + fileView_2.select(UICCTestConstants.FID_DF_TEST); + fileView_2.select(UICCTestConstants.FID_MF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + case 5: + + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 3 + * FileView context independancy + */ + + case 6: + bRes = true; + + try { + bRes &= (fileView_1 != fileView_2); + bRes &= (fileView_2 != fileView_3); + bRes &= (fileView_3 != fileView_1); + + fileView_1.select(UICCTestConstants.FID_ADF); + fileView_1.select(UICCTestConstants.FID_DF_TEST); + fileView_1.select(UICCTestConstants.FID_EF_LARU); + + fileView_2.select(UICCTestConstants.FID_ADF); + fileView_2.select(UICCTestConstants.FID_DF_TEST); + fileView_2.select(UICCTestConstants.FID_EF_CARU); + + fileView_1.readRecord((short) 1, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 4); + comp[0] = (byte) 0x55; + comp[1] = (byte) 0x55; + comp[2] = (byte) 0x55; + comp[3] = (byte) 0x55; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 4) == 0); + + fileView_2.readRecord((short) 2, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xAA; + comp[1] = (byte) 0xAA; + comp[2] = (byte) 0xAA; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + try { + fileView_3.select(UICCTestConstants.FID_ADF); + fileView_3.select(UICCTestConstants.FID_DF_TEST); + fileView_3.select(UICCTestConstants.FID_EF_CARU); + bRes = false; + + } + catch (SecurityException e) { + bRes &= true; + } + catch (Exception e) { + bRes &= false; + } + reportTestOutcome(testCaseNb++, bRes); + break; + + + + /** Testcase 4 + * ILLEGAL_TRANSIENT SystemException + */ + + case 7: + bRes = false; + + try { + UICCSystem.getTheFileView(adf1Aid,(short) 0, (byte) 16, JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.ILLEGAL_TRANSIENT); + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 5 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_RESET FileView object + */ + + case 8: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_RESET); + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_RESET); + + try { + UICCSystem.getTheFileView(adf1Aid,(short) 0, (byte) 16, JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 7 + * ILLEGAL_VALUE SystemException + */ + + case 9: + bRes = false; + + counter = (short)0; + + for (event_code=(short)3; event_code <= (short)0xFF; event_code++) { + try { + UICCSystem.getTheFileView(adf1Aid,(short) 0, (byte) 16, (byte) event_code); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter++; + } + } + } + + if (counter == (short)253) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + + /** Testcase 8 + * NullPointerException + */ + + case 10: + bRes = false; + + try { + UICCSystem.getTheFileView(null, (short) 0, (byte) 16, JCSystem.NOT_A_TRANSIENT_OBJECT); + } + catch (NullPointerException e) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 9 + * ArrayIndexOutOfBoundsException + */ + + case 11: + bRes = false; + short counter = 0; + + try { + UICCSystem.getTheFileView(adf1Aid, (short) 5, (byte) 16, JCSystem.CLEAR_ON_RESET); + } + catch (ArrayIndexOutOfBoundsException e) { + counter++; + } + + try { + UICCSystem.getTheFileView(adf1Aid, (short) -1, (byte) 16, JCSystem.CLEAR_ON_RESET); + } + catch (ArrayIndexOutOfBoundsException e) { + counter++; + } + + bRes = (counter == (short)2); + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 10 + * SystemException.ILLEGAL_VALUE + */ + + case 12: + bRes = false; + counter = (short)0; + + try { + UICCSystem.getTheFileView(adf1Aid, (short) 0, (byte) 4, JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter ++; + } + } + + try { + UICCSystem.getTheFileView(buffer, (short) 0, (byte) 17, JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter++; + } + } + + bRes = (counter == (short)2); + + reportTestOutcome(testCaseNb++, bRes); + + break; + + + + } + } + + + /** + * Check that the current DF present in the global array fcp[] of + * length fcpLen corresponds to the fid given as parameter. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP(short fid) { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + checkFCP[0] = (byte) ((fid >> 8) & 0x00FF); + checkFCP[1] = (byte) (fid & 0x00FF); + return (editHandler.findAndCompareValue((byte) 0x83, checkFCP, (short) 0) == 0); + } + + + /** + * Check that the FCP present in the global array fcp[] of + * length fcpLen corresponds to the adf1 AID. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP_adf1() { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + return (editHandler.findAndCompareValue((byte) 0x84, adf1Aid, (short) 0) == 0); + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/Test_Api_1_Usy_Getf_Bsbb.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/Test_Api_1_Usy_Getf_Bsbb.java new file mode 100644 index 0000000..0a3cbb3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/Test_Api_1_Usy_Getf_Bsbb.java @@ -0,0 +1,201 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.access package part 1 + * Test source for getTheFileView tests + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_usy_getf_bsbb; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_1_Usy_Getf_Bsbb extends UiccTestModel { + static final String CAP_FILE_PATH = "uicc/test/access/api_1_usy_getf_bsbb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + static final String AID_ADF_2 = "A0000000 090005FF FFFFFF89 D0000002"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_1_Usy_Getf_Bsbb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + /** Test case 1 + * Method returns null if called before register() + */ + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00" + // LV ADF1 access domain DAP + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 1 + * cf. installation + * subpart 2 + */ + + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + /** Test case 2 + * Normal execution + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + response = test.selectApplication(APPLET_AID_1); + + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 3 + * FileView context independency + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 4 + * ILLEGAL_TRANSIENT SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 5 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_RESET FileView object + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 6 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_DESELECT FileView object + */ + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + + + /** Test case 7 + * ILLEGAL_VALUE SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Test case 8 + * NullPointerException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Testcase 9 + * ArrayIndexOutOfBoundsException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Testcase 10 + * SystemException.ILLEGAL_VALUE + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** + * Check Results and delete packages + */ + + test.reset(); + test.terminalProfileSession("0101"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "0ACCCCCC CCCCCCCC CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/applet.opt new file mode 100644 index 0000000..14edf6b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_usy_getf_bsbb.Api_1_Usy_Getf_Bsbb_1 +uicc.test.access.api_1_usy_getf_bsbb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/javacard/api_1_usy_getf_bsbb.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getf_bsbb/javacard/api_1_usy_getf_bsbb.cap new file mode 100644 index 0000000000000000000000000000000000000000..6c4311bf101e6782a9cadfcaaa369bb0c2565a94 GIT binary patch literal 6065 zcmbtY4RBP|6+ZXpz5CwV-Q?{iAsa$S2!=mNLimk_Kp_dpPcVW%Rb(&R3q>A7!1HoHVRJHFlX z&b{~Dd%kE97;>>oR&Rn-i+MRY4c{yC|Pi4PU(!R zX8?i=7F9QmNql(t#i?JfY8Wv;aol&U^OAR;*!$^=Gv{Ai{Mg821KO{Cm(*?)-;rEC zFyru*3;#Z~w`4Nk_qSYg=j-m0SH`SfkzxJP{Oi?;-EZZ!ExqrO@3E4~Hy?JN4bJst zJ(BvL*A71S>G^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ym;%RlN7HvFLkx zgIo!XSHt6v*yH70F^}{esrDTiRxWyyo(V?yl+Xli-{7?mI+xzUl_RIZWRYI4L-LI5 zfBjik!)LvpL96Vuirde27|44ahTM{|IE+q`Wy@llJzjNlLSU3Vm9B(^ww%Ol>34XQ z;Vo=IFSFT$ODJqfz*0h2f*ZQ4-|q6b;rlAp-UztP2xrs@f0VKb`Z4Jf3Zw$jOZ2A( zcv|*kc|oC>W@rss&b^cbXi(6o7VqF*M|hoT0(W1N!$e3-d=9=_a0!Yn&3;$7`+IUD zsq2&>N?y>hjlcv~P~}-}XsqHYwglC|UGam9@MSY0E@-ecQ@b6tvS49;(BNr3C5PFJ zk7O4k^a@$4xRo*2NyC<)n${Jc)+5bfZbVb`9TxdX_Ihd6hoyQ;)WraH6cWUIEW~QW%--E4^VxQA|{{wTY zD{x-bE9FOsw%?8@U`AgcY~TZ5{D@LKNo^0#Bn1&&OjheDSj7(2w~-As;a6{4@HhlaKms4 zjz8>;=y>m$iGd4H61d8#&~dVcDW7pqDwcI#AX|ikGTmkH1iQfD38D3WscTS-sjC82 zqH8X!=z6+{cQ_59rYf0^Bxkb5bUmKAg;wD8Fn8~xI9+ursm=kt4Gxd$N-~@oMfO^B z^(Muw4pvePBgfPSIeVlG((>a|J)SI6a|rDwN6Ju7iZjyUsj1tW52LjuO~zdjTVPP^ zudS$A7Qo0?8r(q+Vc3VU3k<*zgf?kSqM3Bt8?Ih53O3^*rdm`6TmUsP<|0rd!!8On zGV)?jFM}`aDdR5%>SYL~LcNT_1k`KDG*~a=F&);*5X`WsjKCZgcOr9IT*h@Si^U;} zvzUzT;w>fvHPhlUZgX248sQYQ!4WwJqLUS{17^$VV@!1d4w1v z$B!4$@nU>s2C$-IY^eIp8x;= literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/Api_1_Usy_Getfb_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/Api_1_Usy_Getfb_1.java new file mode 100644 index 0000000..6dff610 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/Api_1_Usy_Getfb_1.java @@ -0,0 +1,443 @@ +/** + * uicc.access package, getTheUICCView tests + * applet 1 + */ + +package uicc.test.access.api_1_usy_getfb; + + +import javacard.framework.*; + +import uicc.access.*; +import uicc.system.*; +import uicc.test.util.*; +import uicc.toolkit.*; + + +public class Api_1_Usy_Getfb_1 extends TestToolkitApplet implements UICCConstants { + + private boolean bRes; + private static boolean bRes1; + private short counter; + private short event_code; + private byte testCaseNb = 1; + private byte nbProcessCalls = 0; + private byte nbProcessTKCalls = 0; + private short transientAvailable; + private FileView fileView_1 = null; + private FileView fileView_2 = null; + private FileView fileView_3 = null; + private short fcpLen; + private byte[] fcp = new byte[TLVHANDLER_MAX_SIZE]; + private byte[] adf1Aid = new byte[16]; + private byte[] comp = new byte[10]; + private byte[] checkFCP = new byte[2]; + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private UICCTestConstants uiccTestConstants; + private EditHandler editHandler; + private static final short DATA_SIZE = 10; + private static byte[] data = new byte[DATA_SIZE]; + private static final short TLVHANDLER_MAX_SIZE = 50; + + + /** + * Constructor of the applet + */ + public Api_1_Usy_Getfb_1() { + editHandler = (EditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, + (short) TLVHANDLER_MAX_SIZE); + uiccTestConstants = new UICCTestConstants(); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, adf1Aid, (short) 0, + (short) adf1Aid.length); + + } + + + /** + * Method called by the JCRE at the installation of the applet + * + * @param bArray + * @param bOffset + * @param bLength + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance + Api_1_Usy_Getfb_1 thisApplet = new Api_1_Usy_Getfb_1(); + + + /** Test case 1 + * Method returns null if called before register + */ + + try { + bRes1 = (UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET) == null); + } + catch(Exception e) { + bRes1 = false; + } + + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short) (bOffset + 1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + + + /** + * Method called by the JCRE, once selected + * This method allows to retrieve the detailed results of the previous execution + * may be identical for all tests + */ + public void process(APDU apdu) { + if (selectingApplet()) { + switch (++nbProcessCalls) { + + + /** Testcase 2 + * subpart 5 + */ + case 1: + + + + try { + fileView_3 = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_DESELECT); + fcpLen = fileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + + fileView_3.select(UICCTestConstants.FID_DF_TEST); + fileView_3.select(UICCTestConstants.FID_EF_TARU); + fileView_3.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + /** Testcase 2 + * subpart 6 + */ + case 2: + + try { + fcpLen = fileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_3.select((short)0x7FFF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + /** Testcase 6 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_DESELECT FileView object + */ + + case 3: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT); + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_DESELECT); + + try { + UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + + reportTestOutcome(testCaseNb++, bRes); + break; + + default: + super.process(apdu); + } + } + else { + ISOException.throwIt(javacard.framework.ISO7816.SW_INS_NOT_SUPPORTED); + } + } + + + + /** + * Method called by the CAT RE + * + * @param event + */ + public void processToolkit(short event) { + switch (++nbProcessTKCalls) { + + + /** Testcase 1 : Report result + * cf. install(...) + */ + + case 1: + reportTestOutcome(testCaseNb++, bRes1); + break; + + + + /** Testcase 2 + * Normal execution + */ + + case 2: + + bRes = true; + + try { + fileView_1 = UICCSystem.getTheUICCView(JCSystem.NOT_A_TRANSIENT_OBJECT); + fcpLen = fileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + + fileView_1.select(UICCTestConstants.FID_DF_TEST); + fileView_1.select(UICCTestConstants.FID_EF_TARU); + fileView_1.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + case 3: + + try { + fcpLen = fileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_DF_TEST); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_1.select((short)0x7FFF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + + try { + fileView_2 = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + fcpLen = fileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + + fileView_2.select(UICCTestConstants.FID_DF_TEST); + fileView_2.select(UICCTestConstants.FID_EF_TARU); + fileView_2.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + case 4: + + try { + fcpLen = fileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_1.select((short)0x7FFF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + case 5: + + + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 3 + * FileView context independancy + */ + + case 6: + bRes = true; + + try { + bRes &= (fileView_1 != fileView_2); + bRes &= (fileView_2 != fileView_3); + bRes &= (fileView_3 != fileView_1); + + fileView_1.select(UICCTestConstants.FID_MF); + fileView_1.select(UICCTestConstants.FID_DF_TEST); + fileView_1.select(UICCTestConstants.FID_EF_LARU); + + fileView_2.select(UICCTestConstants.FID_MF); + fileView_2.select(UICCTestConstants.FID_DF_TEST); + fileView_2.select(UICCTestConstants.FID_EF_CARU); + + fileView_1.readRecord((short) 1, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 4); + comp[0] = (byte) 0x55; + comp[1] = (byte) 0x55; + comp[2] = (byte) 0x55; + comp[3] = (byte) 0x55; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 4) == 0); + + fileView_2.readRecord((short) 2, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xAA; + comp[1] = (byte) 0xAA; + comp[2] = (byte) 0xAA; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + try { + fileView_3.select(UICCTestConstants.FID_MF); + fileView_3.select(UICCTestConstants.FID_DF_TEST); + fileView_3.select(UICCTestConstants.FID_EF_CARU); + bRes = false; + } + catch (SecurityException e) { + bRes &= true; + } + catch (Exception e) { + bRes &= false; + } + reportTestOutcome(testCaseNb++, bRes); + break; + + + + /** Testcase 4 + * ILLEGAL_TRANSIENT SystemException + */ + + case 7: + bRes = false; + + try { + UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.ILLEGAL_TRANSIENT); + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 5 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_RESET FileView object + */ + + case 8: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_RESET); + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_RESET); + + try { + UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 7 + * ILLEGAL_VALUE SystemException + */ + + case 9: + bRes = false; + + counter = (short)0; + + for (event_code=(short)3; event_code <= (short)0xFF; event_code++) { + try { + UICCSystem.getTheUICCView((byte)event_code); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter++; + } + } + } + + if (counter == (short)253) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + } + } + + + /** + * Check that the current DF present in the global array fcp[] of + * length fcpLen corresponds to the fid given as parameter. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP(short fid) { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + checkFCP[0] = (byte) ((fid >> 8) & 0x00FF); + checkFCP[1] = (byte) (fid & 0x00FF); + return (editHandler.findAndCompareValue((byte) 0x83, checkFCP, (short) 0) == 0); + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/Test_Api_1_Usy_Getfb.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/Test_Api_1_Usy_Getfb.java new file mode 100644 index 0000000..2145af4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/Test_Api_1_Usy_Getfb.java @@ -0,0 +1,177 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.access package part 1 + * Test source for getTheUICCFileView tests + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_usy_getfb; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_1_Usy_Getfb extends UiccTestModel { + static final String CAP_FILE_PATH = "uicc/test/access/api_1_usy_getfb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + static final String AID_ADF_2 = "A0000000 090005FF FFFFFF89 D0000002"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_1_Usy_Getfb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + /** Test case 1 + * Method returns null if called before register() + */ + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00" + // LV ADF1 access domain DAP + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 1 + * cf. installation + */ + + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + /** Test case 2 + * Normal execution + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + response = test.selectApplication(APPLET_AID_1); + + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 3 + * FileView context independency + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 4 + * ILLEGAL_TRANSIENT SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 5 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_RESET FileView object + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 6 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_DESELECT FileView object + */ + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + + + /** Test case 7 + * ILLEGAL_VALUE SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** + * Check Results and delete packages + */ + + test.reset(); + test.terminalProfileSession("0101"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "07CCCCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/applet.opt new file mode 100644 index 0000000..be2b804 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_usy_getfb.Api_1_Usy_Getfb_1 +uicc.test.access.api_1_usy_getfb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/javacard/api_1_usy_getfb.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfb/javacard/api_1_usy_getfb.cap new file mode 100644 index 0000000000000000000000000000000000000000..cdfbfcf590d4b190e5d469243c5870018e0b2d3a GIT binary patch literal 5267 zcmbtY4RBP|6+ZXp{bv6YlNa*0i6B(XZ=(cK24g}LAs7r=3sqc`#f`*dlPs}BNL~_R z5<>z+(LzVSYB5q*aEit1Xq_o-r?E^+>o`_BT5DSeEv-!b9Y^W8FCm+K3X>h*+w<-58;@xR>Tmdt#6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ElqqqHMY$%FrDqcYd7N9FuK)x;IWG+SCZH zSV~bw74XZ#TRb-kcd?$5^_1~x&0^ARl$mZ5<sW9q;9Mwk&6gi_ZpXY_1jacdK6Z-t}LqYtf@EM z(}!JxMW6h{{UH9BP0GydJ$KA5O6Zuaiv%K#_0^5RChOo+F+LR0AjP1eCfK~Gn89S& zi$d|jpduc)W~iyU3R?vw27E(s!^)O=1aD~;C$5H}=vXKL=l%qmSvUtD3(|#T-O~6 z#~Zm*#bXjz!>J~7nNvl>iRnrbWtvmxuvt-Um%JF+JPMaI)roJK=6Aasx*}&td9I5b zX)5EIn|T%WO6Hi^;hkCWS6Wlk2rhwE#d(~d0kDRr3MUyBfSOqt6*N8n55@9QW zkceCif_>~=aA1~2 z<<%IGtQ7oE0voJ51mbR*x|^X5-#VZZwjkjxqE5sxvAzw0puS-&JoxF z4`A5^55Zp8XZ0Q+MN+5;$Pp>z_e&x0V7ZfAMf}7gU)cxzXfeH7K6gRGxJjMcS8JizCRa)6n)B>zb=Q3NjZtSoBd{qWwdq# zd)gX9xC#w7dxW?o)(&D%Qez;;5(0^(tab!@b{a$QvqY8=%T?_N_DnK{@M=N`_Po-L zV^79nIG^J#n!Q0P&!uK|0DI~c18Bx{a`phRM9hw0Kj>lzw>uI+upN7L82hmngLxw% m7~3Idhp~U6V=x`AL{=03!LD5)Vd{%tPrQrJur=ZzCHOyPQR15b literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/Api_1_Usy_Getfob_1.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/Api_1_Usy_Getfob_1.java new file mode 100644 index 0000000..d352458 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/Api_1_Usy_Getfob_1.java @@ -0,0 +1,517 @@ +/** + * uicc.access package, getTheFileView tests + * applet 1 + */ + +package uicc.test.access.api_1_usy_getfob; + + +import javacard.framework.*; + +import uicc.access.*; +import uicc.system.*; +import uicc.test.util.*; +import uicc.toolkit.*; + + +public class Api_1_Usy_Getfob_1 extends TestToolkitApplet implements UICCConstants { + + private boolean bRes; + private static boolean bRes1; + private short event_code; + private short counter; + private byte testCaseNb = 1; + private byte nbProcessCalls = 0; + private byte nbProcessTKCalls = 0; + private short transientAvailable; + private FileView fileView_1 = null; + private FileView fileView_2 = null; + private FileView fileView_3 = null; + private short fcpLen; + private byte[] fcp = new byte[TLVHANDLER_MAX_SIZE]; + private byte[] abAdf1Aid = new byte[16]; + private static AID adf1Aid = null; + private byte[] abUnknownAid = {(byte)'U',(byte)'n',(byte)'k',(byte)'n',(byte)'o',(byte)'w',(byte)'n',(byte)'A',(byte)'I',(byte)'D'}; + private AID unknownAid = new AID( abUnknownAid, (short) 0, (byte) 10); + private byte[] comp = new byte[10]; + private byte[] checkFCP = new byte[2]; + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private UICCTestConstants uiccTestConstants; + private EditHandler editHandler; + private static final short DATA_SIZE = 10; + private static byte[] data = new byte[DATA_SIZE]; + private static final short TLVHANDLER_MAX_SIZE = 50; + + + /** + * Constructor of the applet + */ + public Api_1_Usy_Getfob_1() { + editHandler = (EditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, + (short) TLVHANDLER_MAX_SIZE); + uiccTestConstants = new UICCTestConstants(); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, abAdf1Aid, (short) 0, + (short) abAdf1Aid.length); + adf1Aid = new AID(abAdf1Aid, (short) 0, (byte) abAdf1Aid.length); + + } + + + /** + * Method called by the JCRE at the installation of the applet + * + * @param bArray + * @param bOffset + * @param bLength + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance + Api_1_Usy_Getfob_1 thisApplet = new Api_1_Usy_Getfob_1(); + + + /** Test case 1 + * Method returns null if called before register + */ + + try { + bRes1 = (UICCSystem.getTheFileView(adf1Aid, JCSystem.CLEAR_ON_RESET) == null); + } + catch(Exception e) { + bRes1 = false; + } + + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short) (bOffset + 1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + + + /** + * Method called by the JCRE, once selected + * This method allows to retrieve the detailed results of the previous execution + * may be identical for all tests + */ + public void process(APDU apdu) { + if (selectingApplet()) { + switch (++nbProcessCalls) { + + + /** Testcase 2 + * subpart 5 + */ + case 1: + + try { + fileView_3 = UICCSystem.getTheFileView(adf1Aid, JCSystem.CLEAR_ON_DESELECT); + fcpLen = fileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + fileView_3.select(UICCTestConstants.FID_DF_TEST); + fileView_3.select(UICCTestConstants.FID_EF_TARU); + fileView_3.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + /** Testcase 2 + * subpart 6 + */ + case 2: + + try { + fcpLen = fileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_3.select(UICCTestConstants.FID_MF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + /** Testcase 6 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_DESELECT FileView object + */ + + case 3: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT); + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_DESELECT); + + try { + UICCSystem.getTheFileView(adf1Aid, JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + + reportTestOutcome(testCaseNb++, bRes); + break; + + default: + super.process(apdu); + } + } + else { + ISOException.throwIt(javacard.framework.ISO7816.SW_INS_NOT_SUPPORTED); + } + } + + + + /** + * Method called by the CAT RE + * + * @param event + */ + public void processToolkit(short event) { + switch (++nbProcessTKCalls) { + + + /** Testcase 1 : Report result + * cf. install(...) + */ + + case 1: + bRes = false; + + try { + bRes = (UICCSystem.getTheFileView(unknownAid, JCSystem.NOT_A_TRANSIENT_OBJECT) == null); + } + catch(Exception e) { + bRes = false; + } + + bRes &= bRes1; + + reportTestOutcome(testCaseNb++, bRes1); + break; + + + + /** Testcase 2 + * Normal execution + */ + + case 2: + + bRes = true; + + try { + fileView_1 = UICCSystem.getTheFileView(adf1Aid, JCSystem.NOT_A_TRANSIENT_OBJECT); + fcpLen = fileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + fileView_1.select(UICCTestConstants.FID_DF_TEST); + fileView_1.select(UICCTestConstants.FID_EF_TARU); + fileView_1.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + case 3: + + try { + fcpLen = fileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_DF_TEST); + fileView_1.readBinary((short)0, data, (short)0, (short) 3); + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_1.select(UICCTestConstants.FID_MF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + + + try { + fileView_2 = UICCSystem.getTheFileView(adf1Aid, JCSystem.CLEAR_ON_RESET); + fcpLen = fileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + fileView_2.select(UICCTestConstants.FID_DF_TEST); + fileView_2.select(UICCTestConstants.FID_EF_TARU); + fileView_2.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + case 4: + + try { + fcpLen = fileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_2.readBinary((short)0, data, (short)0, (short) 3); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.NO_EF_SELECTED); + } + + try { + fileView_2.select(UICCTestConstants.FID_DF_TEST); + fileView_2.select(UICCTestConstants.FID_MF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + case 5: + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 3 + * FileView context independancy + */ + + case 6: + bRes = true; + + try { + bRes &= (fileView_1 != fileView_2); + bRes &= (fileView_2 != fileView_3); + bRes &= (fileView_3 != fileView_1); + + fileView_1.select(UICCTestConstants.FID_ADF); + fileView_1.select(UICCTestConstants.FID_DF_TEST); + fileView_1.select(UICCTestConstants.FID_EF_LARU); + + fileView_2.select(UICCTestConstants.FID_ADF); + fileView_2.select(UICCTestConstants.FID_DF_TEST); + fileView_2.select(UICCTestConstants.FID_EF_CARU); + + + + + fileView_1.readRecord((short) 1, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 4); + comp[0] = (byte) 0x55; + comp[1] = (byte) 0x55; + comp[2] = (byte) 0x55; + comp[3] = (byte) 0x55; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 4) == 0); + + fileView_2.readRecord((short) 2, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xAA; + comp[1] = (byte) 0xAA; + comp[2] = (byte) 0xAA; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + + try { + fileView_3.select(UICCTestConstants.FID_ADF); + fileView_3.select(UICCTestConstants.FID_DF_TEST); + fileView_3.select(UICCTestConstants.FID_EF_CARU); + bRes = false; + + } + catch (SecurityException e) { + bRes &= true; + } + catch (Exception e) { + bRes &= false; + } + + + reportTestOutcome(testCaseNb++, bRes); + break; + + + + /** Testcase 4 + * ILLEGAL_TRANSIENT SystemException + */ + + case 7: + bRes = false; + + try { + UICCSystem.getTheFileView(adf1Aid, JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.ILLEGAL_TRANSIENT); + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 5 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_RESET FileView object + */ + + case 8: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_RESET); + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_RESET); + + try { + UICCSystem.getTheFileView(adf1Aid, JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 7 + * ILLEGAL_VALUE SystemException + */ + + case 9: + bRes = false; + + counter = (short)0; + + for (event_code=(short)3; event_code <=(short)0xFF; event_code++) { + try { + UICCSystem.getTheFileView(adf1Aid, (byte) event_code); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter++; + } + } + } + + if (counter == (short)253) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 8 + * NullPointerException + */ + + case 10: + bRes = false; + + try { + UICCSystem.getTheFileView(null, JCSystem.NOT_A_TRANSIENT_OBJECT); + } + catch (NullPointerException e) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + + adf1Aid = null; + break; + + + } + } + + + /** + * Check that the current DF present in the global array fcp[] of + * length fcpLen corresponds to the fid given as parameter. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP(short fid) { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + checkFCP[0] = (byte) ((fid >> 8) & 0x00FF); + checkFCP[1] = (byte) (fid & 0x00FF); + return (editHandler.findAndCompareValue((byte) 0x83, checkFCP, (short) 0) == 0); + } + + + /** + * Check that the FCP present in the global array fcp[] of + * length fcpLen corresponds to the adf1 AID. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP_adf1() { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + return (editHandler.findAndCompareValue((byte) 0x84, abAdf1Aid, (short) 0) == 0); + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/Test_Api_1_Usy_Getfob.java b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/Test_Api_1_Usy_Getfob.java new file mode 100644 index 0000000..4952d4e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/Test_Api_1_Usy_Getfob.java @@ -0,0 +1,185 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.access package part 1 + * Test source for getTheFileView tests + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.api_1_usy_getfob; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_1_Usy_Getfob extends UiccTestModel { + static final String CAP_FILE_PATH = "uicc/test/access/api_1_usy_getfob"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 10010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 10010102"; + static final String AID_ADF_2 = "A0000000 090005FF FFFFFF89 D0000002"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_1_Usy_Getfob() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + /** Test case 1 + * Method returns null if called before register() + */ + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00" + // LV ADF1 access domain DAP + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 1 + * cf. installation + * subpart 2 + */ + + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + /** Test case 2 + * Normal execution + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + response = test.selectApplication(APPLET_AID_1); + + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 3 + * FileView context independency + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 4 + * ILLEGAL_TRANSIENT SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 5 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_RESET FileView object + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 6 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_DESELECT FileView object + */ + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + + + /** Test case 7 + * ILLEGAL_VALUE SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Test case 8 + * NullPointerException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** + * Check Results and delete packages + */ + + test.reset(); + test.terminalProfileSession("0101"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "08CCCCCC CCCCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/applet.opt new file mode 100644 index 0000000..4849685 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x01:0x00:0x01 uicc.test.access.api_1_usy_getfob.Api_1_Usy_Getfob_1 +uicc.test.access.api_1_usy_getfob +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x10:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/javacard/api_1_usy_getfob.cap b/source/Annex_E_SourceCode/uicc/test/access/api_1_usy_getfob/javacard/api_1_usy_getfob.cap new file mode 100644 index 0000000000000000000000000000000000000000..38cb7b89425fde2fee292ec1c5b022f3f95c6427 GIT binary patch literal 5781 zcmbtY3v^V)8UE*SXYRfG$lc9CHiVE6-UuXM#3&6I6JGL=3Zgs|!xBgcWET>G23l?s zVuFMakrvU4Kx+x$8qf$AsA&A``7?6o70sVLWBS5H6XwnM_IZHl z!dt=(d4V5{dS}`v8@7x-)v@Xy8KEbim>c@}8$)Kxv_Hpk-wWcrMT4Dd> zt?HL$Xvkf#C$OzyZb@KLiRW--8$Zyn`@vIRG#@CsW#!?gmJB?6^5a!|*WD9XYz%5T zu%WZ^$;t0rcH8LG1Fy|K)8+l_d$aabKIYwbj@mfZ`o_NesN!@c}~{u#T$lK zw~hJiho95DXFh#z|IkO@*?za@Xy)$bBU2Z;4$reX_MQEA`%fFb{O_dWsZEs&y8PFd zbq$<4>(2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0s`vjaa3cm^}{pcFm{dohJ=Tq9U`?%IuZqwzlJ^ zs(-imQ;Zl@{?)lt%+<-AViwkv)>MRMRFtiAjuko{&n14CCc#wN9}A9iqGuv$u<>g8sN*F+Rfsd0`F zQzc6Xp;JFaj!bgXbW4suY@MziJ);f4V!~v?;gW`N(NBtD>utTT~@w z)uD|Q5sdqkWnH8TkKTCv$3RZh(+0gkHj-{s+_PXmSCz?p$CCl6@5^s zRRIWtIu(O(s8eBx26ZYD5wKMSBNFOVJfcILfy{vIDl##_R>6qNrfy_zo2!t-V{sU5ZA&bxEDuVIb9O~f^?1QJ&P>4Zpg?5;!W`R+~5jaV%#8D8F(6`}n z{v$}i*qO@Ba2n>S_W1q`v^j@+rMnvER}1P_=lr%hPaC!)Z-G{9+v@z<;U3fiCPdzk zrR~TMqI#SJZM`*Z*y|x|e-zstN4^gpfs^pKQ+pcrb$63ItvnCN39a0^O)JmN*2=*` z-cGI|*}Q9_=;|sVmaE(fVJn$mo())1O!Has2{y?R<<=ouM6X>ihtL4V>gTSJ`rk*W zYoz#eu}dW-#q9MV7rMKMN%;dRH;M2oc9W3^k$7DZgD67NCIJz5d69^ccsUV6`9*Rl zv8#$ih{Rio7{oA^)I?%;6p0XtHwZC^v&lgu-X|miB?j6tpurf?Ct;N0b76NPLSk4Q zLugM9Ar@pOLL`1?V-SDwBsGbIuWlkv;#W0>v)r2$PQo`f5hu~b$8fI1TfiiY67TRA U%+c_M2i-3Iu0}^O-MQ)dA5!*LUH||9 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/Api_4_Aex_Coor_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/Api_4_Aex_Coor_1.java new file mode 100644 index 0000000..83adb1c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/Api_4_Aex_Coor_1.java @@ -0,0 +1,60 @@ +//----------------------------------------------------------------------------- +//Api_4_Aex_Coor_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_aex_coor; + +import uicc.test.util.* ; +import uicc.toolkit.*; +import uicc.access.fileadministration.*; + + +public class Api_4_Aex_Coor_1 extends TestToolkitApplet +{ + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_4_Aex_Coor_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_4_Aex_Coor_1 thisApplet = new Api_4_Aex_Coor_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false,(byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + boolean bRes = false; + byte testCaseNb = (byte)0; + + /** Test Case 1 : AdminException with the specified set reason */ + testCaseNb = (byte)1; + bRes = false ; + AdminException UiccEx = new AdminException((short)19); + bRes = (UiccEx.getReason() == (short)19); + + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/Test_Api_4_Aex_Coor.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/Test_Api_4_Aex_Coor.java new file mode 100644 index 0000000..02db496 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/Test_Api_4_Aex_Coor.java @@ -0,0 +1,86 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_aex_coor; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_4_Aex_Coor extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_aex_coor"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Aex_Coor() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/applet.opt new file mode 100644 index 0000000..4b0e042 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_aex_coor.Api_4_Aex_Coor_1 +uicc.test.access.fileadministration.api_4_aex_coor +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/javacard/api_4_aex_coor.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_coor/javacard/api_4_aex_coor.cap new file mode 100644 index 0000000000000000000000000000000000000000..f919313342c9c3222752f157ba5b36f9aa658ffe GIT binary patch literal 4352 zcmb_e3v3i+5T1S9qt^otuBC;xv_NT(M|)hMKrIN@7aZ;3(E~J8Qn%MFcl5YB_O_)I z(Q6wlSY8Dyk)(=fNyR8Cm=F{pkysu zJKxOw^Ur*aVupR+=1#`8(?^_Lp{A&UiO|*wExj+uBxq^YU(Y+SY+$i@D##@{@o0iU;2| ze35vt=}6rmXTik$`H9rHW|*Gzdvx*0Yd+^;_t90YmCfUtP5Hj-)!n;xj2SzaDpYl^ znzr==@#?)zeEpH`Lyc>?rXE)v|25FwacR#~b=z<0YaMNI3$m_{ANb1T*~Yp4mnZaW zxdBG+S0`hJ#7^j(JLG_?_QAGNTikrk^m=`lYrXE?$%|#}shQSKW9u?DZ`P!khMv8! zqH_1Gyd~A+CS>pFcege0WoYo?k2=y14K@D!UC#B?`}WrJ53WqUJ7!-fv}5)C{qJ;p zl3i_Y-Fo|n)>Sh?3v6pk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 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/Api_4_Aex_Thit_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/Api_4_Aex_Thit_1.java new file mode 100644 index 0000000..50c31e6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/Api_4_Aex_Thit_1.java @@ -0,0 +1,151 @@ +//----------------------------------------------------------------------------- +//Api_4_Aex_Thit_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_aex_thit; + +import uicc.test.util.* ; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.access.fileadministration.*; +import javacard.framework.* ; + + +public class Api_4_Aex_Thit_1 extends TestToolkitApplet +{ + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_4_Aex_Thit_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_4_Aex_Thit_1 thisApplet = new Api_4_Aex_Thit_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false,(byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Number of tests + byte testCaseNb = (byte)0; + // Result of tests + boolean bRes = false; + + /** Test Case 1 : Throws the JCRE instance of AdminException with the specified reason 0 */ + testCaseNb = (byte)1; + bRes = false ; + try { + AdminException.throwIt((short) 0); + } + catch (AdminException AdminEx) { + bRes= (AdminEx.getReason() == (short)0); + } + catch( Exception e ) { + // Error, throw not as an AdminException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 2 : Throws the JCRE instance of AdminException with the specified reason 1*/ + testCaseNb = (byte)2; + bRes = false ; + + try { + AdminException.throwIt((short) 1); + } + catch (AdminException AdminEx) { + bRes = (AdminEx.getReason() == (short)1 ); + } + catch( Exception e ) { + // Error, throw not as an AdminException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 3 : Throws the JCRE instance of AdminException with the specified reason 0xA55A*/ + testCaseNb = (byte)3; + bRes = false ; + + try { + AdminException.throwIt((short) 0xA55A); + } + catch (AdminException AdminEx) { + bRes = (AdminEx.getReason() == (short)0xA55A ); + } + catch( Exception e ) { + // Error, throw not as an AdminException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 4 : AdminException extends javacard.framework.CardRuntimeException reason 0*/ + testCaseNb = (byte)4; + bRes = false ; + + try { + AdminException.throwIt((short) 0); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)0 ); + } + catch( Exception e ) { + // Error, throw not as an AdminException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 5 : AdminException extends javacard.framework.CardRuntimeException reason 1*/ + testCaseNb = (byte)5; + bRes = false ; + + try { + AdminException.throwIt((short) 1); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)1 ); + } + catch( Exception e ) { + // Error, throw not as an AdminException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 6 : AdminException extends javacard.framework.CardRuntimeException reason 0xA55A*/ + testCaseNb = (byte)6; + bRes = false ; + + try { + AdminException.throwIt((short) 0xA55A); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)0xA55A ); + } + catch( Exception e ) { + // Error, throw not as an AdminException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/Test_Api_4_Aex_Thit.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/Test_Api_4_Aex_Thit.java new file mode 100644 index 0000000..d371e82 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/Test_Api_4_Aex_Thit.java @@ -0,0 +1,86 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_aex_thit; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_4_Aex_Thit extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_aex_thit"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Aex_Thit() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1-6 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "06" + "CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/applet.opt new file mode 100644 index 0000000..6b5c980 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_aex_thit.Api_4_Aex_Thit_1 +uicc.test.access.fileadministration.api_4_aex_thit +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/javacard/api_4_aex_thit.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_aex_thit/javacard/api_4_aex_thit.cap new file mode 100644 index 0000000000000000000000000000000000000000..1c55a87c04c3c73e4aac8124e578465f268dcec4 GIT binary patch literal 5139 zcmbtX3vg7`8UD__cOQAN8wg1>1VVWvA%ry%sS+C4yfoxtOd>>H>CNVbY_i#1c5fhn zEqS1b0YX5n2nDA=D(x_3B$0>H@+eiI6k4@)h8Z5#0VyI%p+d2m{%4bA$rWalJ$L@u zJ?H%AeE<2+`Clakq7(%qeft(Kd<1v2C`c&EE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rj<$&YdW#YE_e6lY@^ zZLfK2uMXdH$U>u>f<-S?Y6@L8U##E{E`)rjP#2G}24kS1bsQj&?&bfRD^Fh}v)Ja#vEdoETOnz&aLL{g2|BD5M?4ZXg&m`X4L znnkogMiLnTH8KJR#(__9quoe)x`c4*nDHZw?(HSMaYRW-t&L(O+a)YwS<*B!n)yf`4u5u`d z@7uO-BTN5=`A${w)X27bO#8!x7oj|_$(FrJaTQn=jNBCRopu$%>@4V~P>Q2wLQG1Y z0f`bDFLDb5r}*C4koH&^FxYvVayVc}nw?daMceDEtR9cN7>24RYihiT3RXt{3l-;l zwU(qL?0zK;a(i4n3+q2Aq@*%hu2U8&P8CvBsp18j1*TwVA=jJ5Av@<=a+_?5n;6-p_a&j0at2kO2H@xmhxCbBWIK7ovnZ-+?V z4ylZM+7Mz-6?~lZMf zg=N0sCBY}KfQwv`2MP3oL}CoX$DnjJ9>Z}0roNFq{*f+3^o^|ZkF+AZZ^X$*Mj!#R z{i|~QBNP3r68s}(pHE?!$W@3*z5_qz)8J$}P6VdV0Zqsxx#KaFBpCrK?K~3MblgO8 z9!W^X6Xc0fC@&sQ{-+S>bi!iVFAGl+R}N*1xs*$k;c=RKnv&gORM1Qbo}rlv%%R^| zm`AeKqmn#c19?CvT(H57MkrW_MW{s+7Q>DuSVkPphW`Qp_^9s;4NCc2YbNDF}1}<05gYPNigU1#~6PpqD9u$5dq|D!6N&s3N56zcnCl)ASW8kVFRUv7E_zT z1~4lP!C`6=S}m|Pdkp}e4iZ?C%W8qO>1hDCkz!sjS{|6JYH_tWV*s~;VrX!<{TXCQ TfsP7jP(%vHOnNe1JV4|B(#wz% literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/Api_4_Afb_Gtaf_Bsbb_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/Api_4_Afb_Gtaf_Bsbb_1.java new file mode 100644 index 0000000..ac83ff9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/Api_4_Afb_Gtaf_Bsbb_1.java @@ -0,0 +1,599 @@ +/** + * uicc.access.fileadministration package, getTheAdminFileView tests + * applet 1 + */ + +package uicc.test.access.fileadministration.api_4_afb_gtaf_bsbb; + + +import javacard.framework.*; + +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.system.*; +import uicc.test.util.*; +import uicc.toolkit.*; + + +public class Api_4_Afb_Gtaf_Bsbb_1 extends TestToolkitApplet implements UICCConstants { + + private static boolean bRes; + private static boolean bRes1; + private short counter; + private short event_code; + private byte testCaseNb = 1; + private byte nbProcessCalls = 0; + private byte nbProcessTKCalls = 0; + private short transientAvailable; + private AdminFileView adminFileView_1 = null; + private AdminFileView adminFileView_2 = null; + private AdminFileView adminFileView_3 = null; + private byte[] data = null; + private short fcpLen; + private byte[] fcp = new byte[TLVHANDLER_MAX_SIZE]; + private byte[] adf1Aid = new byte[16]; + private static byte[] buffer = new byte[20]; + private byte[] unknownAid = {(byte)'U',(byte)'n',(byte)'k',(byte)'n',(byte)'o',(byte)'w',(byte)'n',(byte)'A',(byte)'I',(byte)'D'}; + private byte[] comp = new byte[10]; + private byte[] checkFCP = new byte[2]; + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private UICCTestConstants uiccTestConstants; + private EditHandler editHandler; + private static final short DATA_SIZE = 10; + private static final short TLVHANDLER_MAX_SIZE = 50; + + + /** + * Constructor of the applet + */ + public Api_4_Afb_Gtaf_Bsbb_1() { + editHandler = (EditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, + (short) TLVHANDLER_MAX_SIZE); + uiccTestConstants = new UICCTestConstants(); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, adf1Aid, (short) 0, + (short) adf1Aid.length); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, buffer, (short) 0, + (short) 16); + data = new byte[DATA_SIZE]; + } + + + /** + * Method called by the JCRE at the installation of the applet + * + * @param bArray + * @param bOffset + * @param bLength + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance + Api_4_Afb_Gtaf_Bsbb_1 thisApplet = new Api_4_Afb_Gtaf_Bsbb_1(); + + + /** Test case 1 + * Method returns null if called before register + */ + + try { + bRes1 = (AdminFileViewBuilder.getTheAdminFileView(buffer, (short) 0, (byte) 16, JCSystem.CLEAR_ON_RESET) == null); + } + catch(Exception e) { + bRes1 = false; + } + + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short) (bOffset + 1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + + + /** + * Method called by the JCRE, once selected + * This method allows to retrieve the detailed results of the previous execution + * may be identical for all tests + */ + public void process(APDU apdu) { + if (selectingApplet()) { + switch (++nbProcessCalls) { + + + /** Testcase 2 + * subpart 5 + */ + case 1: + + try { + adminFileView_3 = AdminFileViewBuilder.getTheAdminFileView(buffer, (short) 0, (byte) 16, JCSystem.CLEAR_ON_DESELECT); + fcpLen = adminFileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + adminFileView_3.select(UICCTestConstants.FID_DF_TEST); + adminFileView_3.select(UICCTestConstants.FID_EF_TARU); + adminFileView_3.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + + break; + + + /** Testcase 2 + * subpart 6 + */ + case 2: + + try { + fcpLen = adminFileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + } + catch (Exception e) { + bRes = false; + } + + try { + adminFileView_3.select(UICCTestConstants.FID_ADF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + /** Testcase 6 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_DESELECT FileView object + */ + + case 3: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT); + if (transientAvailable < (short)0x7FFF) + { + // The test could be performed + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_DESELECT); + try { + AdminFileViewBuilder.getTheAdminFileView(adf1Aid, (short) 0, (byte) 16, JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + } + else + { + // Available memory is greater than 32767, the test could not be performed + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + default: + super.process(apdu); + } + } + else { + ISOException.throwIt(javacard.framework.ISO7816.SW_INS_NOT_SUPPORTED); + } + } + + + + /** + * Method called by the CAT RE + * + * @param event + */ + public void processToolkit(short event) { + switch (++nbProcessTKCalls) { + + + /** Testcase 1 : Report result + * cf. install(...) + */ + + case 1: + bRes = false; + + try { + bRes = (AdminFileViewBuilder.getTheAdminFileView(unknownAid,(short) 0, (byte) 10, JCSystem.NOT_A_TRANSIENT_OBJECT) == null); + } + catch(Exception e) { + bRes = false; + } + + bRes &= bRes1; + + reportTestOutcome(testCaseNb++, bRes); + break; + + + + /** Testcase 2 + * Normal execution + */ + + case 2: + + bRes = true; + + try { + adminFileView_1 = AdminFileViewBuilder.getTheAdminFileView(adf1Aid,(short) 0, (byte) 16, JCSystem.NOT_A_TRANSIENT_OBJECT); + fcpLen = adminFileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + adminFileView_1.select(UICCTestConstants.FID_DF_TEST); + adminFileView_1.select(UICCTestConstants.FID_EF_TARU); + adminFileView_1.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + case 3: + + try { + fcpLen = adminFileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_DF_TEST); + adminFileView_1.readBinary((short)0, data, (short)0, (short) 3); + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + + try { + adminFileView_1.select(UICCTestConstants.FID_ADF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + + + try { + adminFileView_2 = AdminFileViewBuilder.getTheAdminFileView(adf1Aid,(short) 0, (byte) 16, JCSystem.CLEAR_ON_RESET); + fcpLen = adminFileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + + adminFileView_2.select(UICCTestConstants.FID_DF_TEST); + adminFileView_2.select(UICCTestConstants.FID_EF_TARU); + adminFileView_2.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + case 4: + + try { + fcpLen = adminFileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP_adf1(); + } + catch (Exception e) { + bRes = false; + } + + try { + adminFileView_2.readBinary((short)0, data, (short)0, (short) 3); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.NO_EF_SELECTED); + } + + try { + adminFileView_2.select(UICCTestConstants.FID_DF_TEST); + adminFileView_2.select(UICCTestConstants.FID_EF_RFU1); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + case 5: + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 3 + * FileView context independancy + */ + + case 6: + bRes = true; + + try { + bRes &= (adminFileView_1 != adminFileView_2); + bRes &= (adminFileView_2 != adminFileView_3); + bRes &= (adminFileView_3 != adminFileView_1); + + adminFileView_1.select(UICCTestConstants.FID_ADF); + adminFileView_1.select(UICCTestConstants.FID_DF_TEST); + adminFileView_1.select(UICCTestConstants.FID_EF_LARU); + + adminFileView_2.select(UICCTestConstants.FID_ADF); + adminFileView_2.select(UICCTestConstants.FID_DF_TEST); + adminFileView_2.select(UICCTestConstants.FID_EF_CARU); + + try { + adminFileView_3.select(UICCTestConstants.FID_ADF); + adminFileView_3.select(UICCTestConstants.FID_DF_TEST); + adminFileView_3.select(UICCTestConstants.FID_EF_CARU); + bRes = false; + } + catch (SecurityException e) + { + bRes &=true; + } + catch (Exception e) + { + bRes =false; + } + adminFileView_1.readRecord((short) 1, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 4); + comp[0] = (byte) 0x55; + comp[1] = (byte) 0x55; + comp[2] = (byte) 0x55; + comp[3] = (byte) 0x55; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 4) == 0); + + adminFileView_2.readRecord((short) 2, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xAA; + comp[1] = (byte) 0xAA; + comp[2] = (byte) 0xAA; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + + /** Testcase 4 + * ILLEGAL_TRANSIENT SystemException + */ + + case 7: + bRes = false; + + try { + AdminFileViewBuilder.getTheAdminFileView(adf1Aid,(short) 0, (byte) 16, JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.ILLEGAL_TRANSIENT); + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 5 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_RESET FileView object + */ + + case 8: + + bRes = false; + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_RESET); + if (transientAvailable < (short)0x7FFF) + { + // The test could be performed + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_RESET); + try { + AdminFileViewBuilder.getTheAdminFileView(adf1Aid,(short) 0, (byte) 16, JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + } + else + { + // Available memory is greater than 32767, the test could not be performed + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + + break; + + + /** Testcase 7 + * ILLEGAL_VALUE SystemException + */ + + case 9: + bRes = false; + + counter = 0; + + for (event_code=-128; event_code <= 127; event_code++) { + + // Go to next iteration if event_code is a valid value + if ((event_code >= 0) && (event_code <=2)) { + continue; + } + + try { + AdminFileViewBuilder.getTheAdminFileView(adf1Aid,(short) 0, (byte) 16, (byte) event_code); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter++; + } + } + } + + if (counter == 253) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + + /** Testcase 8 + * NullPointerException + */ + + case 10: + bRes = false; + + try { + AdminFileViewBuilder.getTheAdminFileView(null, (short) 0, (byte) 16, JCSystem.NOT_A_TRANSIENT_OBJECT); + } + catch (NullPointerException e) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 9 + * ArrayIndexOutOfBoundsException + */ + + case 11: + bRes = false; + short counter = 0; + + try { + AdminFileViewBuilder.getTheAdminFileView(adf1Aid, (short) 5, (byte) 16, JCSystem.CLEAR_ON_RESET); + } + catch (ArrayIndexOutOfBoundsException e) { + counter++; + } + + try { + AdminFileViewBuilder.getTheAdminFileView(adf1Aid, (short) -1, (byte) 16, JCSystem.CLEAR_ON_RESET); + } + catch (ArrayIndexOutOfBoundsException e) { + counter++; + } + + bRes = (counter == 2); + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 10 + * SystemException.ILLEGAL_VALUE + */ + + case 12: + bRes = false; + counter = 0; + + try { + AdminFileViewBuilder.getTheAdminFileView(adf1Aid, (short) 0, (byte) 4, JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter ++; + } + } + + try { + AdminFileViewBuilder.getTheAdminFileView(buffer, (short) 0, (byte) 17, JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter++; + } + } + + bRes = (counter == 2); + + reportTestOutcome(testCaseNb++, bRes); + + break; + + + + } + } + + + /** + * Check that the current DF present in the global array fcp[] of + * length fcpLen corresponds to the fid given as parameter. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP(short fid) { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + checkFCP[0] = (byte) ((fid >> 8) & 0x00FF); + checkFCP[1] = (byte) (fid & 0x00FF); + return (editHandler.findAndCompareValue((byte) 0x83, checkFCP, (short) 0) == 0); + } + + + /** + * Check that the FCP present in the global array fcp[] of + * length fcpLen corresponds to the adf1 AID. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP_adf1() { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + return (editHandler.findAndCompareValue((byte) 0x84, adf1Aid, (short) 0) == 0); + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/Test_Api_4_Afb_Gtaf_Bsbb.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/Test_Api_4_Afb_Gtaf_Bsbb.java new file mode 100644 index 0000000..54cb4a9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/Test_Api_4_Afb_Gtaf_Bsbb.java @@ -0,0 +1,201 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.access.fileadministration package part 4 + * Test source for getTheAdminFileView tests + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afb_gtaf_bsbb; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_4_Afb_Gtaf_Bsbb extends UiccTestModel { + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + static final String AID_ADF_2 = "A0000000 090005FF FFFFFF89 D0000002"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_4_Afb_Gtaf_Bsbb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + /** Test case 1 + * Method returns null if called before register() + */ + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00" + // LV ADF1 access domain DAP + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 1 + * cf. installation + * subpart 2 + */ + + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + /** Test case 2 + * Normal execution + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + response = test.selectApplication(APPLET_AID_1); + + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 3 + * FileView context independency + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 4 + * ILLEGAL_TRANSIENT SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 5 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_RESET FileView object + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 6 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_DESELECT FileView object + */ + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 7 + * ILLEGAL_VALUE SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Test case 8 + * NullPointerException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Testcase 9 + * ArrayIndexOutOfBoundsException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Testcase 10 + * SystemException.ILLEGAL_VALUE + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** + * Check Results and delete packages + */ + + test.reset(); + test.terminalProfileSession("0101"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "0ACCCCCC CCCCCCCC CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/applet.opt new file mode 100644 index 0000000..76169b0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afb_gtaf_bsbb.Api_4_Afb_Gtaf_Bsbb_1 +uicc.test.access.fileadministration.api_4_afb_gtaf_bsbb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/javacard/api_4_afb_gtaf_bsbb.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtaf_bsbb/javacard/api_4_afb_gtaf_bsbb.cap new file mode 100644 index 0000000000000000000000000000000000000000..a79b11c2a2f452d9d90e6b7ccbad4448eef00c60 GIT binary patch literal 10167 zcmb_C3wTu3(KF|q``FEHa`PZ8frJDk0!l(cAkieik`N6Lh$NsDm2Q#^S@T+wO$ZNv zm-ibLP!KB>#fsYf0YRw+MbK)cwMy$}D_TXYR;^TgfK}VlId?Z~vIM_R;hsHv=DcR+ z%*=Vsz2y_RNC2I}fw}D?q05s10?Ni$I){}`F3Bu&PA)AOUs0J+R`TB?0D+3K=0(FD z&u%!?f8N{C<8O5Cd*`)}Ph_vXw>E#h^*1>cKW!ZO?Pu5LShL69bRcK!)@NV+Zo%;F zS$Ax%Jhj2{@`lY&^X4y(_F6ME@$er;eRuo@yZ^$#cN{6d?wfgc zJ$c^?^}p~a{Z`k!Qk1UeU2*1b>vNagHf;FU_8Gs@^RC@7?15c--k2J9ywc)$Vbv?A zzuhox%QxDXzr4CCDlzW0uiv@+nJ5|LlXmU-kG6 zGxlFsH>Yy4=jM$cKm75cAt#?7tvAnl;*qldd!^q$>z3cjqqX;&J!! z2W>Z58vh*g#?#mDT5(hKnX%L7KYr%)@%p?se!c0b4~IS6_Sq+cAA9+e*K_~;%m@3% zEZy>AX8A--ug*SN5I}$rRDg0)xz$v(RC(R{Pkug)axzY&*ygFO&h)ukeVMN6YIkdE zX04~e?W$??G8h=oIm_p&omtgdRh4f^&Z)q3+z5ICtxp5jGhoQ~Z%g!`v5pTHMvX z=9al~01VP#D#Zlw!8?$qAA})z9{_H*mw*Zk`e+y-&0fzm#P=pXWV|HObb7rFZl7d^ zLqdcU5fD4N%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$ zKM@EM-c3iE;8p4(K6mK$!9XPK$j<@7w4JmzUo`FT#{rRqBfkR(6Fzh)2#3E4h$I~O zf<8=m8(GdpkGS&&*!j9Xl6>U*>@fMy=>_`5lka@H9Z5Ix-F2AmZR#bU8-9}=NjTCI z945RY<`NK&@C!#$kM#D2sgE-*0rd#qZzT0d|6-W>Wcv8zqLtm<+Zaha(vcM=UPUhR aOF%s2)+(Q54|%*>bo literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/Api_4_Afb_Gtafb_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/Api_4_Afb_Gtafb_1.java new file mode 100644 index 0000000..6258a91 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/Api_4_Afb_Gtafb_1.java @@ -0,0 +1,468 @@ +/** + * uicc.access.fileadministration package, getTheUICCAdminFileView tests + * applet 1 + */ + +package uicc.test.access.fileadministration.api_4_afb_gtafb; + + +import javacard.framework.*; + +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.system.*; +import uicc.test.util.*; +import uicc.toolkit.*; + + +public class Api_4_Afb_Gtafb_1 extends TestToolkitApplet implements UICCConstants { + + private boolean bRes; + private static boolean bRes1; + private short counter; + private short event_code; + private byte testCaseNb = 1; + private byte nbProcessCalls = 0; + private byte nbProcessTKCalls = 0; + private short transientAvailable; + private AdminFileView adminFileView_1 = null; + private AdminFileView adminFileView_2 = null; + private AdminFileView adminFileView_3 = null; + private byte[] data = null; + private short fcpLen; + private byte[] fcp = new byte[TLVHANDLER_MAX_SIZE]; + private byte[] adf1Aid = new byte[16]; + private byte[] comp = new byte[10]; + private byte[] checkFCP = new byte[2]; + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private UICCTestConstants uiccTestConstants; + private EditHandler editHandler; + private static final short DATA_SIZE = 10; + private static final short TLVHANDLER_MAX_SIZE = 50; + + + /** + * Constructor of the applet + */ + public Api_4_Afb_Gtafb_1() { + editHandler = (EditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, + (short) TLVHANDLER_MAX_SIZE); + uiccTestConstants = new UICCTestConstants(); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, adf1Aid, (short) 0, + (short) adf1Aid.length); + data = new byte[DATA_SIZE]; + } + + + /** + * Method called by the JCRE at the installation of the applet + * + * @param bArray + * @param bOffset + * @param bLength + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance + Api_4_Afb_Gtafb_1 thisApplet = new Api_4_Afb_Gtafb_1(); + + + /** Test case 1 + * Method returns null if called before register + */ + + try { + bRes1 = (AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET) == null); + } + catch(Exception e) { + bRes1 = false; + } + + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short) (bOffset + 1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + + + /** + * Method called by the JCRE, once selected + * This method allows to retrieve the detailed results of the previous execution + * may be identical for all tests + */ + public void process(APDU apdu) { + if (selectingApplet()) { + switch (++nbProcessCalls) { + + + /** Testcase 2 + * subpart 5 + */ + case 1: + + try { + adminFileView_3 = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_DESELECT); + fcpLen = adminFileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + + adminFileView_3.select(UICCTestConstants.FID_DF_TEST); + adminFileView_3.select(UICCTestConstants.FID_EF_TARU); + adminFileView_3.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + /** Testcase 2 + * subpart 6 + */ + case 2: + + try { + fcpLen = adminFileView_3.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + } + catch (Exception e) { + bRes = false; + } + + try { + adminFileView_3.select((short)0x7FFF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + /** Testcase 6 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_DESELECT FileView object + */ + + case 3: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT); + if (transientAvailable < (short)0x7FFF) + { + // The test could be performed + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_DESELECT); + try { + AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + } + else + { + // Available memory is greater than 32767, the test could not be performed + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + default: + super.process(apdu); + } + } + else { + ISOException.throwIt(javacard.framework.ISO7816.SW_INS_NOT_SUPPORTED); + } + } + + + + /** + * Method called by the CAT RE + * + * @param event + */ + public void processToolkit(short event) { + switch (++nbProcessTKCalls) { + + + /** Testcase 1 : Report result + * cf. install(...) + */ + + case 1: + reportTestOutcome(testCaseNb++, bRes1); + break; + + + + /** Testcase 2 + * Normal execution + */ + + case 2: + + bRes = true; + + try { + adminFileView_1 = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.NOT_A_TRANSIENT_OBJECT); + fcpLen = adminFileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + + adminFileView_1.select(UICCTestConstants.FID_DF_TEST); + adminFileView_1.select(UICCTestConstants.FID_EF_TARU); + adminFileView_1.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + case 3: + + try { + fcpLen = adminFileView_1.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_DF_TEST); + } + catch (Exception e) { + bRes = false; + } + + try { + adminFileView_1.select((short)0x7FFF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + + try { + adminFileView_2 = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + fcpLen = adminFileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + + adminFileView_2.select(UICCTestConstants.FID_DF_TEST); + adminFileView_2.select(UICCTestConstants.FID_EF_TARU); + adminFileView_2.readBinary((short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xFF; + comp[1] = (byte) 0xFF; + comp[2] = (byte) 0xFF; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + break; + + + case 4: + + try { + fcpLen = adminFileView_2.status(fcp, (short) 0, (short) fcp.length); + bRes &= checkFCP(UICCTestConstants.FID_MF); + } + catch (Exception e) { + bRes = false; + } + + try { + adminFileView_1.select((short)0x7FFF); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.FILE_NOT_FOUND); + } + break; + + + case 5: + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 3 + * FileView context independancy + */ + + case 6: + bRes = true; + + try { + bRes &= (adminFileView_1 != adminFileView_2); + bRes &= (adminFileView_2 != adminFileView_3); + bRes &= (adminFileView_3 != adminFileView_1); + + adminFileView_1.select(UICCTestConstants.FID_MF); + adminFileView_1.select(UICCTestConstants.FID_DF_TEST); + adminFileView_1.select(UICCTestConstants.FID_EF_LARU); + + adminFileView_2.select(UICCTestConstants.FID_MF); + adminFileView_2.select(UICCTestConstants.FID_DF_TEST); + adminFileView_2.select(UICCTestConstants.FID_EF_CARU); + + try + { + adminFileView_3.select(UICCTestConstants.FID_MF); + adminFileView_3.select(UICCTestConstants.FID_DF_TEST); + adminFileView_3.select(UICCTestConstants.FID_EF_CARU); + bRes = false; + } + catch (SecurityException e) + { + bRes &=true; + } + catch (Exception e) + { + bRes = false; + } + + adminFileView_1.readRecord((short) 1, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 4); + comp[0] = (byte) 0x55; + comp[1] = (byte) 0x55; + comp[2] = (byte) 0x55; + comp[3] = (byte) 0x55; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 4) == 0); + + adminFileView_2.readRecord((short) 2, REC_ACC_MODE_ABSOLUTE, (short)0, data, (short)0, (short) 3); + comp[0] = (byte) 0xAA; + comp[1] = (byte) 0xAA; + comp[2] = (byte) 0xAA; + bRes &= (Util.arrayCompare(comp, (short) 0, data, (short) 0, (short) 3) == 0); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + + /** Testcase 4 + * ILLEGAL_TRANSIENT SystemException + */ + + case 7: + bRes = false; + + try { + AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_DESELECT); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.ILLEGAL_TRANSIENT); + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 5 + * NO_TRANSIENT_SPACE SystemException with CLEAR_ON_RESET FileView object + */ + + case 8: + bRes = false; + + transientAvailable = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_TRANSIENT_RESET); + if (transientAvailable < (short)0x7FFF) + { + // The test could be performed + data = JCSystem.makeTransientByteArray( transientAvailable, JCSystem.CLEAR_ON_RESET); + try { + AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.NO_TRANSIENT_SPACE); + } + + data = null; + JCSystem.requestObjectDeletion(); + } + else + { + // Available memory is greater than 32767, the test could not be performed + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 7 + * ILLEGAL_VALUE SystemException + */ + + case 9: + bRes = false; + + counter = 0; + + for (event_code=-128; event_code <= 127; event_code++) { + + // Go to next iteration if event_code is a valid value + if ((event_code >= 0) && (event_code <=2)) { + continue; + } + + try { + AdminFileViewBuilder.getTheUICCAdminFileView((byte)event_code); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter++; + } + } + } + + if (counter == 253) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + + break; + + } + } + + + /** + * Check that the current DF present in the global array fcp[] of + * length fcpLen corresponds to the fid given as parameter. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP(short fid) { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + checkFCP[0] = (byte) ((fid >> 8) & 0x00FF); + checkFCP[1] = (byte) (fid & 0x00FF); + return (editHandler.findAndCompareValue((byte) 0x83, checkFCP, (short) 0) == 0); + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/Test_Api_4_Afb_Gtafb.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/Test_Api_4_Afb_Gtafb.java new file mode 100644 index 0000000..2a986ff --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/Test_Api_4_Afb_Gtafb.java @@ -0,0 +1,176 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.access.fileadministration package part 4 + * Test source for getTheUICCAdminFileView tests + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afb_gtafb; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_4_Afb_Gtafb extends UiccTestModel { + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_afb_gtafb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + static final String AID_ADF_2 = "A0000000 090005FF FFFFFF89 D0000002"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_4_Afb_Gtafb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + /** Test case 1 + * Method returns null if called before register() + */ + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00" + // LV ADF1 access domain DAP + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 1 + * cf. installation + */ + + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + /** Test case 2 + * Normal execution + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + response = test.selectApplication(APPLET_AID_1); + + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 3 + * FileView context independency + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 4 + * ILLEGAL_TRANSIENT SystemException + */ + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 5 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_RESET FileView object + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 6 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_DESELECT FileView object + */ + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 7 + * ILLEGAL_VALUE SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** + * Check Results and delete packages + */ + + test.reset(); + test.terminalProfileSession("0101"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "07CCCCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/applet.opt new file mode 100644 index 0000000..81a0d05 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afb_gtafb.Api_4_Afb_Gtafb_1 +uicc.test.access.fileadministration.api_4_afb_gtafb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/javacard/api_4_afb_gtafb.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafb/javacard/api_4_afb_gtafb.cap new file mode 100644 index 0000000000000000000000000000000000000000..7bdb8cea0ecd89b1210f89cf0c7efb71336193e3 GIT binary patch literal 8783 zcmbtZ3wTpiwq9%R^GMRPN!kJ_ZE1O0UVZVfQi_B=ptfLbD=3x0G)+lpNHR?-&w-Rz zK`0>TjIWPD1Z0p1YEiF_s8{b5@Tz##&*y;Gar7G$FEgLcFyqzUwNKKfjp#Sp?5uOv z*{^@?wbwp-owaMKxReSyN>8u6Z3^`HrGf-=%j<0uE9X_@&9%*|tSGOm&z)QG-5G#z z-CW=LeCx?Qm$FuUm{h)S=9A~{eshyExB1?Su4y@k?pbp*^}+77{N}2T!@qiAobm0diz{+!?BA}s z=frPcsygJ7GqyFI=3{h4W4l^UXTJDA^72c@^rwvPR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}HOPdN~VI1lAD@MDbEQB9VV*r?iFo6Uih7nGNU^s#0kbu)9k~W_TDRx6Lmr~YX z+AfEXjB_bBgJPbUBwZa<9uM=Wn=xihqQpQ<@(jq&=3#-?yngvn>0M>WR05oQ{50Qpv=Rooxd zD(;HbL05#CN&|^1{OxEFgf)eaq@j-@CBIHeE`qZp#dK0Z2`T&!r0_a82lZrM=b;f= z;D5+TYJ-nS(uz?i%38`~C{E3u)2O;c+he=sSDgBvxKMoh*QFt7_fG&6u{sJ$- zoA6h7i_%x{HoOa8le#~Fe^Bc`!8g?U@9=+c8NMT5t{amO(S#YuFcZh1gjZoc%2tNgQ2G+@TV=ddm?#4QH4?BkS>^M7#^VxIkC0xM% zgPp;f*emQT-pt-$f5wIE0=s~>u+Q0-xQP8P>&9C-aE5jY@F}>It2_~x@g$yvK5pU} z=;xVyA_jOa&&MDy;FEC;pTdiAEuYS3;W}Q*t8hK9=C!zy*YP^s%-dO(WzGSJ}}djDDQ6|q;~f6@DPIKC#{toS-Dks=fpejUD1 zQ-v&*3VRMV`yPXdgU$ZGA3Ej~y%?ff#FdWBV!eDpW*zZO2Yi4Q4;p{s6$9N*o8f>! z`<;Kq= 0) && (event_code <=2)) { + continue; + } + + try { + AdminFileViewBuilder.getTheAdminFileView(adf1Aid, (byte) event_code); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + counter++; + } + } + } + + if (counter == 253) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + break; + + + /** Testcase 8 + * NullPointerException + */ + + case 10: + bRes = false; + + try { + AdminFileViewBuilder.getTheAdminFileView(null, JCSystem.NOT_A_TRANSIENT_OBJECT); + } + catch (NullPointerException e) { + bRes = true; + } + + reportTestOutcome(testCaseNb++, bRes); + + break; + + + } + } + + + /** + * Check that the current DF present in the global array fcp[] of + * length fcpLen corresponds to the fid given as parameter. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP(short fid) { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + checkFCP[0] = (byte) ((fid >> 8) & 0x00FF); + checkFCP[1] = (byte) (fid & 0x00FF); + return (editHandler.findAndCompareValue((byte) 0x83, checkFCP, (short) 0) == 0); + } + + + /** + * Check that the FCP present in the global array fcp[] of + * length fcpLen corresponds to the adf1 AID. + * + * @param fid + * @return true if the fid corresponds to the DF present in fcp[] + */ + + private boolean checkFCP_adf1() { + + //fcp contains BERTL and length can be 1 or 2 bytes + byte offsetFcpTLVList=2; + + editHandler.clear(); + if (fcp[1]==0x81){ + offsetFcpTLVList=3; + } + editHandler.appendArray(fcp, (short) offsetFcpTLVList, (short) (fcpLen-offsetFcpTLVList)); + return (editHandler.findAndCompareValue((byte) 0x84, abAdf1Aid, (short) 0) == 0); + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/Test_Api_4_Afb_Gtafob.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/Test_Api_4_Afb_Gtafob.java new file mode 100644 index 0000000..7ebc038 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/Test_Api_4_Afb_Gtafob.java @@ -0,0 +1,185 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.access.fileadministration package part 4 + * Test source for getTheAdminFileView tests + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afb_gtafob; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_4_Afb_Gtafob extends UiccTestModel { + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_afb_gtafob"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + static final String AID_ADF_2 = "A0000000 090005FF FFFFFF89 D0000002"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_4_Afb_Gtafob() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + /** Test case 1 + * Method returns null if called before register() + */ + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00" + // LV ADF1 access domain DAP + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 1 + * cf. installation + * subpart 2 + */ + + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + /** Test case 2 + * Normal execution + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + response = test.selectApplication(APPLET_AID_1); + + + test.reset(); + test.terminalProfileSession("0101"); + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 3 + * FileView context independency + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 4 + * ILLEGAL_TRANSIENT SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 5 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_RESET FileView object + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** Test case 6 + * NO_TRANSIENT_SPACE Exception with CLEAR_ON_DESELECT FileView object + */ + + response = test.selectApplication(APPLET_AID_1); + response = test.selectApplication(AID_ADF_2); + + test.reset(); + test.terminalProfileSession("0101"); + + + /** Test case 7 + * ILLEGAL_VALUE SystemException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Test case 8 + * NullPointerException + */ + + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + + /** + * Check Results and delete packages + */ + + test.reset(); + test.terminalProfileSession("0101"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "08CCCCCC CCCCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/applet.opt new file mode 100644 index 0000000..63e441e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afb_gtafob.Api_4_Afb_Gtafob_1 +uicc.test.access.fileadministration.api_4_afb_gtafob +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/javacard/api_4_afb_gtafob.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afb_gtafob/javacard/api_4_afb_gtafob.cap new file mode 100644 index 0000000000000000000000000000000000000000..84b31489be04213142e41ccff28645d1d3d3b23a GIT binary patch literal 9720 zcmbta34B!5)j#LnJMYa*Cdp(W41t7zAW?*{8wdd=5HPYxNk9c#m?RT2CCp5dfgnVj z1Oxlw2mseH|pFRD{=ZIpJ zvqNnoJV(C&LI2gSrQz z$0wgHx#Yb3gH=xyoj)&shAMdS#MsM6T(~=Z@x!m0|1;$+-=WP%cdQvW=kQNzeNN-X zr4#>p>w&HH&)Bc{-tlD>WA~SrZr>Xi`qs?pr*_PkxU22bu|F@*n)E>3m|KqL>@+^S z>XkR%y|wISXaBS(2Ichm^DV0HDk6G-it6sb`;;Rc)7k$^a(pTeatS!0(P5q6- zYkXm*%iehI^m{@mV)vau>>%4|{H~vZ{FrY-r90ngw}0`cK|rNpCg7W3?Bsh|pwV9w z2{m4=Sr;^bE(2s!g#Jnc%>Pg(ZzkejxOS6`m~18|3Gw#YBkOyE2@O3LqBk6F@JBQ! zlCqP8$Hd&!T@v@~`sKK05Z2Ih;uXuop+<|iqKKKKyAMD@uz4qvY6dIa6q||Cq@s+o z6u}CUT4hNU&(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g?k@bsXj2!j|Gr}YH(Tx0t>g*?~e4|@QrHZy>83p+ z_25}Qul14JoN6+6z!dHoo^!L*Dff|>HK;+v0vPh@SbmXNzkDwg{sB@eQT?5aXN`UQ9b2 zxfRYzHQJCcLgz5tBPR&zz#~Gs<7NyR^W1|*$)kPbeKqNSjTa^ zXs)YkY1#b4m*X(tW0UpqA``<(<7E>oDYBWBWI38=L|$ZBiFU}8gOsTGOEXUyiV&J4ndXD2{f#XEcC}O3y4Z5M0tP>&=hepVQ zow6uI#>Gde19j&3AuhHCyD94~&&UP4*WMRpc?9E4N=wnjp+vGdPLHFe!i||5^{$>+ zF|@`=79xOcU>c=Hv55?*Yi*+yg9#l*@Bqa$;3rT_<9!BfEDh^n4UPOcu+iY32OEw5 z1+dW+Km;4j0wl1}L_h~NnhVHaqv?PiYzC|hK87X}Mjso7*-)5|g9fle85cw0h>oj; z^)P|9Wy0--7S;&{{FnyIp%~wlU>o(WLC%vr#hGk%#`V#=0K}NV$qj6w0CpZVR-S+ADzoW;HHOD40PP1X@__ z1wa7y%Mf7$*8y5gZRQ`qtYJelHE<80#nh(c0n9?&C84-io1klvwb^d~c@3t{At4Xv z!dgge#v6eAONfwx{8x*qJ^TWgIborhsW}R@z}h1(0Q^pfz?uV43#>g10>D$0&@2u< W8jA9Hypy3n*Lt{!oArcxLG@n(!+U%H literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/Api_4_Afv_Dacf_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/Api_4_Afv_Dacf_1.java new file mode 100644 index 0000000..b0eb60c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/Api_4_Afv_Dacf_1.java @@ -0,0 +1,155 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Dacf_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_dacf; + +import uicc.test.util.* ; +import javacard.framework.*; +import uicc.access.* ; +import uicc.access.fileadministration.AdminFileView; +import uicc.access.fileadministration.AdminFileViewBuilder; + + +public class Api_4_Afv_Dacf_1 extends TestToolkitApplet +{ + private AdminFileView UiccFileView = null; + + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_4_Afv_Dacf_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_4_Afv_Dacf_1 thisApplet = new Api_4_Afv_Dacf_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes = false; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + + // ----------------------------------------------------------------- + // Test Case 1 : No EF Selected + // ----------------------------------------------------------------- + testCaseNb = 1; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + try + { + UiccFileView.deactivateFile(); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.NO_EF_SELECTED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2 : Deactivate an activated file + // ----------------------------------------------------------------- + testCaseNb = 2; + bRes = false; + UiccFileView.select((short)UICCTestConstants.FID_MF); + UiccFileView.select((short)UICCTestConstants.FID_EF_UICC); + // Points 2, 3 and 4 + try + { + byte rdBuff[] = new byte [1]; + UiccFileView.readBinary((short)0, rdBuff, (short)0, (short)1); + UiccFileView.deactivateFile(); + UiccFileView.readBinary((short)0, rdBuff, (short)0, (short)1); + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.REF_DATA_INVALIDATED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3 : Deactivate a deactivated file + // ----------------------------------------------------------------- + testCaseNb = 3; + bRes = false; + try + { + UiccFileView.deactivateFile(); + bRes = true; + // Restore EFuicc in its initial state + UiccFileView.activateFile(); + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4 : Access condition not fulfilled + // ----------------------------------------------------------------- + testCaseNb = 4; + bRes = false; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + UiccFileView.select((short)UICCTestConstants.FID_EF_LADA); + try + { + UiccFileView.deactivateFile(); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.SECURITY_STATUS_NOT_SATISFIED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/Test_Api_4_Afv_Dacf.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/Test_Api_4_Afv_Dacf.java new file mode 100644 index 0000000..4c8d3f3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/Test_Api_4_Afv_Dacf.java @@ -0,0 +1,92 @@ +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_dacf; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_4_Afv_Dacf extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_Afv_dacf"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Dacf() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "821E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402FFFDFF" + // LV Access Domain for UICC file system = All except ADM2 + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402FFFDFF" + // LV Access Domain for ADF1 file system = All except ADM2 + "00" ); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "04" + "CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/applet.opt new file mode 100644 index 0000000..aa99694 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_dacf.Api_4_Afv_Dacf_1 +uicc.test.access.fileadministration.api_4_afv_dacf +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/javacard/api_4_afv_dacf.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_dacf/javacard/api_4_afv_dacf.cap new file mode 100644 index 0000000000000000000000000000000000000000..0d0a17f24ef25a1d19b85eb330ab876e9471213b GIT binary patch literal 5151 zcmbtX3s6+o8UD__cb_aT1tmdLKn+pYb$!GtCcLQ#D2gI#6_(|$Y*=2q3x89+Yc^Tb1>EE3JI@?!NG))fK zcrBwh@QuqxeVOXjf3-e0!TA0z`)ir+C7REM$ci)Dd?Xemz{xw_dx!G~!__aSY zrA77F)t?;AN*lGH(SKiQS5Is=YnZijOsv>^ta|ji4cFz4(eH1)mOFWSL-)!H?y`4o zbu|5~_r&f4c@u7|dFEHPn3@h%eejlP?XkIMvv+FG{WCxRF?J(mMZHbcY;0#8*V^-U z4qx(aU*Ylqv-@wu^?zCy`FOzo>e(xwa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java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/Api_4_Afv_Incr_1.java new file mode 100644 index 0000000..4229c61 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/Api_4_Afv_Incr_1.java @@ -0,0 +1,579 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Incr_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_incr; + +import uicc.system.HandlerBuilder; +import uicc.test.util.* ; +import uicc.toolkit.ViewHandler; +import javacard.framework.*; +import uicc.access.* ; +import uicc.access.fileadministration.*; + + +public class Api_4_Afv_Incr_1 extends TestToolkitApplet implements UICCConstants +{ + private AdminFileView UiccFileView = null; + private AdminFileView UiccAdminFileView = null; + private ViewHandler createEFCmd = null; + + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private byte [] abCreateEF = { + (byte)0x82,(byte)0x04, // Tag, Length - File descriptor + (byte)0x46,(byte)0x21,(byte)0x00,(byte)0x7F, // Value - File descriptor (Cyclic) and record length (0x7F) + (byte)0x83,(byte)0x02, // Tag, Length - File Id + (byte)0x2C,(byte)0x7F, // Value - File Id + (byte)0x8A,(byte)0x01,(byte)0x05, // Tag, Length, Value - LCSI (Activated) + (byte)0x8B,(byte)0x03, // Tag, Length - Security attribute + (byte)0x2F,(byte)0x06,(byte)0x01, // Value - Security attribute (EF Arr, record nb) + (byte)0x80,(byte)0x02,(byte)0x00,(byte)0x7F, // Tag, Length, value - File size (0 bytes => no record) + (byte)0x88,(byte)0x00}; // Tag, Length - SFI (no SFI) + byte testCaseNb = (byte) 0x00; + byte incr[] = null; + byte resp[] = null; + byte data[] = null; + byte comp[] = null; + short incrOffset = 0; + short respOffset = 0; + short incrLength = 0; + short respLength = 0; + + /** + * Constructor of the applet + */ + public Api_4_Afv_Incr_1() + { + incr = new byte[4]; + resp = new byte[4]; + comp = new byte[4]; + data = new byte[3]; + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_4_Afv_Incr_1 thisApplet = new Api_4_Afv_Incr_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes = false; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + UiccAdminFileView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + + // ----------------------------------------------------------------- + // Test Case 1 : No EF Selected + // ----------------------------------------------------------------- + testCaseNb = 1; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + try + { + incrLength = 2; + UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.NO_EF_SELECTED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2 : increase , verify response + // ----------------------------------------------------------------- + testCaseNb = 2; + UiccFileView.select((short)UICCTestConstants.FID_EF_CARU); + try + { + // Set records to 00 00 00 + Util.arrayFillNonAtomic(data, (short)0, (short)data.length, (byte)0); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incr[2] = (byte)1; + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + + // Verify result + Util.arrayFillNonAtomic(comp, (short)0, (short)comp.length, (byte)0); + comp[2] = (byte)1; + if ((respLength == (short)3) && + (Util.arrayCompare(resp, (short)0, comp, (short)0, (short)4) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3 : increase , verify file + // ----------------------------------------------------------------- + testCaseNb = 3; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incr[3] = (byte)2; + incrOffset = 1; + incrLength = 3; + respOffset = 1; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + + // Verify result + Util.arrayFillNonAtomic(resp, (short)0, (short)resp.length, (byte)0); + Util.arrayFillNonAtomic(comp, (short)0, (short)comp.length, (byte)0); + comp[2] = (byte)3; + UiccFileView.readRecord((short)0, REC_ACC_MODE_CURRENT, (short)0, resp, (short)0, (short)3); + if ((respLength == (short)3) && + (Util.arrayCompare(resp, (short)0, comp, (short)0, (short)4) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4 : incr[] is null + // ----------------------------------------------------------------- + testCaseNb = 4; + try + { + // increase + incrOffset = 0; + incrLength = 1; + respOffset = 0; + respLength = UiccFileView.increase(null, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (NullPointerException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 5 : incrLength < 0 + // ----------------------------------------------------------------- + testCaseNb = 5; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 0; + incrLength = -1; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 6 : incrOffset < 0 + // ----------------------------------------------------------------- + testCaseNb = 6; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = -1; + incrLength = 1; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 7 : IncrOffset + incrLength > incr.length + // ----------------------------------------------------------------- + testCaseNb = 7; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 1; + incrLength = 4; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 8 : Reach Maximum Value + // ----------------------------------------------------------------- + testCaseNb = 8; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0xFF); + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.MAX_VALUE_REACHED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + + try + { + // Set records to FF FF FF + Util.arrayFillNonAtomic(data, (short)0, (short)data.length, (byte)0xFF); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incr[2] = (byte)1; + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.MAX_VALUE_REACHED) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 9 : resp[] is null + // ----------------------------------------------------------------- + testCaseNb = 9; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0xFF); + incrOffset = 0; + incrLength = 1; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, null, respOffset); + bRes = false; + } + catch (NullPointerException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 10 : incrLength < 0 + // ----------------------------------------------------------------- + testCaseNb = 10; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 0; + incrLength = 1; + respOffset = -1; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 11 : respOffset + recordLength > resp.length + // ----------------------------------------------------------------- + testCaseNb = 11; + try + { + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 0; + incrLength = 3; + respOffset = 2; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 12 : Ef is not cyclic + // ----------------------------------------------------------------- + testCaseNb = 12; + try + { + UiccFileView.select((short)UICCTestConstants.FID_EF_TARU); + incr = new byte[3]; + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.COMMAND_INCOMPATIBLE) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + try + { + UiccFileView.select((short)UICCTestConstants.FID_EF_LARU); + // increase + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.COMMAND_INCOMPATIBLE) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 13 : Access condition not fulfilled + // ----------------------------------------------------------------- + testCaseNb = 13; + try + { + UiccFileView.select((short)UICCTestConstants.FID_EF_CNIC); + // increase + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 14 : EF is deactivated + // ----------------------------------------------------------------- + testCaseNb = 14; + try + { + UiccFileView.select((short)UICCTestConstants.FID_EF_CARU); + // deactivated + UiccFileView.deactivateFile(); + // increase + incrOffset = 0; + incrLength = 3; + respOffset = 0; + respLength = UiccFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.REF_DATA_INVALIDATED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + try + { + // activate + UiccFileView.activateFile(); + // Restore Ef content + // Set records to 55 55 55 + Util.arrayFillNonAtomic(data, (short)0, (short)data.length, (byte)0x55); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + // Set records to AA AA AA + Util.arrayFillNonAtomic(data, (short)0, (short)data.length, (byte)0xAA); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, data, (short)0, (short)data.length); + bRes &= true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 15 : incrLength out of range + // ----------------------------------------------------------------- + testCaseNb = 15; + try + { + // Create EF 0x2CFD + incr = new byte[128]; + resp = new byte[0xFF]; + comp = new byte[0xFF]; + createEFCmd = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, (short)abCreateEF.length, abCreateEF, (short)0x00, (short)abCreateEF.length); + UiccAdminFileView.createFile(createEFCmd); + UiccAdminFileView.select((short)0x2C7F); + + Util.arrayFillNonAtomic(comp, (short)0, (short)127, (byte)0xFF); + comp[0] = (byte)0x00; + UiccAdminFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, comp, (short)0, (short)127); + // increase + Util.arrayFillNonAtomic(incr, (short)0, (short)incr.length, (byte)0); + Util.arrayFillNonAtomic(resp, (short)0, (short)resp.length, (byte)0); + Util.arrayFillNonAtomic(comp, (short)0, (short)resp.length, (byte)0); + incr[127] = (byte)0x01; + comp[0] = (byte)0x01; + incrOffset = 1; + incrLength = 127; + respOffset = 0; + respLength = UiccAdminFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + // Check result + if ((respLength == (short)0x7F) && + (Util.arrayCompare(resp, (short)0, comp, (short)0, respLength) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + try + { + // increase + incrOffset = 0; + incrLength = 128; + respOffset = 0; + respLength = UiccAdminFileView.increase(incr, incrOffset, incrLength, resp, respOffset); + bRes = false; + } + catch (Exception e) + { + bRes &= true; + } + reportTestOutcome(testCaseNb, bRes); + UiccAdminFileView.deleteFile((short)0x2C7F); + + incr = null; + resp = null; + comp = null; + data = null; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/Test_Api_4_Afv_Incr.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/Test_Api_4_Afv_Incr.java new file mode 100644 index 0000000..08bfeef --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/Test_Api_4_Afv_Incr.java @@ -0,0 +1,93 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_incr; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_4_Afv_Incr extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_afv_incr"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Incr() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" ); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "0F" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/applet.opt new file mode 100644 index 0000000..448a201 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_incr.Api_4_Afv_Incr_1 +uicc.test.access.fileadministration.api_4_afv_incr +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/javacard/api_4_afv_incr.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_incr/javacard/api_4_afv_incr.cap new file mode 100644 index 0000000000000000000000000000000000000000..4aee2f6ebcabe8c992dbf712080daf14aaea16e3 GIT binary patch literal 9653 zcmbt431C!3vQ>S}nPf!OGP!ttK)b&^pJkdqaui~zp9;@yu@axS%k^$Ev?@hheRj<3My1HJy?&>KT z!bJ>dbncxwtv56|Vn9G)&Zx}pc|&vUg_%S1a&tzGN-fMi_ZEP6WMR$R9=6?go@rZu zI9!g4+-BzRW5Wlm zd1FRYw5M10=!88L``ORix(-+!&mtBVS{^yvD({)MU2)Erm(D&peDo-1Zu{Jq7yPn& z{oBL){CoB)XZ;%=Em4to%v@z&`}XI33ZI);->X}{q+hZ|AF0UPn4JTkb}Ah7X8NP& zuDT&@;f9mDqb5{s&RpU>*k}D6!?N3bB>&OlF1z=O&4X?|dAxAU<%`T6E9JVy4}FHw zV%-NbU2m@6yXgHf;}`TkED}2W5O?6v*h!Vf9?y$sr|ci&I{RA3?q}zA3D|@j>Qf=Ydc9SDdUlFfMUN z%=`OyO?z?pu03~Ox$ej9yw9^Er&v#Y_u{_WpTEvKDdw?d`#XP_vu4`bEn`z>ADTGf z+H;@0Tm13R&o^#A(D1|Q_gCbeKM;A;3s=Q{HuRsH8Xh_JV$Yl}U5^;H9T~rL%fusl z(~jTxiQ4(Y)EU=aGkn;X?JqsIcl^1ZM{auTS5`E{pxybw=~WLSz=sN;h=$ta8(@8? zOVf6S7ZIjIF2U5w(o(zIS?9JpN=uz}b@uYgDyO6DrpoHdI=9Q=uB@rHJ8CP7dlfs% zrxjOLm%8ke9Mc@74p*6dFjaKAQcE4R2!%)9I)9Qe0chPoY>gn#)3InEm3#hq8O?Q8 z4ZFv8AVxam5&U_6jXDpib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{rKhla_rAL@yLA4 zcn!aj55yrnlMliIp2G)YAoVgj4qSZqZsK;3|45Y}_j5h&lL_Xb`vJcCkP##vNjbxC5UN%f)hh zR;&;!ahJGLticz=TCpDYi2KDRd{t}~PvGmqE1tx^iKoO4d_z1f-oQ7-o8s^Ime?ou z;orr6@jmVsABaQvj`&y{#)INh@hQG1j)9kiGCb z*<1F-pJYFI4gOaSme=Ah@;X_HXJwhJ!*kLtXX1HTFY77n%#t@VE@#VmOv?FkAv4KE zaybi^E97bxA=k(a%qlm^Ct0L?NTh&U%vt-pqrLq)dSG`z!)mvq<4k}CK zu*+1g%43(Se3j2St0Ag@bybC`i1kpz)fkqhu2th$Pc>duvny1Ma1u|W!}_QOwUG5yi_{X9p_Z!UtiM{J?qUPf-D))(sMe@8EURb;vKZeq#s5!&rW?=t zKM9&2zxBTYor@_jDZ11qbt9MK*s|@i#x3hmnW3A^jWX}2`J!*J@fWwrn{7FViVfXR zZWP;vw@hr~_HwAq(4FK)nGd&6X5+qcsLaqU-bR@o@{*RAH@HF!Zuo{u4&7~Slw3mz zixx=^?!AVJ4BcOC6nUnFA{%#GLuH00G#h1pPqXKibTcHq87eq5m)R(IN<_;9hh#QG z1&8Lr8U=5mza+Gz$IY{1p>ji$L5*@#=uZwUlN(446%CP;MFU#*S>Rf7nZe0A_WvXS BGI0O^ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/Api_4_Afv_Redb_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/Api_4_Afv_Redb_1.java new file mode 100644 index 0000000..6d93b75 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/Api_4_Afv_Redb_1.java @@ -0,0 +1,363 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Redb_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_redb; + +import javacard.framework.*; +import uicc.access.*; +import uicc.access.fileadministration.AdminFileView; +import uicc.access.fileadministration.AdminFileViewBuilder; +import uicc.test.util.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.fileadministration.api_4_afv_redb + * + * @version 0.0.1 - 6 déc. 2005 + * @author 3GPP T3 SWG API + */ + +public class Api_4_Afv_Redb_1 extends TestToolkitApplet implements UICCConstants +{ + private AdminFileView UiccFileView = null; + + final short RESP_BUFFER_LENGTH = (short)0x0104; + + byte[] resp = new byte[RESP_BUFFER_LENGTH]; + byte[] compareBuffer = new byte[RESP_BUFFER_LENGTH]; + byte[] nullBuffer = null; + + /** + * Constructor of the applet + */ + public Api_4_Afv_Redb_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_4_Afv_Redb_1 thisApplet = new Api_4_Afv_Redb_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + short result = 0; + short respOffset = 0; + short respLength = 0; + short fileOffset = 0; + + // Result of tests + boolean bRes = false; + byte testCaseNb = 0; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + /*------------------------------------------------------------------ + * TEST CASE 01: Read from a transparent file at offset 0 + *----------------------------------------------------------------*/ + testCaseNb = (byte)0x01; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + + fileOffset = 0; + respOffset = 10; + respLength = 250; + + // Initialise compareBuffer + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)compareBuffer.length,(byte)0xFF); + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)10,(byte)0x55); + // Initialise resp buffer + Util.arrayFillNonAtomic(resp,(short)0,(short)resp.length,(byte)0x55); + + // Call the readBinary() method + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + if (result == (short)(respOffset + respLength)) + bRes = true; + + if (Util.arrayCompare(resp, (short)0, compareBuffer, (short)0, RESP_BUFFER_LENGTH) == 0) + bRes &= true; + + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 02: Read from a transparent file at a given offset + *----------------------------------------------------------------*/ + testCaseNb = (byte)0x02; + bRes = false; + try { + + fileOffset = (short)0x80; + respOffset = (short)0x80; + respLength = 5; + + // Initialise compareBuffer + Util.arrayFillNonAtomic(compareBuffer,(short)respOffset,(short)respLength,(byte)0xFF); + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + if (result == (short)(respOffset + respLength)) + bRes = true; + + if (Util.arrayCompare(resp, (short)0, compareBuffer, (short)0, RESP_BUFFER_LENGTH) == 0) + bRes &= true; + + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 03: Errorcase, fileOffset is negative + *----------------------------------------------------------------*/ + testCaseNb = (byte)0x03; + bRes = false; + try { + fileOffset = (short)-1; + respOffset = 0; + respLength = 10; + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_FILE_BOUNDARIES); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 04: Errorcase, fileOffset + respLength > EF length + *------------------------------------------------------------------*/ + testCaseNb = (byte)0x04; + bRes = false; + try { + fileOffset = (short)259; + respOffset = 0; + respLength = 2; + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_FILE_BOUNDARIES); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 05: Errorcase, resp is null + *------------------------------------------------------------------*/ + testCaseNb = (byte)0x05; + bRes = false; + try { + fileOffset = 0; + respOffset = 0; + respLength = 10; + result = UiccFileView.readBinary(fileOffset, nullBuffer, respOffset, respLength); + bRes = false; + } + catch (NullPointerException npe) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 06: Errorcase, respOffset < 0 + *-------------------------------------------------------------------*/ + testCaseNb = (byte)0x06; + bRes = false; + try { + fileOffset = 0; + respOffset = (short)-1; + respLength = 10; + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 07: Errorcase, respLength < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x07; + bRes = false; + try { + fileOffset = 0; + respOffset = 0; + respLength = (short)-1; + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 08: Errorcase, respOffset + respLength > resp.Length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x08; + bRes = false; + try { + fileOffset = 0; + respOffset = 0xFA; + respLength = 0x0B; + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 09: Errorcase, EF is not transparent + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x09; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + fileOffset = 0; + respOffset = 0; + respLength = 1; + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 10: Errorcase, Access condition not fulfilled + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0A; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TNR); + + fileOffset = 0; + respOffset = 0; + respLength = 1; + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 11: Errorcase, EF is invalidated + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0B; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_TNU); + UiccFileView.deactivateFile(); + + try { + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } + finally { + UiccFileView.activateFile(); + } + + reportTestOutcome(testCaseNb,bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 12: Errorcase, No EF selected + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0C; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + + result = UiccFileView.readBinary(fileOffset, resp, respOffset, respLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.NO_EF_SELECTED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb,bRes); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/Test_Api_4_Afv_Redb.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/Test_Api_4_Afv_Redb.java new file mode 100644 index 0000000..b9ef824 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/Test_Api_4_Afv_Redb.java @@ -0,0 +1,93 @@ +//----------------------------------------------------------------------------- +//Test_Api_1_Tvw_Redb.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_redb; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.fileadministration.api_4_afv_redb + * + * @version 0.0.1 - 6 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_4_Afv_Redb extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_Afv_redb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Redb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 to 12 */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + test.reset(); + test.terminalProfileSession("0101"); + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/applet.opt new file mode 100644 index 0000000..5c59b22 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_redb.Api_4_Afv_Redb_1 +uicc.test.access.fileadministration.api_4_afv_redb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/javacard/api_4_afv_redb.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redb/javacard/api_4_afv_redb.cap new file mode 100644 index 0000000000000000000000000000000000000000..532ede7b1f486d9da33e2121b6f98a14ad18ea34 GIT binary patch literal 7161 zcmbtY3wTu3wf@)MXC9e6W&%k_2uT1@5&{VX2=cOdL&&oUfm=Z0WHKQGA(>1jDEOg6 z!keJHs#JMd4X+Z57DWoRg|96_Zz+fh^dgA8zEG)Fq=I7ZIx`c7OyT>k&Y5qW+0XT_ zz4kt9ueC}Gq!Ix=|Nc0C-bmc`L_k4N?&QoN`NesuMVZCIPvkNZ$wr0?z{ir7cP!o z785%E59=acAHMdB!~w7^-QA`0Y8uj$Gb2wD-}|9~|rNc+jpF*WbK<>HLb5hh}abv+_vW zv6n)4wZdJx;q$I~4*-+ti4*R2KD ze)mz?baCH_|CxP$#=*T6FNT~MxBs)&>kq|SVQ~#^DXa=PTzg1+cIap6+up1lGHTk` zn2ww2(~?&|l~MHTg13{Oi#M_Po;}X7o zb?x}-y;qJe{rkCT5udNN-TYwL?x%MjHq-BvlG(p)pI(qXNx zN}X+I6t4vIW~vY;%sotSH%|Sha#p3m@y5p${rZ7hyix#ukf26E%~W$#mXZidvS+K zfvPXlZm+XCRXHRg{M1GuT*kv-m3IG6l4ZI&)K#D!&%7K#mIsADy^=e zatGHBa{W`TALRN?ged(Hp`;^J>F*k-umMnJxTO2P9`Q;Wx7WMkl`V{8if)4;nwB9t zoRk%$zSjgV6W)KxJ<0;juqUA%-v(VuY;>HG869`;D(GWZAt<(0Bc2cl#sW=}946Cb zk|L8dGD$0wbkWLcn3nOXo|jK5NxBY%KR$`ah7*?>q`SmpO@_2^+(=S7r0kIE#A@^y z%SDsHRN*cP*&)_>%ZSo+h=eHR2@S%PVewqboTE{av>iN1N|t*ydYX+} zS&Zl?U6gheA~Z=lu7$&uq~TYZUd7}29=HJbYTbMVFFDO*V5Z$!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ehEmcoW*cmlKW zB-WsgrCE=;*nnqY$0lsyv0L#RkNzdL^XMJejRp7>I`Al7#C|-6*YIb!a1?(<3r^r9 zT5*c+t0lOI51IEz_!!H1sh?s6KEqdN!&O{kjDO=g*5L-eW2Bq-9zRDX2|PuT!tpfq zpeSslUKEXID29^oEDfS$Y@)%Gg3Xjl>DWf2Xf)bs42{Ef8c&(nNm-Q5*KH2vVK+^n z3hbdN{Efdz(`g3w(t|V?FHt=;;AOIt1HYjrT7XySQCf(D^ccBth!#;RUZ=&h1iz=H zv;u#im9!Cu=@+yaM`#Oe#UE)Ky?{SaJ8j2N+CjVU2JNPo@E3ZSUcpIvm0rUsIzR_; znhw$L@D{yJhw(NYp_6!rPSM*qL+{WToTIaJ9)G8I=>pEvMY@D{>3#YH@6l!Y93RjX z`T`%)m-H1rrmOTdKA~&$4KCAlp~I&_FGBE{2o+(tB8;LZ{wX3vB)$|;A{ze^F`_TN z7X8Ek+z|JQf%sM=ib1$3l0^!>7pWo*onpAiWCN2W^7uQPASRL&`J#vvQ7lSGD@sKf z=|s7hMg}om%p{|z6lOAsDlvz8h&s_sJ;gln2t|tdVgW^oN5w+wB_0!P6eCuPwG=DX ziS-mGHi+jbUc4aMDM4%(JE^bOCHB%i;w7<<62&WGKP8FR#9>MnN5o%fu=sCrf>Ola z#7RmOr^IO*D&7+BQ=0gP_=rY`kHsgHE-s7fG)mkM-_rf!JMle@7M)T{ZZi84i|QNA25M^J$rDRZe%=E+G^EDK~2mC9mS!sSvqg-Ya9 zIh|W(NDGz8YB`Ih%33*_{!7l0PMRj0Wh>2)i{)~fDObpq^pIR7pCPk+R&FAT+$^_J zwcI9m&@8!A?xfkJ1tcQaf_7!2Z_i<>+34=i-Ez|^7lYSVzf-=`$K`)1Fz?lu{q)E5 z&sX{|H}Zw#@qm6@# record length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x11; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = (short)0x01; + recOffset = (short)0x02; + respLength = (short)0x04; + + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_RECORD_BOUNDARIES); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 18: Read with invalid mode + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x12; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + recNumber = (short)0x00; + recOffset = (short)0x00; + respLength = (short)0x04; + + try { + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,(byte)1,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.INVALID_MODE); + } + catch (Exception e) { + bRes = false; + } + + try { + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,(byte)5,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.INVALID_MODE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 19: resp buffer is null + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x13; + bRes = false; + + try { + recNumber = 1; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,null,respOffset,respLength); + bRes = false; + } + catch(NullPointerException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 20: respOffset < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x14; + bRes = false; + + try { + recNumber = 1; + respOffset = (short)-1; + respLength = 4; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 21: respLength < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x15; + bRes = false; + + try { + recNumber = 1; + respOffset = (short)0; + respLength = (short)-1; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 22: respLength + respOffset > resp.length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x16; + bRes = false; + + try { + recNumber = 1; + respOffset = (short)0x11; + respLength = (short)4; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 23: EF is not a record file + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x17; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + + try { + recNumber = 1; + respOffset = (short)0; + respLength = (short)4; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(UICCException e){ + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 24: Access not fulfilled + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x18; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_CNR); + + try { + recNumber = 1; + respOffset = (short)0; + respLength = (short)3; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch(UICCException e){ + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 25: EF is deactivated + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x19; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_CNU); + UiccFileView.deactivateFile(); + + try { + recNumber = 1; + respOffset = (short)0; + respLength = (short)3; + // Call the readRecord() method + result = UiccFileView.readRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,resp,respOffset,respLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } + finally { + UiccFileView.activateFile(); + } + reportTestOutcome(testCaseNb,bRes); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/Test_Api_4_Afv_Redr.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/Test_Api_4_Afv_Redr.java new file mode 100644 index 0000000..fe74160 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/Test_Api_4_Afv_Redr.java @@ -0,0 +1,94 @@ +//----------------------------------------------------------------------------- +//Test_Api_1_Fvw_Redr.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_redr; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.fileadministration.api_4_afv_redr + * + * @version 0.0.1 - 6 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_4_Afv_Redr extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_Afv_redr"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Redr() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 to 12 */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "19CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCC"); + + test.reset(); + test.terminalProfileSession("0101"); + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/applet.opt new file mode 100644 index 0000000..c50617f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_redr.Api_4_Afv_Redr_1 +uicc.test.access.fileadministration.api_4_afv_redr +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/javacard/api_4_afv_redr.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_redr/javacard/api_4_afv_redr.cap new file mode 100644 index 0000000000000000000000000000000000000000..d939e3640500759cd3bc94ee6b5b2cec5247a821 GIT binary patch literal 10896 zcmb_C31Ae(vQ^zP)7`TsW6BqSjhhXTv3MilVC zi>H7nC_x0ogQs5<4-iH00u@A59ta+&;0e5%&F)LGBpxq+W^1Rarn{=Tx~6-&rn84} zEeIr?ug$mqR8rR=nQ3tuNtr{^Qb&%8%}Ber7og_O;Ux>Y1ugz`$j|KFnAC13Z$Dnr;&4;Glgb{QrA^xLrP#mgSk65iuWz4x-{Un0Z>mXLzUb|B(++=dZ%tqQ zIhiu%fzh$Hl+AZVR0mHvFs^-a;hyb<-)v3q@-Mx*dhr)4w%7C?-R;nngay0$4RiFJ z{_@LlJHD`|44AndriHC7Sa`$hKb+k-?5*do4}AT^`l_q$zGnJ`*_Ag8$S{jv8`@_@ zVcT}GF$G^-weyRtWAAK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VC&QR*~zp=D&VG<$ZYc&qf@eNv~grkN`1_M&*}^iDw6>1;#W zlA6;@uXMDxV(%Puo#MNisn{zc?XB25fm)|HJE(arZkSH>*6W?5tkatp++4lxlx6lX R-LS;^&^d-e=86s$^&gJLx%mJ9 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/Api_4_Afv_Rszf_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/Api_4_Afv_Rszf_1.java new file mode 100644 index 0000000..eb51d82 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/Api_4_Afv_Rszf_1.java @@ -0,0 +1,316 @@ +/** + * uicc.access.fileadministration package, resizeFile tests + * applet 1 + */ + +package uicc.test.access.fileadministration.api_4_afv_rszf; + + +import javacard.framework.*; + +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.system.*; +import uicc.test.util.*; +import uicc.toolkit.*; + + +public class Api_4_Afv_Rszf_1 extends TestToolkitApplet implements UICCConstants { + private boolean bRes; + private byte testCaseNb = 0; + + private AdminFileView uiccAdminFileView = null; + private AdminFileView adf1AdminFileView = null; + + private EditHandler editHandler; + private final short TLVHANDLER_SIZE = 50; + private byte[] adf1Aid = new byte[16]; + private UICCTestConstants uiccTestConstants; + + + private byte[] resizeFile_EF_TARU = new byte[] { + (byte) 0x83, (byte) 0x02, (byte) 0x6F, (byte) 0x03, + (byte) 0x80, (byte) 0x02, (byte) 0x00, (byte) 0x0A + }; + + private byte[] resizeFile_EF_LARU = new byte[] { + (byte) 0x83, (byte) 0x02, (byte) 0x6F, (byte) 0x0C, + (byte) 0x80, (byte) 0x02, (byte) 0x00, (byte) 0x10 + }; + + private byte[] incorrectParameters = new byte[] { + (byte) 0x42, (byte) 0x42, (byte) 0x42, (byte) 0x42 + }; + + private byte[] resizeFile_FileNotFound = new byte[] { + (byte) 0x83, (byte) 0x02, (byte) 0x6F, (byte) 0x2A, + (byte) 0x80, (byte) 0x02, (byte) 0x00, (byte) 0x0A + }; + + private byte[] resizeFile_SecurityStatusNotSatisfied = new byte[] { + (byte) 0x83, (byte) 0x02, (byte) 0x4F, (byte) 0x12, + (byte) 0x80, (byte) 0x02, (byte) 0x00, (byte) 0x0A + }; + + private byte[] resizeFile_CommandIncompatible = new byte[] { + (byte) 0x83, (byte) 0x02, (byte) 0x6F, (byte) 0x09, + (byte) 0x80, (byte) 0x02, (byte) 0x00, (byte) 0x10 + }; + + + + /** + * Constructor of the applet + */ + public Api_4_Afv_Rszf_1() { + editHandler = (EditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, + (short) TLVHANDLER_SIZE); + uiccTestConstants = new UICCTestConstants(); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1, (short) 0, adf1Aid, (short) 0, + (short) adf1Aid.length); + } + + + /** + * Method called by the JCRE at the installation of the applet + * + * @param bArray + * @param bOffset + * @param bLength + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance + Api_4_Afv_Rszf_1 thisApplet = new Api_4_Afv_Rszf_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short) (bOffset + 1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + + /** + * Method called by the CAT RE + * + * @param event + */ + public void processToolkit(short event) { + switch (++testCaseNb) { + + /** Testcase 1 + * Resize a transparent EF + */ + case 1: + bRes = true; + + try { + uiccAdminFileView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + uiccAdminFileView.select(UICCTestConstants.FID_MF); + uiccAdminFileView.select(UICCTestConstants.FID_DF_TEST); + + editHandler.clear(); + editHandler.appendArray(resizeFile_EF_TARU, (short) 0,(short) resizeFile_EF_TARU.length); + uiccAdminFileView.resizeFile(editHandler); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 2 + * Resize a linear fixed EF + */ + case 2: + bRes = true; + + try { + uiccAdminFileView.select(UICCTestConstants.FID_MF); + uiccAdminFileView.select(UICCTestConstants.FID_DF_TEST); + + editHandler.clear(); + editHandler.appendArray(resizeFile_EF_LARU, (short) 0,(short) resizeFile_EF_LARU.length); + uiccAdminFileView.resizeFile(editHandler); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 3 + * Call resizeFile with a null viewHandler + */ + case 3: + bRes = false; + + try { + uiccAdminFileView.resizeFile(null); + } + catch (NullPointerException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 4 + * Call resizeFile with incorrect parameters + */ + case 4: + bRes = false; + + try { + editHandler.clear(); + editHandler.appendArray(incorrectParameters, (short) 0,(short) incorrectParameters.length); + uiccAdminFileView.resizeFile(editHandler); + } + catch (AdminException e) { + bRes = (e.getReason() == AdminException.INCORRECT_PARAMETERS); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 5 + * File not found + */ + case 5: + bRes = false; + + try { + uiccAdminFileView.select(UICCTestConstants.FID_MF); + uiccAdminFileView.select(UICCTestConstants.FID_DF_TEST); + + editHandler.clear(); + editHandler.appendArray(resizeFile_FileNotFound, (short) 0,(short) resizeFile_FileNotFound.length); + uiccAdminFileView.resizeFile(editHandler); + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.FILE_NOT_FOUND); + } + catch (Exception e) { + bRes = false; + } + + try { + adf1AdminFileView = AdminFileViewBuilder.getTheAdminFileView(adf1Aid, (short) 0, (byte) adf1Aid.length, JCSystem.CLEAR_ON_RESET); + adf1AdminFileView.select(UICCTestConstants.FID_DF_TEST); + + editHandler.clear(); + editHandler.appendArray(resizeFile_FileNotFound, (short) 0,(short) resizeFile_FileNotFound.length); + adf1AdminFileView.resizeFile(editHandler); + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.FILE_NOT_FOUND); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 6 + * Security Status not satisfied + */ + case 6: + bRes = false; + + try { + uiccAdminFileView.select(UICCTestConstants.FID_MF); + uiccAdminFileView.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView.select(UICCTestConstants.FID_DF_ARR2); + + editHandler.clear(); + editHandler.appendArray(resizeFile_SecurityStatusNotSatisfied, (short) 0,(short) resizeFile_SecurityStatusNotSatisfied.length); + uiccAdminFileView.resizeFile(editHandler); + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + break; + + + + /** Testcase 7 + * Command incompatible + */ + case 7: + bRes = false; + + try { + uiccAdminFileView.select(UICCTestConstants.FID_MF); + uiccAdminFileView.select(UICCTestConstants.FID_DF_TEST); + + editHandler.clear(); + editHandler.appendArray(resizeFile_CommandIncompatible, (short) 0,(short) resizeFile_CommandIncompatible.length); + uiccAdminFileView.resizeFile(editHandler); + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 8 + * Invalidated data + */ + case 8: + bRes = false; + + try { + uiccAdminFileView.select(UICCTestConstants.FID_MF); + uiccAdminFileView.select(UICCTestConstants.FID_DF_TEST); + uiccAdminFileView.select(UICCTestConstants.FID_EF_TARU); + uiccAdminFileView.deactivateFile(); + + editHandler.clear(); + editHandler.appendArray(resizeFile_EF_TARU, (short) 0,(short) resizeFile_EF_TARU.length); + uiccAdminFileView.resizeFile(editHandler); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + uiccAdminFileView.activateFile(); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + break; + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/Test_Api_4_Afv_Rszf.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/Test_Api_4_Afv_Rszf.java new file mode 100644 index 0000000..4dffe70 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/Test_Api_4_Afv_Rszf.java @@ -0,0 +1,154 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.access.fileadministration package part 4 + * Test source for resizeFile tests + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_rszf; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_4_Afv_Rszf extends UiccTestModel { + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_afv_rszf"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + static final String AID_ADF_1 = "A0000000 090005FF FFFFFF89 E0000002"; + static final String DF_TELECOM = "7F10"; + static final String MF = "3F00"; + static final String DF_TEST = "7F4A"; + static final String EF_TNR = "6F01"; + static final String EF_TNU = "6F02"; + static final String EF_TARU = "6F03"; + static final String EF_CNR = "6F04"; + static final String EF_CARU = "6F09"; + static final String EF_LNU = "6F0B"; + static final String EF_LARU = "6F0C"; + static final String EF_TDAC = "6F0F"; + static final String EF_LUPC = "6F18"; + static final String EF_NOSH = "6F1B"; + static final String EF_RFU0 = "6F29"; + static final String EF_RFU1 = "6F2A"; + static final String EF_RFU2 = "6F2B"; + static final String DF_RFU1 = "5F01"; + static final String DF_RFU2 = "5F02"; + static final String DF_RFU3 = "5F03"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_4_Afv_Rszf() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00" + // LV ADF1 access domain DAP + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + + /** test case 1 + * Resize a transparent EF + */ + + test.unrecognizedEnvelope(); + + test.selectFile(MF); + test.selectFile(DF_TEST); + response = test.selectFile(EF_TARU); + + result &= (response.getData().indexOf("8002000A") != -1); + + test.resizeFile(EF_TARU, "0104"); + + + /** test case 2 + * Resize a Linear Fixed EF + */ + + test.unrecognizedEnvelope(); + + test.selectFile(MF); + test.selectFile(DF_TEST); + response = test.selectFile(EF_LARU); + + result &= (response.getData().indexOf("80020010") != -1); + + test.resizeFile(EF_LARU, "08"); + + + /** test cases 3, 4, 5, 6, 7, 8, 9 + * 3. Call resizeFile with a null viewHandler + * 4. Call resizeFile with incorrect parameters + * 5. File not found + * 6. Security status not satisfied + * 7. Command incompatible + * 8. Invalidated data + */ + + test.unrecognizedEnvelope(); + test.unrecognizedEnvelope(); + test.unrecognizedEnvelope(); + test.unrecognizedEnvelope(); + test.unrecognizedEnvelope(); + test.unrecognizedEnvelope(); + + + /** + * Check Results and delete packages + */ + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "08CCCCCC CCCCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/applet.opt new file mode 100644 index 0000000..727aff7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_rszf.Api_4_Afv_Rszf_1 +uicc.test.access.fileadministration.api_4_afv_rszf +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/javacard/api_4_afv_rszf.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_rszf/javacard/api_4_afv_rszf.cap new file mode 100644 index 0000000000000000000000000000000000000000..bede232369711cdd24d23875e8b4d8763bb37f0a GIT binary patch literal 7443 zcmbtZ3t*JhvHs@#|Gx9sgg`bg2`^1R5+Dds3=r}tDM=cV1uazLCfSgMkd3<=lv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H{z}&B6ZxnI)lz literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/Api_4_Afv_Sear_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/Api_4_Afv_Sear_1.java new file mode 100644 index 0000000..d1bb4dc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/Api_4_Afv_Sear_1.java @@ -0,0 +1,1842 @@ +//----------------------------------------------------------------------------- +//Api_1_Fvw_Sear_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_sear; + +import javacard.framework.*; +import uicc.toolkit.*; +import uicc.access.* ; +import uicc.access.fileadministration.AdminFileView; +import uicc.access.fileadministration.AdminFileViewBuilder; +import uicc.test.util.* ; + + +public class Api_4_Afv_Sear_1 extends TestToolkitApplet implements UICCConstants +{ + private AdminFileView UiccFileView = null; + + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private byte[] RecValue1 = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08, + (byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + private byte[] RecValue2 = {(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x01,(byte)0x02, + (byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09}; + private byte[] RecValue3 = {(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B, + (byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x01,(byte)0x02,(byte)0x03}; + private byte[] RecValue4 = {(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x0F,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06}; + private byte[] RecValue5 = {(byte)0x0A,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x0B,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x0C,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x0D,(byte)0x01,(byte)0x02}; + private byte[] RecValue6 = {(byte)0x03,(byte)0x02,(byte)0x01,(byte)0x03,(byte)0x02,(byte)0x01,(byte)0x03,(byte)0x02, + (byte)0x01,(byte)0x03,(byte)0x02,(byte)0x01,(byte)0x03,(byte)0x02,(byte)0x01}; + + byte testCaseNb = (byte) 0x00; + byte patt[] = null; + short resp[] = null; + short comp[] = null; + byte mode = 0; + short recordNumber = 0; + short searchIndication = 0; + short pattOffset = 0; + short respOffset = 0; + short pattLength = 0; + short respLength = 0; + short nbRecFound = 0; + + /** + * Constructor of the applet + */ + public Api_4_Afv_Sear_1() + { + comp = new short[5]; + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_4_Afv_Sear_1 thisApplet = new Api_4_Afv_Sear_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes = false; + + // Get the the Uicc FileView and AdminFileView + UiccFileView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + + // ----------------------------------------------------------------- + // Test Case 1 : No EF Selected + // ----------------------------------------------------------------- + testCaseNb = 1; + UiccFileView.select((short)UICCTestConstants.FID_DF_TEST); + try + { + // searchRecord + patt = new byte[3]; + resp = new short[4]; + Util.arrayFillNonAtomic(patt, (short)0, (short)patt.length, (byte)0xAA); + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == (short)UICCException.NO_EF_SELECTED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + // -- Fixed linear EF + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + + // ----------------------------------------------------------------- + // Test Case 2 : Simple mode search forward + // ----------------------------------------------------------------- + testCaseNb = 2; + UiccFileView.select((short)UICCTestConstants.FID_EF_LSEA); + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + patt[0] = (byte)0x10; + patt[1] = (byte)0x03; + patt[2] = (byte)0x04; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + recordNumber = 1; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 4; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 2; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)2; + comp[2] = (short)4; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)2; + comp[2] = (short)4; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3 : Simple mode search backward + // ----------------------------------------------------------------- + testCaseNb = 3; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_BACKWARD; + searchIndication = 0; + patt[0] = (byte)0x08; + patt[1] = (byte)0x0A; + patt[2] = (byte)0x0B; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 2; + respLength = 2; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_BACKWARD; + searchIndication = 0; + patt = new byte[4]; + patt[0] = (byte)0x08; + patt[1] = (byte)0x09; + patt[2] = (byte)0x0A; + patt[3] = (byte)0x0B; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + recordNumber = 6; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)4; + comp[2] = (short)3; + comp[3] = (short)1; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_BACKWARD; + searchIndication = 0; + patt = new byte[4]; + patt[0] = (byte)0x08; + patt[1] = (byte)0x09; + patt[2] = (byte)0x0A; + patt[3] = (byte)0x0B; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)4; + comp[2] = (short)3; + comp[3] = (short)1; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // --------------------------------------------------------------------------------------------------- + // Test Case 4 : Enhanced Mode, search backward from previous record, start search at offset in record + // --------------------------------------------------------------------------------------------------- + testCaseNb = 4; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0009; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + patt[3] = (byte)0x04; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x03; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0000; + recordNumber = 0; + pattOffset = 0; + pattLength = 5; + respOffset = 2; + respLength = 2; + patt = new byte[6]; + patt[0] = (byte)0x0C; + patt[1] = (byte)0x0D; + patt[2] = (byte)0x0E; + patt[3] = (byte)0x0F; + patt[4] = (byte)0x01; + patt[5] = (byte)0x02; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[2] = (byte)0x02; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // -------------------------------------------------------------------------------------------------- + // Test Case 5 : Enhanced Mode, search backward from previous record, start search at value in record + // -------------------------------------------------------------------------------------------------- + testCaseNb = 5; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0810; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt = new byte[4]; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + patt[3] = (byte)0x04; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // 3 readRecord() to set record pointer to record 5 + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)4); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)4); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)4); + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x080E; + recordNumber = 0; + pattOffset = 3; + pattLength = 1; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + patt[3] = (byte)0x04; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x04; + comp[1] = (byte)0x02; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // -------------------------------------------------------------------------------------------------- + // Test Case 6 : Enhanced Mode, search backward from previous given record, start at offset in record + // -------------------------------------------------------------------------------------------------- + testCaseNb = 6; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0000; + recordNumber = 1; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 4; + patt = new byte[3]; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x01; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0004; + recordNumber = 6; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short)5; + comp[1] = (short)4; + comp[2] = (short)3; + comp[3] = (short)2; + if ((nbRecFound == (short)4) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ------------------------------------------------------------------------------------------------- + // Test Case 7 : Enhanced Mode, search backward from previous given record, start at value in record + // ------------------------------------------------------------------------------------------------- + testCaseNb = 7; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x080D; + recordNumber = 1; + pattOffset = 1; + pattLength = 1; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x0E; + patt[1] = (byte)0x0E; + patt[2] = (byte)0x0E; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x01; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0800; + recordNumber = 6; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // --------------------------------------------------------------------------------------- + // Test Case 8 : Enhanced Mode, search forward from next record, start at offset in record + // --------------------------------------------------------------------------------------- + testCaseNb = 8; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0003; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 2; + patt[0] = (byte)0x00; + patt[1] = (byte)0x0A; + patt[2] = (byte)0x0B; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[2] = (short) 3; + comp[3] = (short) 4; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0003; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 0; + respLength = 4; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short) 4; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // -------------------------------------------------------------------------------------- + // Test Case 9 : Enhanced Mode, search forward from next record, start at value in record + // -------------------------------------------------------------------------------------- + testCaseNb = 9; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0804; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 2; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0801; + recordNumber = 0; + pattOffset = 2; + pattLength = 1; + respOffset = 0; + respLength = 4; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short) 5; + comp[1] = (short) 6; + if ((nbRecFound == (short)2) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ---------------------------------------------------------------------------------------------- + // Test Case 10 : Enhanced Mode, search forward from next given record, start at offset in record + // ---------------------------------------------------------------------------------------------- + testCaseNb = 10; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x0007; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 1; + respLength = 3; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[1] = (short)3; + comp[2] = (short)4; + comp[3] = (short)5; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x000C; + recordNumber = 3; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x03; + patt[1] = (byte)0x02; + patt[2] = (byte)0x01; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x06; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // --------------------------------------------------------------------------------------------- + // Test Case 11 : Enhanced Mode, search forward from next given record, start at value in record + // --------------------------------------------------------------------------------------------- + testCaseNb = 11; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x080D; + recordNumber = 5; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x080C; + recordNumber = 5; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (byte)0x05; + if ((nbRecFound == (short)1) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ---------------------------------------------------------------------------- + // Test Case 12 : Simple mode, total number of found patterns exceed response[] + // ---------------------------------------------------------------------------- + testCaseNb = 12; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short)1; + comp[1] = (short)2; + comp[2] = (short)3; + comp[3] = (short)4; + if ((nbRecFound == (short)4) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 4; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + resp = new short[5]; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short)1; + comp[1] = (short)2; + comp[2] = (short)3; + comp[3] = (short)4; + if ((nbRecFound == (short)4) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 13 : Invalid mode + // ----------------------------------------------------------------- + testCaseNb = 13; + try + { + // searchRecord + mode = (byte)0x14; + searchIndication = 0; + recordNumber = 2; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 2; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.INVALID_MODE) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 14 : Pattern array is null + // ----------------------------------------------------------------- + testCaseNb = 14; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 2; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, null, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (NullPointerException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 15 : Response array is null + // ----------------------------------------------------------------- + testCaseNb = 15; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, null, respOffset, respLength); + bRes = false; + } + catch (NullPointerException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 16 : pattOffset<0 + // ----------------------------------------------------------------- + testCaseNb = 16; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = -1; + pattLength = 1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 17 : pattLength<0 + // ----------------------------------------------------------------- + testCaseNb = 17; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = -1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 18 : respOffset<0 + // ----------------------------------------------------------------- + testCaseNb = 18; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 1; + respOffset = -1; + respLength = 4; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 19 : respLength<0 + // ----------------------------------------------------------------- + testCaseNb = 19; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = -1; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 20 : PattOffset + pattLength > patt[] + // ----------------------------------------------------------------- + testCaseNb = 20; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 2; + respOffset = 1; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 21 : respOffset + respLength > resp[] + // ----------------------------------------------------------------- + testCaseNb = 21; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 0; + pattOffset = 0; + pattLength = 1; + respOffset = 3; + respLength = 3; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) + { + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 22 : recordNum < 0 + // ----------------------------------------------------------------- + testCaseNb = 22; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = -1; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.RECORD_NOT_FOUND) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 23 : RecordNum > total number of file records + // ----------------------------------------------------------------- + testCaseNb = 23; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 7; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.RECORD_NOT_FOUND) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 24 : pattlength > record length + // ----------------------------------------------------------------- + testCaseNb = 24; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + patt = new byte[16]; + Util.arrayFillNonAtomic(patt, (short)0, (short)patt.length, (byte)0x55); + recordNumber = 3; + pattOffset = 0; + pattLength = 16; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.OUT_OF_RECORD_BOUNDARIES) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x000E; + recordNumber = 3; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 5; + patt = new byte[3]; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.OUT_OF_RECORD_BOUNDARIES) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 25 : Wrong file structure + // ----------------------------------------------------------------- + testCaseNb = 25; + try + { + // Select EF TDAC + UiccFileView.select((short)UICCTestConstants.FID_EF_TDAC); + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.COMMAND_INCOMPATIBLE) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 26 : Security status not satisfied + // ----------------------------------------------------------------- + testCaseNb = 26; + try + { + // Select EF LNR + UiccFileView.select((short)UICCTestConstants.FID_EF_LNR); + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 27 : File deactivated + // ----------------------------------------------------------------- + testCaseNb = 27; + try + { + // Select EF LARU and deactivate it + UiccFileView.select((short)UICCTestConstants.FID_EF_LARU); + UiccFileView.deactivateFile(); + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 3; + respOffset = 0; + respLength = 5; + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + bRes = false; + } + catch (UICCException e) + { + if (e.getReason() == UICCException.REF_DATA_INVALIDATED) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + // Re active EF LARU + UiccFileView.activateFile(); + + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + // -- Cyclic EF + // ----------------------------------------------------------------- + // ----------------------------------------------------------------- + + + // ----------------------------------------------------------------- + // Test Case 28 : Simple mode search forward + // ----------------------------------------------------------------- + testCaseNb = 28; + try + { + // Select EF CSEA + UiccFileView.select((short)UICCTestConstants.FID_EF_CSEA); + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 1; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + patt[0] = (byte)0x10; + patt[1] = (byte)0x03; + patt[2] = (byte)0x04; + resp = new short[5]; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 2; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 3; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)3) + { + comp[2] = (short)2; + comp[3] = (short)4; + comp[4] = (short)1; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)2) + { + comp[2] = (short)2; + comp[3] = (short)4; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + + // Update record in previous mode to set pointer 1 to previous record 6 + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue6, (short)0, (short)RecValue6.length); + + // searchRecord + mode = SIMPLE_SEARCH_START_FORWARD; + searchIndication = 0; + recordNumber = 2; + pattOffset = 1; + pattLength = 2; + respOffset = 2; + respLength = 3; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[2] = (short)2; + comp[3] = (short)3; + comp[4] = (short)5; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes &= true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 29 : Simple mode search backward + // ----------------------------------------------------------------- + testCaseNb = 29; + try + { + // searchRecord + mode = SIMPLE_SEARCH_START_BACKWARD; + searchIndication = 0; + recordNumber = 3; + pattOffset = 1; + pattLength = 2; + respOffset = 1; + respLength = 4; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)3) + { + comp[1] = (short)3; + comp[2] = (short)2; + comp[3] = (short)5; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)2) + { + comp[1] = (short)3; + comp[2] = (short)2; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 30 : Enhanced mode, search forward, start at offset in record + // ----------------------------------------------------------------- + testCaseNb = 30; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0009; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 2; + respLength = 3; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[2] = (short)4; + comp[3] = (short)5; + comp[4] = (short)6; + if ((nbRecFound == (short)3) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 31 : Enhanced mode, search forward, start at value in record + // ----------------------------------------------------------------- + testCaseNb = 31; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT + (short)0x0810; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + recordNumber = 0; + pattOffset = 0; + pattLength = 3; + respOffset = 2; + respLength = 3; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0x00); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if ((nbRecFound == (short)0) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 32 : Enhanced mode, search forward given record, start at offset in record + // ----------------------------------------------------------------- + testCaseNb = 32; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x0005; + recordNumber = 3; + pattOffset = 0; + pattLength = 1; + respOffset = 0; + respLength = 5; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)5) + { + comp[0] = (short)3; + comp[1] = (short)4; + comp[2] = (short)5; + comp[3] = (short)6; + comp[4] = (short)1; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)4) + { + comp[0] = (short)3; + comp[1] = (short)4; + comp[2] = (short)5; + comp[3] = (short)6; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 33 : Enhanced mode, search forward given record, start at value in record + // ----------------------------------------------------------------- + testCaseNb = 33; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_FORWARD_FROM_NEXT_GR + (short)0x0805; + recordNumber = 6; + pattOffset = 0; + pattLength = 2; + respOffset = 0; + respLength = 5; + patt[0] = (byte)0x0E; + patt[1] = (byte)0x0F; + patt[2] = (byte)0x00; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)2) + { + comp[0] = (short)2; + comp[1] = (short)4; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)0) + { + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + + // 5 Update record in previous mode to set pointer 1 its initial value + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue5, (short)0, (short)RecValue5.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue4, (short)0, (short)RecValue4.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue3, (short)0, (short)RecValue3.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue2, (short)0, (short)RecValue2.length); + UiccFileView.updateRecord((short)0, REC_ACC_MODE_PREVIOUS, (short)0, RecValue1, (short)0, (short)RecValue1.length); + + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 34 : Enhanced mode, search backward, start at offset in record + // ----------------------------------------------------------------- + testCaseNb = 34; + try + { + patt = new byte[15]; + // 5 readRecord() to set record pointer to record 6 + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + UiccFileView.readRecord((short)0, REC_ACC_MODE_NEXT, (short)0, patt, (short)0, (short)0x0F); + + + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0003; + recordNumber = 0; + pattOffset = 0; + pattLength = 2; + respOffset = 3; + respLength = 2; + patt[0] = (byte)0x02; + patt[1] = (byte)0x01; + patt[2] = (byte)0x00; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)1) + { + comp[3] = (short)6; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)0) + { + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 35 : Enhanced mode, search backward, start at value in record + // ----------------------------------------------------------------- + testCaseNb = 35; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS + (short)0x0801; + recordNumber = 0; + pattOffset = 1; + pattLength = 2; + respOffset = 0; + respLength = 5; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + comp[0] = (short)5; + comp[1] = (short)4; + comp[2] = (short)3; + comp[3] = (short)2; + comp[4] = (short)1; + if ((nbRecFound == (short)5) && + (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0)) + bRes = true; + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 36 : Enhanced mode, search backward given record, start at offset in record + // ----------------------------------------------------------------- + testCaseNb = 36; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0003; + recordNumber = 5; + pattOffset = 0; + pattLength = 2; + respOffset = 3; + respLength = 2; + patt[0] = (byte)0x02; + patt[1] = (byte)0x01; + patt[2] = (byte)0x00; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)1) + { + comp[3] = (short)6; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)0) + { + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 37 : Enhanced mode, search backward given record, start at value in record + // ----------------------------------------------------------------- + testCaseNb = 37; + try + { + // searchRecord + mode = ENHANCED_SEARCH; + searchIndication = SEARCH_INDICATION_START_BACKWARD_FROM_PREVIOUS_GR + (short)0x0801; + recordNumber = 3; + pattOffset = 1; + pattLength = 2; + respOffset = 0; + respLength = 5; + patt[0] = (byte)0x01; + patt[1] = (byte)0x02; + patt[2] = (byte)0x03; + shortArrayFill(resp, (short)0, (short)resp.length, (short)0); + nbRecFound = UiccFileView.searchRecord(mode, recordNumber, searchIndication, patt, pattOffset, pattLength, resp, respOffset, respLength); + + // Verify result + shortArrayFill(comp, (short)0, (short)comp.length, (short)0); + if (nbRecFound == (short)5) + { + comp[0] = (short)3; + comp[1] = (short)2; + comp[2] = (short)1; + comp[3] = (short)5; + comp[4] = (short)4; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else if (nbRecFound == (short)3) + { + comp[0] = (short)3; + comp[1] = (short)2; + comp[2] = (short)1; + if (shortArrayCompare(resp, (short)0, comp, (short)0, (short)resp.length) == 0) + bRes &= true; + else + bRes = false; + } + else + bRes = false; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + + private void shortArrayFill(short buff[], short buffOffset, short fillLength, short value) + { + for (short i = buffOffset; i < (short)(fillLength + buffOffset); i++) + { + buff[i] = value; + } + } + + private byte shortArrayCompare(short buff1[], short buff1Offset, short buff2[], short buff2Offset, short compLength) + { + byte ret = 0; + + for (byte i = 0; ((i < compLength) && (ret == 0)); i++) + { + byte j = (byte)(i+buff1Offset); + byte k = (byte)(i+buff2Offset); + if (buff1[j] != buff2[k]) + ret = 1; + } + return ret; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/Test_Api_4_Afv_Sear.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/Test_Api_4_Afv_Sear.java new file mode 100644 index 0000000..2658011 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/Test_Api_4_Afv_Sear.java @@ -0,0 +1,95 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_sear; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_4_Afv_Sear extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_afv_sear"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Sear() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" ); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "25" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/applet.opt new file mode 100644 index 0000000..180d082 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_sear.Api_4_Afv_Sear_1 +uicc.test.access.fileadministration.api_4_afv_sear +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/javacard/api_4_afv_sear.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_sear/javacard/api_4_afv_sear.cap new file mode 100644 index 0000000000000000000000000000000000000000..f6615667d18e87cd0bfec228e64b0791a8ee6ea2 GIT binary patch literal 23022 zcmd6P2YeL8_xSWJx3}%?_G&_?0s;X9488Z>t3ZGtfj~k?Xex%@iv=kbiXZ|8q=Slr zf?`1hY#@RPC@94O3P}0Q-d#utK@t3Z{{P*Z+c$4!-+S}sO`q8|%`tHUk>Br)8eSRX zx!iz&mJK`9E!(tJqxhC}TQzOeuziPeEgN0?0D$bL+NO>x@1A(H=|%0a!?Dvgjyrhy z-RDY_IWRwYbK?U$c2{cOyR3Qj&->>~6&q}sKZor(apbS(ht2<`OM}G~uc+;&7VAHy z%jRUI_%BMmD;wi`CRlYx{62U_i6V2R9$KwbkuMGH{mrwJl3QG2zC+XEPA0w9akc-eN-w)Q_M(;Ty%N{M+2-r68!Cb4%7NM+_g?);>kY1CbKG5ctv?sNAAUOtt% ze0152tB&M^y$?4|zTRkO;f>Az{Gr34%9(987df%-U{acOp!tEy{klyaFZ5iwcEyF~ z2MwLKY}5Hdm#TMM_Dt>cSI(7KoQV!~{ps)rCExxyc;SK5KV4MH1xHO(&bB<*q{?eR-XS~YKZEZC;GAinXlcjxmEfXWPjHav^vaK_qM{Fft5Yr}oEYs6hfcj!iRs!@ozoypVaK(Sm<7Sy3haKXJaYD9h z%H6-Gmn(CFDU_SNzaH>jz zmy2M#dsScEw6v6@3|kHi-1*c70mNr-)G$+7uRMgb^pdmu^zz?;+YL44hA&+}m0wczeva?dm;%edX2=aF%4tKg)4Qs6I z;<22H?HY1-Pija>95&2OKLbGk8e{<%kY%0)BxWoE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ygjkw1AH-bAtj1o7J4I4oh7!uzI=;P6XM$%v-s4+>6fY#ATiAux09-}v9H9{Nn z#|U&OnZD?td$UO+rZH)ZV4jQ?Gm=6YL5>1T>4xdsGWGq!&hHV@?r4emGiWLxy2Q wHf8`3= 19) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)4)==0) + &&(Util.arrayCompare(FId_EFTaru, (short)0, fcp, FIdOffset, (short)FId_EFTaru.length)==0)) { + + bRes = true; + } + + fcpOffset=findTLV((byte)0x8A, fcp, (short)0);//life cycle + if ((fcpOffset !=0) && (Util.arrayCompare(lifeCycle, (short)0, fcp, fcpOffset, (short)lifeCycle.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + fcpOffset=findTLV((byte)0x80, fcp, (short)0);//file size + if ((fcpOffset !=0) && (Util.arrayCompare(fileSize, (short)0, fcp, fcpOffset, (short)fileSize.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x01; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 2: Select EFTaru in MF (Transparent EF) + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 7; + result = theUiccView.select(UICCTestConstants.FID_EF_TARU, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x41; + if ((result == fcpLength) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)4)==0)) { + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x02; + reportTestOutcome(bTestCaseNb, bRes); + + + + /*------------------------------------------------------------------ + * TEST CASE 3: Select DF Test in MF + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + result = theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x78; + if ((result >= 17) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)4)==0) + &&(Util.arrayCompare(FId_DFTest, (short)0, fcp, FIdOffset, (short)FId_DFTest.length)==0)) { + + bRes = true; + } + fcpOffset=findTLV((byte)0x8A, fcp, (short)0);//life cycle + if ((fcpOffset !=0) && (Util.arrayCompare(lifeCycle, (short)0, fcp, fcpOffset, (short)lifeCycle.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x03; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 4: Select EF CARU in DF Test(Cyclic EF) + *----------------------------------------------------------------*/ + bRes = false; + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 11; + result = theUiccView.select(UICCTestConstants.FID_EF_CARU, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDOffset++; + } + FDescriptor[1] = 0x05; + FDescriptor[2] = 0x46; + FDescriptor[4] = 0x00;// record + FDescriptor[5] = 0x03;// length + FDescriptor[6] = 0x02;// number of records + if ((result == fcpLength) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)7)==0)) { + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x04; + reportTestOutcome(bTestCaseNb, bRes); + + + + + /*------------------------------------------------------------------ + * TEST CASE 5: Select ADF1 + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 5; + fcpLength = 127; + theFileView = AdminFileViewBuilder.getTheAdminFileView(AidADF1, JCSystem.CLEAR_ON_RESET); + result = theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + + fcp[0]=fcp[1]=fcp[2]=fcp[3]=fcp[4]=0x00; + + if (fcp[(byte)(1 + fcpOffset)] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x78; + if ((result >= 27) + &&(fcp[0]==(byte)0x00) && (fcp[1]==(byte)0x00) && (fcp[2]==(byte)0x00) && (fcp[3]==(byte)0x00) && (fcp[4]==(byte)0x00) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, (short)(FDOffset + fcpOffset), (short)4)==0)) { + + bRes = true; + } + fcpOffset=findTLV((byte)0x84, fcp, fcpOffset); //DF Name + if ((fcpOffset !=0) && (Util.arrayCompare(DFName, (short)0, fcp, fcpOffset, (short)DFName.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + fcpOffset = 5; + fcpOffset=findTLV((byte)0x8A, fcp, fcpOffset);//life cycle + if ((fcpOffset !=0) && (Util.arrayCompare(lifeCycle, (short)0, fcp, fcpOffset, (short)lifeCycle.length)==0)) { + + bRes &= true; + } + else { + bRes = false; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x05; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 6: Select MF + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 11; + result = theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[(byte)(FDByteOffset+fcpOffset)]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x78; + if ((result == fcpLength) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, (short) (fcpOffset+FDOffset), (short)4)==0) + &&(Util.arrayCompare(FId_MF, (short)0, fcp, (short) (fcpOffset+FIdOffset), (short)FId_MF.length)==0)) { + + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x06; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 7: Select DF TELECOM in MF + *----------------------------------------------------------------*/ + bRes = false; + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcp[0] = fcp[1] = (byte)0x05; + fcpOffset = 2; + fcpLength = 13; + result = theUiccView.select(UICCConstants.FID_DF_TELECOM, fcp, fcpOffset, fcpLength); + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[(byte)(FDByteOffset+fcpOffset)]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[1] = 0x02; + FDescriptor[2] = 0x78; + if ((result == fcpLength) + &&(fcp[0]==(byte)0x05) && (fcp[1]==(byte)0x05) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, (short) (fcpOffset+FDOffset), (short)4)==0) + &&(Util.arrayCompare(FId_DFTelecom, (short)0, fcp, (short) (fcpOffset+FIdOffset), (short)FId_DFTelecom.length)==0)) { + + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x07; + reportTestOutcome(bTestCaseNb, bRes); + /*------------------------------------------------------------------ + * TEST CASE 8: Select EF LARU in DF TEST (Linear FixedEF) + *----------------------------------------------------------------*/ + bRes = false; + try { + FDOffset = (short)2; + FIdOffset = (short)9; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 14; + theUiccView.select(UICCTestConstants.FID_DF_TEST); + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDOffset++; + FIdOffset++; + } + FDescriptor[1] = 0x05; + FDescriptor[2] = 0x42; + FDescriptor[4] = 0x00;// record + FDescriptor[5] = 0x04;// length + FDescriptor[6] = 0x02;// number of records + if ((result == fcpLength) + &&(Util.arrayCompare(FDescriptor, (short)0, fcp, FDOffset, (short)7)==0) + &&(Util.arrayCompare(FId_EFLaru, (short)0, fcp, (short) FIdOffset, (short)FId_EFLaru.length)==0)) { + bRes = true; + } + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x08; + reportTestOutcome(bTestCaseNb, bRes); + + + + /*------------------------------------------------------------------ + * TEST CASE 9: fcp is null + *----------------------------------------------------------------*/ + try { + fcp = nullBuffer; + fcpOffset = 0; + fcpLength = 15; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (NullPointerException npe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x09; + reportTestOutcome(bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 10: fcpOffset < 0 + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = -1; + fcpLength = 15; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0A; + reportTestOutcome(bTestCaseNb, bRes); + /*------------------------------------------------------------------ + * TEST CASE 11: fcpLength < 0 + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = -1; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0B; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 12: fcpOffset + fcpLength > fcp.length + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = 115; + fcpLength = 18; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0C; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 13: fcpOffset + fcpLength > fcp.length + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = (short) (fcp.length+1); + fcpLength = 0; + result = theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0D; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 14: Selection possiblities + *----------------------------------------------------------------*/ + + + try { + fcpOffset = 0; + + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + + theUiccView.select(UICCTestConstants.FID_EF_UICC, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_CNU, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_SUB_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + bRes = true; + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0E; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 15: EF not selected after MF/DF selection + *----------------------------------------------------------------*/ + + try { + + fileOffset = (short) 0; + respOffset = (short) 0; + respLength = (short) 3; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 20; + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCConstants.FID_EF_ICCID, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + + theUiccView.readBinary((short) fileOffset, (byte[]) resp, (short) respOffset, (short) respLength); + + bRes = false; + + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.NO_EF_SELECTED); + } + bTestCaseNb = 0x0F; + reportTestOutcome(bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 16: No selection of non-reachable file + *----------------------------------------------------------------*/ + + try { + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 20; + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_CARU, fcp, fcpOffset, fcpLength); + bRes = false; + + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.FILE_NOT_FOUND); + } + bTestCaseNb = 0x10; + reportTestOutcome(bTestCaseNb, bRes); + + /*--------------------------------------------------------------------- + * TEST CASE 17: No record is selected afterselecting linear fixed EF + *--------------------------------------------------------------------*/ + + try { + + recNumber = (short) 0; + mode = (byte) UICCConstants.REC_ACC_MODE_CURRENT; + recOffset = (short) 0; + respOffset = (short) 0; + respLength = (short) 4; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 20; + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_LARU, fcp, fcpOffset, fcpLength); + theUiccView.readRecord(recNumber, mode, recOffset, resp, respOffset, respLength); + bRes = false; + + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.RECORD_NOT_FOUND); + } + bTestCaseNb = 0x11; + reportTestOutcome(bTestCaseNb, bRes); + + + /*--------------------------------------------------------------------- + * TEST CASE 18: Record pointer in selected cyclic EF + *--------------------------------------------------------------------*/ + bRes = false; + + recNumber = (short) 0; + recOffset = (short) 0; + dataOffset = (short) 0; + dataLength = (short) 3; + respOffset = (short) 0; + respLength = (short) 3; + + try { + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_CARU, fcp, fcpOffset, fcpLength); + + data[0] = 1; + data[1] = 2; + data[2] = 3; + mode = UICCConstants.REC_ACC_MODE_PREVIOUS; + theUiccView.updateRecord(recNumber, mode, recOffset, data, dataOffset, dataLength); + + theUiccView.select(UICCTestConstants.FID_EF_CARU, fcp, fcpOffset, fcpLength); + + mode = UICCConstants.REC_ACC_MODE_PREVIOUS; + theUiccView.readRecord(recNumber, mode, recOffset, resp, respOffset, respLength); + theUiccView.readRecord(recNumber, mode, recOffset, resp, respOffset, respLength); + + if (Util.arrayCompare(data, (short)0, resp, (short)0, (short)3)==0) { + bRes = true; + } + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x12; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 19: EF not selected after ADF/DF selection + *----------------------------------------------------------------*/ + + try { + + fileOffset = (short) 0; + respOffset = (short) 0; + respLength = (short) 3; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 20; + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_EF_UICC, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + + theFileView.readBinary((short) fileOffset, (byte[]) resp, (short) respOffset, (short) respLength); + + bRes = false; + + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.NO_EF_SELECTED); + } + bTestCaseNb = 0x13; + reportTestOutcome(bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 20: Reselection + *----------------------------------------------------------------*/ + + + try { + + //ADF FileView + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + + //UICC FileView + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TAAA, fcp, fcpOffset, fcpLength); + + bRes = true; + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x14; + reportTestOutcome(bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 21: Security attributes + *----------------------------------------------------------------*/ + + try { + + bRes = false; + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + //ADF FileView + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_EF_LARR1, fcp, fcpOffset, fcpLength); + + fcpOffset=findTLV((byte)0x8B, fcp, fcpOffset); //security attributes + if ( (fcpOffset !=0) + && ((Util.arrayCompare(secAttributesLARR1a, (short)0, fcp, fcpOffset, (short)secAttributesLARR1a.length)==0) + ||(Util.arrayCompare(secAttributesLARR1b, (short)0, fcp, fcpOffset, (short)secAttributesLARR1b.length)==0) + ||(Util.arrayCompare(secAttributesLARR1c, (short)0, fcp, fcpOffset, (short)secAttributesLARR1c.length)==0)) ){ + + bRes = true; + } + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x15; + reportTestOutcome(bTestCaseNb, bRes); + + + try { + + bRes = false; + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + //UICC FileView + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_EF_TARR3, fcp, fcpOffset, fcpLength); + + fcpOffset=findTLV((byte)0x8B, fcp, fcpOffset); //security attributes + if ( (fcpOffset !=0) + && ((Util.arrayCompare(secAttributesTARR3a, (short)0, fcp, fcpOffset, (short)secAttributesTARR3a.length)==0) + ||(Util.arrayCompare(secAttributesTARR3b, (short)0, fcp, fcpOffset, (short)secAttributesTARR3b.length)==0) + ||(Util.arrayCompare(secAttributesTARR3c, (short)0, fcp, fcpOffset, (short)secAttributesTARR3c.length)==0)) ){ + + bRes = true; + } + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x16; + reportTestOutcome(bTestCaseNb, bRes); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/Test_Api_4_Afv_Slctb_Bss.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/Test_Api_4_Afv_Slctb_Bss.java new file mode 100644 index 0000000..0cb0d21 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/Test_Api_4_Afv_Slctb_Bss.java @@ -0,0 +1,112 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_slctb_bss; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_4_Afv_Slctb_Bss extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_afv_slctb_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Slctb_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 Select EFTARU in MF (Transparent EF) */ + /** Testcase 2 Select EFTaru in MF (Transparent EF) */ + /** Testcase 3 Select DF Test in MF */ + /** Testcase 4 Select EF CARU in DF Test(Cyclic EF) */ + /** Testcase 5 Select ADF1 */ + /** Testcase 6 Select MF */ + /** Testcase 7 Select DF TELECOM in MF */ + /** Testcase 8 Select EF LARU in DF TEST (Linear FixedEF) */ + /** Testcase 9 fcp is null */ + /** Testcase 10 fcpOffset < 0 */ + /** Testcase 11 fcpLength < 0 */ + /** Testcase 12 fcpOffset + fcpLength > fcp.length */ + /** Testcase 13 fcpOffset + fcpLength > fcp.length */ + /** Testcase 14 Selection possiblities */ + /** Testcase 15 EF not selected after MF/DF selection */ + /** Testcase 16 No selection of non-reachable file */ + /** Testcase 17 No record is selected afterselecting linear fixed EF */ + /** Testcase 18 Record pointer in selected cyclic EF */ + /** Testcase 19 EF not selected after ADF/DF selection */ + /** Testcase 20 Reselection */ + /** Testcase 21 Security attributes */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "16CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + //Select EF CARU + test.selectFile("3F00"); + test.selectFile("7F4A"); + test.selectFile("6F09"); + test.updateRecord("00", "03", "AAAAAA");//Mode previous + test.updateRecord("00", "03", "555555");//Mode previous + + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/applet.opt new file mode 100644 index 0000000..a2b3357 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_slctb_bss.Api_4_Afv_Slctb_Bss_1 +uicc.test.access.fileadministration.api_4_afv_slctb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/javacard/api_4_afv_slctb_bss.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slctb_bss/javacard/api_4_afv_slctb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..8690bcb81f0d07b567a768092d929caebf72dfbd GIT binary patch literal 13111 zcmd5iXJC}Yw&$Fg`RXRw6hi1VkVpxkD^da>O7AM=3Y)NzKuFePLyN#tlwK52>~IlK zuMza3aJkP0Sh1kk6-5*~)+_Kp;hk>_NtW>LeZr6TC1>Z%nR4oUGvCY%9Ux>982tD0 z%xRsV%98{V2K618)u!LzoQy$PgZt(59Wk=)pqw+W0933QRy@C5(#@atI~h0oz9`C%w0F(XR&sU*G#&=F)!+IF@pB)UZEh&HT3ck`7y5 zw00%*d!bJYW75KkaV6LKwqV9?k9~*zbo>=!?X-7WcY>`k6B@R9@}2L>7j=9u?&jXJ%1w%L+Vqx<*E{_4~;*SHs+t=Rl}#mBwhQOCBp zr@wySr`>lqn3(eM+KMR&_x`Yc!85;)dT02-lXB<)-Ppe5+AfN# z%+U=;G>o!le7-`j-w{SYQj`@D5a(34$AlZdd3Pf7cHolm?>E&~ zToU9j!J|d_@h9d&sBhpT7g?HWPEKHI6e*q~Fq#ys73u=8x-!kCeR%C>T<*XyhKqJ? zpW>oYzo*DQw79s?F{xs&b|DDkYJDuI)lMrGFS{YgNs2iXgJ>lyqOqu z1_ii~KwH4TeJOy342^LCI5=qY+)irn2>gK4SO&KUfXS)GZ4l>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3BJSJZOGF z&znch>+m=qu}G>lOOO+Hbu| z-&(I(Z_xMF0qY$)X1!~@N55I`TZibl^@(+uPFSB=U(iYGsCAr9TPJLTez#4#F8yKG zvs=~+M7j+y~W-s>e##NeWITIy#11>Z@+ARC>q!w z+24zX_A&d6Xk?#tk!a!)E-9M3luHw-F5P8{mM)7|t7$H`%Pm?B9e|X?YwO6R?5ekT zolDu(p9@{lc6zaR+2%Yo-T1BSt4Ah>ul3UGmkzHsAPUu-Alqed^|98fZ_;pj)Gjkms(&= H8z=WaT;i<@ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/Api_4_Afv_Slcts_1.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/Api_4_Afv_Slcts_1.java new file mode 100644 index 0000000..bd0e4cc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/Api_4_Afv_Slcts_1.java @@ -0,0 +1,312 @@ +//----------------------------------------------------------------------------- +// Api_1_Fvw_Slcts_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_slcts; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.access.* ; +import uicc.access.fileadministration.AdminFileView; +import uicc.access.fileadministration.AdminFileViewBuilder; +import uicc.test.util.* ; + +/** + * Test Area : uicc.catre... + * + * Applet is triggered on Install (Install) + * + * + */ + +public class Api_4_Afv_Slcts_1 extends TestToolkitApplet{ + + + byte[] data = new byte[4]; + byte[] resp = new byte[4]; + + short recNumber; + byte mode; + short recOffset; + short dataOffset; + short dataLength; + short respOffset; + short respLength; + + AID AidADF1; + + private AdminFileView theUiccView; + private AdminFileView theFileView; + + /** + * Constructor of the applet + */ + public Api_4_Afv_Slcts_1(){ + + UICCTestConstants objectConstants = new UICCTestConstants(); + AidADF1 = new AID(objectConstants.AID_ADF1, (short) 0, (byte) objectConstants.AID_ADF1.length); + + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + + // Create a new applet instance. + Api_4_Afv_Slcts_1 thisApplet = new Api_4_Afv_Slcts_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + public void processToolkit(short event){ + + + boolean bRes = false; + byte bTestCaseNb = (byte)0; + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + //test case 0: Get a FileView object, UICC file system + theUiccView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + + + //test case 1: Selection possiblities + try { + + theUiccView.select(UICCTestConstants.FID_EF_UICC); + theUiccView.select(UICCTestConstants.FID_DF_TEST); + theUiccView.select(UICCTestConstants.FID_EF_CNU); + theUiccView.select(UICCTestConstants.FID_EF_TAAA); + theUiccView.select(UICCTestConstants.FID_DF_SUB_TEST); + theUiccView.select(UICCTestConstants.FID_DF_TEST); + theUiccView.select(UICCTestConstants.FID_EF_TAAA); + theUiccView.select(UICCTestConstants.FID_DF_TEST); + theUiccView.select(UICCTestConstants.FID_MF); + theUiccView.select(UICCTestConstants.FID_DF_TEST); + theUiccView.select(UICCTestConstants.FID_EF_TAAA); + theUiccView.select(UICCTestConstants.FID_MF); + bRes = true; + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x01; + reportTestOutcome(bTestCaseNb, bRes); + + + //test case 2: Selection possiblities ADF1 + + try { + + theFileView = AdminFileViewBuilder.getTheAdminFileView(AidADF1, JCSystem.CLEAR_ON_RESET); + + theFileView.select(UICCTestConstants.FID_EF_UICC); + theFileView.select(UICCTestConstants.FID_DF_TEST); + theFileView.select(UICCTestConstants.FID_EF_CNU); + theFileView.select(UICCTestConstants.FID_EF_TAAA); + theFileView.select(UICCTestConstants.FID_DF_SUB_TEST); + theFileView.select(UICCTestConstants.FID_DF_TEST); + theFileView.select(UICCTestConstants.FID_EF_TAAA); + theFileView.select(UICCTestConstants.FID_DF_TEST); + + bRes = true; + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x02; + reportTestOutcome(bTestCaseNb, bRes); + + + //test case 3: No selection of unreachable file + + theUiccView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + + try { + theUiccView.select(UICCTestConstants.FID_EF_CNU); + bRes = false; + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.FILE_NOT_FOUND); + } + bTestCaseNb = 0x03; + reportTestOutcome(bTestCaseNb, bRes); + try { + theUiccView.select(UICCTestConstants.FID_DF_TEST); + bRes = true; + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x04; + reportTestOutcome(bTestCaseNb, bRes); + try { + theUiccView.select(UICCTestConstants.FID_EF_TAA); + bRes = false; + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.FILE_NOT_FOUND); + } + bTestCaseNb = 0x05; + reportTestOutcome(bTestCaseNb, bRes); + try { + theUiccView.select(UICCTestConstants.FID_EF_CNU); + bRes = true; + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x06; + reportTestOutcome(bTestCaseNb, bRes); + try { + theUiccView.select(UICCTestConstants.FID_DF_SUB_TEST); + bRes = true; + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x07; + reportTestOutcome(bTestCaseNb, bRes); + try { + theUiccView.select(UICCTestConstants.FID_EF_TAA); + bRes = true; + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x08; + reportTestOutcome(bTestCaseNb, bRes); + try { + theUiccView.select(UICCConstants.FID_DF_TELECOM); + bRes = false; + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.FILE_NOT_FOUND); + } + bTestCaseNb = 0x09; + reportTestOutcome(bTestCaseNb, bRes); + + //test case 4: Self selection + + try { + + theUiccView.select(UICCTestConstants.FID_MF); + theUiccView.select(UICCTestConstants.FID_MF); + theUiccView.select(UICCTestConstants.FID_DF_TEST); + theUiccView.select(UICCTestConstants.FID_DF_TEST); + theUiccView.select(UICCTestConstants.FID_EF_TAAA); + theUiccView.select(UICCTestConstants.FID_EF_TAAA); + + theFileView = AdminFileViewBuilder.getTheAdminFileView(AidADF1, JCSystem.CLEAR_ON_RESET); + + theFileView.select(UICCTestConstants.FID_ADF); + theFileView.select(UICCTestConstants.FID_ADF); + bRes = true; + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0A; + reportTestOutcome(bTestCaseNb, bRes); + + + + //test case 5: EF not selected after MF/DF selection + + recNumber = (short) 1; + mode = (byte) UICCConstants.REC_ACC_MODE_ABSOLUTE; + recOffset = (short) 0; + data[0] = (byte) 0; + data[1] = (byte) 0; + data[2] = (byte) 0; + dataOffset = (short) 0; + dataLength = (short) 3; + + try { + theUiccView.select(UICCTestConstants.FID_MF); + bRes = true; + theUiccView.updateRecord(recNumber, mode, recOffset, data, dataOffset, dataLength); + bRes = false; + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.NO_EF_SELECTED); + } + bTestCaseNb = 0x0B; + reportTestOutcome(bTestCaseNb, bRes); + + try { + theUiccView.select(UICCTestConstants.FID_DF_TEST); + bRes = true; + theUiccView.updateRecord(recNumber, mode, recOffset, data, dataOffset, dataLength); + bRes = false; + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.NO_EF_SELECTED); + } + bTestCaseNb = 0x0C; + reportTestOutcome(bTestCaseNb, bRes); + + + //test case 6: No record is selected after selecting linear fixed EF + + try { + theUiccView.select(UICCTestConstants.FID_MF); + theUiccView.select(UICCTestConstants.FID_DF_TEST); + theUiccView.select(UICCTestConstants.FID_EF_LARU); + bRes = true; + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0D; + reportTestOutcome(bTestCaseNb, bRes); + + recNumber = (short) 0; + mode = (byte) UICCConstants.REC_ACC_MODE_CURRENT; + recOffset = (short) 0; + respOffset = (short) 0; + respLength = (short) 4; + + try { + theUiccView.readRecord(recNumber, mode, recOffset, resp, respOffset, respLength); + bRes = false; + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.RECORD_NOT_FOUND); + } + bTestCaseNb = 0x0E; + reportTestOutcome(bTestCaseNb, bRes); + + + try { + theUiccView.select(UICCTestConstants.FID_EF_CARU); + bRes = true; + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0F; + reportTestOutcome(bTestCaseNb, bRes); + + recNumber = (short) 0; + mode = (byte) UICCConstants.REC_ACC_MODE_CURRENT; + recOffset = (short) 0; + respOffset = (short) 0; + respLength = (short) 3; + + try { + theUiccView.readRecord(recNumber, mode, recOffset, resp, respOffset, respLength); + bRes = false; + } catch (UICCException uicce){ + bRes = (uicce.getReason() == UICCException.RECORD_NOT_FOUND); + } + bTestCaseNb = 0x10; + reportTestOutcome(bTestCaseNb, bRes); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/Test_Api_4_Afv_Slcts.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/Test_Api_4_Afv_Slcts.java new file mode 100644 index 0000000..79a24cb --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/Test_Api_4_Afv_Slcts.java @@ -0,0 +1,98 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_slcts; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_4_Afv_Slcts extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_Afv_slcts"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Slcts() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 Selecction possibilities */ + /** Testcase 2 Selection possiblities ADF1 */ + /** Testcase 3 No selection of unreachable file */ + /** Testcase 4 Self selection */ + /** Testcase 5 EF not selected after MF/DF selection */ + /** Testcase 6 No record is selected after selecting linear fixed EF */ + /** Testcase 7 Record pointer in selected cyclic EF */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "10CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + //Select EF CARU + test.selectFile("3F00"); + test.selectFile("7F4A"); + test.selectFile("6F09"); + test.updateRecord("00", "03", "AAAAAA");//Mode previous + test.updateRecord("00", "03", "555555");//Mode previous + + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/applet.opt new file mode 100644 index 0000000..a3eafd9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_slcts.Api_4_Afv_Slcts_1 +uicc.test.access.fileadministration.api_4_afv_slcts +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/javacard/api_4_afv_slcts.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_slcts/javacard/api_4_afv_slcts.cap new file mode 100644 index 0000000000000000000000000000000000000000..250ef4e5f3b6a38248af4c834ecee726d649d2f7 GIT binary patch literal 7248 zcmbtY3wV^p)qc;+xA$B&Aqfj1+@nDtAqa>CN-hw}C21f5s}#uYWGF;GCc39S-?5Qu&=uoY~PqF}xC#t&-CMIYrq-)1+Ptnxp9-Pz}SGjq;- z=RI@g+nIAFf3j5Kpy%Joh4Y7_Ly3ce-0_8(gD2+Yq~&JjP0SfzP?(yV^X*BX>4`b6 zx*>7LE>64=wd6w2U(Fl8?>~>-oBQ*f=|?LXcGTK_Jz&p)*l(^4{Pl@mNqdhqYJY$E z$n^!Mt;b_y+|P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Mrwcer@6%uLJNk(Jg_CrduHj9(&i}`^1PLQf36qG!X%R1a;%(7O+=)Mm z6p@ZIVyGB}vtqOui+4qa$i$yTmdM6AF;3**yqF-S;4dOqAY7B+k$>|!oH6{VsapNR_L!rw%dScrd$MdBg+ODqsP3#v3a9y;D6SyHxic`2LPK&qkmH30WfUm{-;v&8gm&7Od zR(vY1kRq;%o1_t6Nl99%NFC{Lbf!IrWtlvXc5sm-JAwtdS4WopPaEOeu1S^wI!XD<7u2`pl@*^71l&UlJijH(2P8YoXt^JSjZvyc_?ydRvScK7!f9N=NvZ_I5g)A0-xpU bkg%rQo&n}h)^HRFj#wjL= 19) + &&(Util.arrayCompare (FDescriptor, (short)0, fcp, FDOffset, (short)FDescriptor.length)==0) + &&(Util.arrayCompare (FId_DFTest, (short)0, fcp, FIdOffset, (short)FId_DFTest.length)==0)) { + + bRes = true; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x02; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 03: Status of DF Telecom + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + theUiccView.select (UICCConstants.FID_DF_TELECOM, fcp, fcpOffset, fcpLength); + + result = theUiccView.status (fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FIdOffset++; + FDOffset++; + } + if ((result >= 17) + &&(Util.arrayCompare (FId_DFTelecom, (short)0, fcp, FIdOffset, (short)FId_DFTelecom.length)==0)) { + + bRes = true; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x03; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 04: Status DF Telecom + *----------------------------------------------------------------*/ + bRes = false; + + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 11; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[FDByteOffset]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[2]= 0x78; + if ((result == fcpLength) + &&(Util.arrayCompare (FDescriptor, (short)0, fcp, FDOffset, (short)FDescriptor.length)==0) + &&(Util.arrayCompare (FId_DFTelecom, (short)0, fcp, FIdOffset, (short)FId_DFTelecom.length)==0)) { + + bRes = true; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x04; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 05: Status ADF1 + *----------------------------------------------------------------*/ + bRes = false; + + theFileView = AdminFileViewBuilder.getTheAdminFileView (AidADF1, JCSystem.CLEAR_ON_RESET); + + try { + FDOffset = (short)2; + FDByteOffset = (short)4; + FIdOffset = (short)6; + + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + result = theFileView.status (fcp, fcpOffset, fcpLength); + + if (fcp[1] == (byte)0x81)//if length is coded in 2 bytes, increase the offsets + { + FDByteOffset++; + FIdOffset++; + FDOffset++; + } + fcp[FDByteOffset]|= 0x40; // Set to 1 the bit7 (shareable file) + FDescriptor[2]= 0x78; + //File Descriptor + if ((result >= 27) && (Util.arrayCompare (FDescriptor, (short)0, fcp, FDOffset, (short)FDescriptor.length)==0)) { + + bRes = true; + } + fcpOffset=findTLV ((byte)0x84, fcp, (short)0);//DF Name + if ((fcpOffset !=0) && (Util.arrayCompare (DFName, (short)0, fcp, fcpOffset, (short)DFName.length)==0)) { + + bRes &= true; + } else { + bRes = false; + } + + fcpOffset=findTLV ((byte)0x8A, fcp, (short)0);//life cycle + if ((fcpOffset !=0) && (Util.arrayCompare (lifeCycle, (short)0, fcp, fcpOffset, (short)lifeCycle.length)==0)) { + + bRes &= true; + } else { + bRes = false; + } + + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x05; + reportTestOutcome (bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 06: fcp is null + *----------------------------------------------------------------*/ + try { + fcp = nullBuffer; + fcpOffset = 0; + fcpLength = 34; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (NullPointerException npe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x06; + reportTestOutcome (bTestCaseNb, bRes); + /*------------------------------------------------------------------ + * TEST CASE 07: fcpOffset < 0 + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = -1; + fcpLength = 34; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x07; + reportTestOutcome (bTestCaseNb, bRes); + /*------------------------------------------------------------------ + * TEST CASE 08: fcpLength < 0 + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = -1; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x08; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 09: fcpOffset + fcpLength > fcp.length + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = (short)(fcp.length - 1); + fcpLength = 15; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x09; + reportTestOutcome (bTestCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 10: fcpOffset + fcpLength > fcp.length + *----------------------------------------------------------------*/ + try { + fcp = normalBuffer; + fcpOffset = (short)(fcp.length+1); + fcpLength = 0; + result = theUiccView.status (fcp, fcpOffset, fcpLength); + bRes = false; + } catch (ArrayIndexOutOfBoundsException aioobe) { + bRes = true; + } catch (Exception e) { + bRes = false; + } + bTestCaseNb = 0x0A; + reportTestOutcome (bTestCaseNb, bRes); + + + /*------------------------------------------------------------------ + * TEST CASE 11: Security attributes + *----------------------------------------------------------------*/ + + try { + bRes = false; + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + //ADF FileView + theFileView.select(UICCTestConstants.FID_ADF, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theFileView.select(UICCTestConstants.FID_DF_ARR2, fcp, fcpOffset, fcpLength); + + fcpOffset=findTLV((byte)0x8B, fcp, fcpOffset); //security attributes + + if ( (fcpOffset !=0) + && ((Util.arrayCompare(secAttributesARR2a, (short)0, fcp, fcpOffset, (short)secAttributesARR2a.length)==0) + ||(Util.arrayCompare(secAttributesARR2b, (short)0, fcp, fcpOffset, (short)secAttributesARR2b.length)==0) + ||(Util.arrayCompare(secAttributesARR2c, (short)0, fcp, fcpOffset, (short)secAttributesARR2c.length)==0)) ) { + + bRes = true; + } + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0B; + reportTestOutcome(bTestCaseNb, bRes); + + try { + + bRes = false; + fcp = normalBuffer; + fcpOffset = 0; + fcpLength = 127; + + //UICC FileView + theUiccView.select(UICCTestConstants.FID_MF, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_TEST, fcp, fcpOffset, fcpLength); + theUiccView.select(UICCTestConstants.FID_DF_ARR4, fcp, fcpOffset, fcpLength); + + fcpOffset=findTLV((byte)0x8B, fcp, fcpOffset); //security attributes + + if ( (fcpOffset !=0) + && ((Util.arrayCompare(secAttributesARR4a, (short)0, fcp, fcpOffset, (short)secAttributesARR4a.length)==0) + ||(Util.arrayCompare(secAttributesARR4b, (short)0, fcp, fcpOffset, (short)secAttributesARR4b.length)==0) + ||(Util.arrayCompare(secAttributesARR4c, (short)0, fcp, fcpOffset, (short)secAttributesARR4c.length)==0)) ) { + + bRes = true; + } + + } catch (Exception e){ + bRes = false; + } + bTestCaseNb = 0x0C; + reportTestOutcome(bTestCaseNb, bRes); + + + + } // end if + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/Test_Api_4_Afv_Stat.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/Test_Api_4_Afv_Stat.java new file mode 100644 index 0000000..9d3e05d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/Test_Api_4_Afv_Stat.java @@ -0,0 +1,95 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_stat; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_4_Afv_Stat extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_afv_stat"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Stat() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 Status of MF */ + /** Testcase 2 Status after select EF TARU in MF */ + /** Testcase 3 Status of DF Telecom */ + /** Testcase 4 Status DF Telecom */ + /** Testcase 5 Status ADF1 */ + /** Testcase 6 fcp is null */ + /** Testcase 7 fcpOffset < 0 */ + /** Testcase 8 fcpLength < 0 */ + /** Testcase 9 fcpOffset + fcpLength > fcp.length */ + /** Testcase 10 fcpOffset + fcpLength > fcp.length */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/applet.opt new file mode 100644 index 0000000..fb35599 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_stat.Api_4_Afv_Stat_1 +uicc.test.access.fileadministration.api_4_afv_stat +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/javacard/api_4_afv_stat.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_stat/javacard/api_4_afv_stat.cap new file mode 100644 index 0000000000000000000000000000000000000000..080600ff245061defdff0449c7af8cc3f23df26f GIT binary patch literal 9124 zcmc&Zc|era_UGK?n}ux{aU8(~Obpxz!t_ZlgNUMlIHxgk z+n;9H&n&kVZMUpmrdd7hy|P8iwwJrTer4u6-zzql(jTe7x?z8!x#T6rpGS}RB>b9@9$9EjPY31qp z)vuln=Oq(&e|77q?#qszd+FDsX6+H_P)xm#?fP3-P9gr%JMCm`-iLR0-)LUbdr9u& z+3UJ5*<>i)^URvpllQG%dH=|MN4m?f2Ud0;pVWQT?thNz$p-DQfAiSz1LbeDU;NTr z3p2&dmn1JA(c5+6iBHdXcIR!I+~NDxS#!@Xe>3*3^A9~c>BSp2Z(4u6YVWxvd)L^n z+qC1{TQ|SD>;1zMOXFt7o$htC7`Hrd*WC}o^xVdWa(0jXhsH7Xg66YtXZ>ZsvedQD zyI+0c<$oqjcsgzBj)B|9#Ljozf*&hoOIFQ4wD-O(O%;=(hRwV8;bjBMzA*1R)4yzk zZnEyX>7P9JY0po-%#GW9u~Soi<+x5ID}MTP`qOVt>>9b@;L)-%w>B4#-e{baet6K@ zuX=vKj!zsAesRR(yVIs@%)Iu-f!92F{G~zq+REdDzw28T@xz&8`MK{tR?`%5px=U< z&OaS?=;^Knqcz%!3B59xBfuI7P(VJ_dp)W8bn)~bFBDKsg=~Uar`?|7anyKHY<9b& zrY5D->2lagDx8(h8c(&&<8)W1*s7dG=|#5EnME}onb%vu4?F5Vyi-1S?5$#xvRab1?0;RpPeQK3^fl^QH&%=D~B418b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ff!7V@l0%cAk>a8kZC84e>F1HvvtT~CbQ~;z@nD06WbYEV z0~|1&HZ)~01C|huyGhCq z;2!uZ9D;S^qL1NTI0B!*L+~klPASx*v=QC_U&7b$2z&!4;88dUr{OU;1Lt8A{D2B< zMh%+b3G9eT@FXTKV+&TzD4q&X>z=Uxe-|v zt3l2@tQHkElg&a6o6YJ_$L6pG)U!s`gi&lBTY}N7nJvQ@$^@>&_G}efgC=$tyBE#u zKK1~1WDl}GV=P2lA0T z2Q&C6J{kw{Ts{^Db1T0Ihx3ViGG_BB{1zO+i+ClDIazLYP=348@#jW_W-`FfnlH}FSs5`T~;;-+@JZC*OtB_-_6(I`}Jm50>)R_+FgO-{6O^j34HIM<@S?e~dHu z5&jvL^UwKFbn#>S3#{N@@~_a%zvka#6+gkx;!J*y|BSQv1^z3}=9fey)`=)#q~vfr z5rg%jy)ff#qN9k#xgt((G?p-yhy|*(L?mYMWVO39`6w8;s#tS`ipE_B1VW& z*ephiTwE&hL;)@nV}%u$i$XCDSBUZACR`;Zikoq@xJ4A|P1!7$;@fhWT#ozX3b_jR%hmE8JRsM~ zwfI57Xk;<8P6aNGFTZ|NFOFM3SGz`5N72)?sXkY_stk_uS8UtaHF$9u$}{w;G05`{ znk0fpn5&-vu69}4>f$k!ZRoXPkZn8OHnzb_#!#N2_lZHC%iG8^c)J+NGxRzz$a5G) zNn6Yt*!l-92SYiB-n<1lTWK5ACeDF-xKNg%*KI+T2iwRpc=;B}Gc-3Dh??ttZaqzURrcXlohURF3eCsHk)D}y(WNZpX SOGO EF length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x05; + bRes = false; + try { + fileOffset = (short)259; + dataOffset = 0; + dataLength = 2; + + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_FILE_BOUNDARIES); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 06: Errorcase, data is null + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x06; + bRes = false; + try { + fileOffset = 0; + dataOffset = 0; + dataLength = 10; + UiccFileView.updateBinary(fileOffset, null, dataOffset, dataLength); + bRes = false; + } + catch (NullPointerException npe) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 07: Errorcase, dataOffset < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x07; + bRes = false; + try { + fileOffset = 0; + dataOffset = (short)-1; + dataLength = 10; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 08: Errorcase, dataLength < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x08; + bRes = false; + try { + fileOffset = 0; + dataOffset = 0; + dataLength = (short)-1; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*------------------------------------------------------------------ + * TEST CASE 09: Errorcase, dataOffset + dataLength > data.Length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x09; + bRes = false; + try { + fileOffset = 0; + dataOffset = 0x0A; + dataLength = 0x0B; + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 10: Errorcase, EF is not transparent + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0A; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + fileOffset = 0; + dataOffset = 0; + dataLength = 1; + + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 11: Errorcase, Access condition not fulfilled + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0B; + bRes = false; + try { + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TNU); + + fileOffset = 0; + dataOffset = 0; + dataLength = 1; + + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 12: Errorcase, EF is invalidated + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0C; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_TNR); + UiccFileView.deactivateFile(); + + try { + UiccFileView.updateBinary(fileOffset, data, dataOffset, dataLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } + finally { + UiccFileView.activateFile(); + } + + reportTestOutcome(testCaseNb,bRes); + + /*---------------------------------------------------------------------------------- + * Reset the file content + *---------------------------------------------------------------------------------*/ + fileOffset = (short)0x00; + dataOffset = (short)0; + + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + // Initialise data buffer + byte[] toto = new byte[0x0104]; + Util.arrayFillNonAtomic(toto,(short)0,(short)toto.length,(byte)0xFF); + // Reset the file content + UiccFileView.updateBinary(fileOffset, toto, dataOffset, (short)toto.length); + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/Test_Api_4_Afv_Updb.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/Test_Api_4_Afv_Updb.java new file mode 100644 index 0000000..8be56ad --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/Test_Api_4_Afv_Updb.java @@ -0,0 +1,94 @@ +//----------------------------------------------------------------------------- +//Test_Api_1_Fvw_Updb.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_updb; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.fileadministration.api_4_afv_updb + * + * @version 0.0.1 - 8 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_4_Afv_Updb extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_Afv_updb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Updb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" ); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 to 12 */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/applet.opt new file mode 100644 index 0000000..0c56610 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_updb.Api_4_Afv_Updb_1 +uicc.test.access.fileadministration.api_4_afv_updb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updb/javacard/api_4_afv_updb.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_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Dg;2jiWv2}fZ*Y{Bt35&j#CI2hfElW{6+ z!)a)MKVl8m!P98M+3*a`!FqTW8?XtU$9Xs(Uc?2s2wuX)_yBZZGdf@wwqP6V#wEB4 z_TYcv8tBBexDH;%_4o{b_@Bk?un(WZcG!$MFoFg?I5Behcs6dAtB8@FM;MAK_)Z0w3d5 ze%n9c%ml%woR?6+X_6@n{z2gs4WCgTih(aEmJ;AgN~C`96(!Lv@HGvf!Ela-&@lLp z(kLCirwq!3A89y^fNmN|cfti4MFnt?CQuPvqGFl^KT!!yfy-1*6>xB<6@H(HHYYf=I$b(O(R}iDIA_ip64>7>ScamKcSl zB3q2cGBHMs#mV9~q6o`Hu_(hzFk<6K{zlIA6Ri-oXXps5ps>#0TOtTr55pXYc`WR&-;txFAW`BB>-5E-5QQ zisXaBleO=e>Q%D#y|0_)@D(XqceHV%w6Iso7wDgV?M)K&d$MBKxL9 zy~rcjvG5DolOXkl^i6_#A@}$R=}n3HV)`ZmyqL-CwD~hlpR|B4ux~EF3%t=!V4uu@ zFR*Xi?FHT*zLBgK_b6v!{IT@Uacx record.length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0E; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = (short)1; + dataOffset = 0; + dataLength = 0x04; + recOffset = (short)2; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.OUT_OF_RECORD_BOUNDARIES); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 15: Invalid mode, linear fixed file + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x0F; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x04; + recOffset = (short)0; + // Call the updateRecord() method with mode set to 1 + UiccFileView.updateRecord(recNumber,(byte)1,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.INVALID_MODE); + } + catch (Exception e) { + bRes = false; + } + + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x04; + recOffset = (short)0; + // Call the updateRecord() method with mode set to 5 + UiccFileView.updateRecord(recNumber,(byte)5,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes &= (e.getReason() == UICCException.INVALID_MODE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 16: Invalid mode cyclic file + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x10; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_CARU); + Util.arrayFillNonAtomic(data,(short)0,(short)data.length,(byte)0); + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x03; + recOffset = (short)0; + // Call the updateRecord() method with mode NEXT + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_NEXT,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes = ((e.getReason() == UICCException.INVALID_MODE) + ||(e.getReason() == UICCException.COMMAND_INCOMPATIBLE)); + } + catch (Exception e) { + bRes = false; + } + + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x03; + recOffset = (short)0; + // Call the updateRecord() method with mode CURRENT, recNumber set to 0 + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.INVALID_MODE) + ||(e.getReason() == UICCException.COMMAND_INCOMPATIBLE)); + } + catch (Exception e) { + bRes = false; + } + + try { + recNumber = (short)2; + dataOffset = 0; + dataLength = 0x03; + recOffset = (short)0; + // Call the updateRecord() method with mode ABSOLUTE, recNumber set to 2 + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.INVALID_MODE) + ||(e.getReason() == UICCException.COMMAND_INCOMPATIBLE)); + } + catch (Exception e) { + bRes = false; + } + + try { + recNumber = (short)0; + dataOffset = 0; + dataLength = 0x03; + recOffset = (short)0; + // Call the updateRecord() method with mode set to 5, recNumber set to 0 + UiccFileView.updateRecord(recNumber,(byte)5,recOffset,data,dataOffset,dataLength); + } + catch (UICCException e) { + bRes &= ((e.getReason() == UICCException.INVALID_MODE) + ||(e.getReason() == UICCException.COMMAND_INCOMPATIBLE)); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 17: data is null + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x11; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = 1; + dataOffset = 0; + dataLength = 4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,null,dataOffset,dataLength); + bRes = false; + } + catch(NullPointerException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 18: dataOffset < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x12; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + + try { + recNumber = 1; + dataOffset = (short)-1; + dataLength = 4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 19: dataLength < 0 + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x13; + bRes = false; + + try { + recNumber = 1; + dataOffset = (short)0; + dataLength = (short)-1; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 20: dataOffset + dataLength > data.length + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x14; + bRes = false; + + try { + recNumber = 1; + dataOffset = (short)18; + dataLength = 4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(ArrayIndexOutOfBoundsException e){ + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 21: EF is neither cylic or linear fixed + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x15; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_DF_TEST); + UiccFileView.select(UICCTestConstants.FID_EF_TARU); + + try { + recNumber = 1; + dataOffset = (short)0; + dataLength = (short)4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_CURRENT,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(UICCException e){ + bRes = (e.getReason() == UICCException.COMMAND_INCOMPATIBLE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 22: Access not fulfilled + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x16; + bRes = false; + + // Select cylic file, Update access set to NEV + UiccFileView.select(UICCTestConstants.FID_EF_CNU); + + try { + recNumber = 0; + dataOffset = (short)0; + dataLength = (short)3; + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_PREVIOUS,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(UICCException e){ + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) { + bRes = false; + } + + // Select linear fixed file, Update access set to NEV + UiccFileView.select(UICCTestConstants.FID_EF_LNU); + + try { + recNumber = 1; + dataOffset = (short)0; + dataLength = (short)4; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch(UICCException e){ + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + /*----------------------------------------------------------------------------------- + * TEST CASE 23: EF is deactivated + *----------------------------------------------------------------------------------*/ + testCaseNb = (byte)0x17; + bRes = false; + + UiccFileView.select(UICCTestConstants.FID_EF_CNR); + UiccFileView.deactivateFile(); + + try { + recNumber = 0; + dataOffset = (short)0; + dataLength = (short)3; + // Call the updateRecord() method + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_PREVIOUS,recOffset,data,dataOffset,dataLength); + bRes = false; + } + catch (UICCException e) { + bRes = (e.getReason() == UICCException.REF_DATA_INVALIDATED); + } + finally { + UiccFileView.activateFile(); + } + reportTestOutcome(testCaseNb,bRes); + + /*----------------------------------------- + * Restore the file content + *-----------------------------------------*/ + // Restore EF_LARU + UiccFileView.select(UICCTestConstants.FID_EF_LARU); + recNumber = 1; + dataOffset = (short)0; + dataLength = (short)4; + Util.arrayFillNonAtomic(data,(short)0,dataLength,(byte)0x55); + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + + Util.arrayFillNonAtomic(data,(short)0,dataLength,(byte)0xAA); + recNumber = 2; + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_ABSOLUTE,recOffset,data,dataOffset,dataLength); + + // Restore EF CARU + UiccFileView.select(UICCTestConstants.FID_EF_CARU); + recNumber = 0; + dataLength = 3; + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_PREVIOUS,recOffset,data,dataOffset,dataLength); + + Util.arrayFillNonAtomic(data,(short)0,dataLength,(byte)0x55); + UiccFileView.updateRecord(recNumber,UICCConstants.REC_ACC_MODE_PREVIOUS,recOffset,data,dataOffset,dataLength); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/Test_Api_4_Afv_Updr.java b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/Test_Api_4_Afv_Updr.java new file mode 100644 index 0000000..af1589a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/Test_Api_4_Afv_Updr.java @@ -0,0 +1,95 @@ +//----------------------------------------------------------------------------- +//Test_Api_1_Fvw_Updr.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.access.fileadministration.api_4_afv_updr; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.access.fileadministration.api_4_afv_updr + * + * @version 0.0.1 - 8 déc. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_4_Afv_Updr extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/access/fileadministration/api_4_Afv_updr"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 40010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 40010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_4_Afv_Updr() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" ); // LV Access Domain DAP field + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /** Testcase 1 to 12 */ + /*********************************************************************/ + + // Trigger Applet envelope unrecognized + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "17CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC"); + + test.reset(); + test.terminalProfileSession("0101"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/applet.opt b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/applet.opt new file mode 100644 index 0000000..dc0338d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x01:0x00:0x01 uicc.test.access.fileadministration.api_4_afv_updr.Api_4_Afv_Updr_1 +uicc.test.access.fileadministration.api_4_afv_updr +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x40:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/javacard/api_4_afv_updr.cap b/source/Annex_E_SourceCode/uicc/test/access/fileadministration/api_4_afv_updr/javacard/api_4_afv_updr.cap new file mode 100644 index 0000000000000000000000000000000000000000..e103dcae7b64078956e59e2d20b9ea9c352171b3 GIT binary patch literal 11244 zcmbt42Vhi1)3dX0%X_&amym>zLN5sdfzYdj5(r&F=omw|Kp-R`1(EMpjt&AUAP6dm zAgCaqRI!36ekcfv1q*zN1wm;dBI+mqyvrR)4*0%Lb9Z}hXLhIT?CiX^^R|C4ZiIoR z@1c7pwSY38FfgD`w}DBGQu-z*^hxTQlH4tIVBY*YN1_(>r^8(5dO6upw9H{`q_O!k?OU-8K0rwCQlF{rTS$*EM}`$g+LG z^%7UTY1BB>KYVbLN4L2;p4||E*%UX)E4$)?WQ( z(&|%Nm-e0Eaj&R$vBlc2X20G3U2(`=xN`j$t?rFldf%eiozw0doAP9@Zu-?ekIo%; z@^P77^j3}O4_xW(d10Mwx-{ZQt&a7GAui)zdGfj7V%VXwU8* zJ*y=qbxIiX!{TOhDjyisYj%q-8n&)A!g=J_(5*#quqGtD_i4|~ug87R^Y&l&zZTSZ zNRK^l-ZOH+%j3^aSbE#Ox?39lKDy@ex^?$N)|g*o$z9PeeqDFZ?2IeyqvY{R-~Vjy z*t5IdA2wmTac0WMjVJW+?>k3*b~Pq0_IO-t9en!4%KPW6|LpfcW2ZVMy>NI`+w7OJ zc7OQQm(#X=^2ws#Uh6gS-VcZW_TV2o!n3~#UU_DYnZE>rmp!^G(OPsVId;y-*y_J; zT{QTgcO8G&d3oFAxG62xUw)+ehLIZ@+}^*J(#5aM3R=YgT1bHYG{=^AX6-q?x_4Ti z{sh@2nM!eXW@bW>yRaxBBQw)oSeT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6a09r-SHlLzI8 zm@Ge%Ut)LpmHdY4-^%YWMV^wUv8OyEf5g7>tUQPPkjym?x_3VE4r^9fUoLQJrG~lX?iH`(Zlp`d_#}W zcj7*suCs8z9;3(MyL!ByfCqK1&d0-gqAtWEx=0t}`+Aa|g-7*leLsGv=j#Rdv0kVb z;U{{rUV@+MhxIc2Oh2Mm;c@+hUV|s~TD=ax*6Z~a{8m4&cjI^ZCH)GX*01W<@Qi+4 z@4+ARUVQ}5>i6|Wcus$;Kfw$7m_CIU_4oQTUeagukNC4btAEBT`m+8N|IkOa^?mXP=VW#j1v!^+fN1DUTJ9$+z-MouOn;B*yk1>nPVqVRhWKQPQ&3jA_ zuVqd%XY%^yEOQQzGv}I%cms2>xt!l-t}q|tjm^i+l{~>*Wj?{1n5)e#JkfmK+|HYs zJItNDg}KXoo3}LoX&&UQ%|qs4-qt)~zEAZJ%wxQb`KfuFFel7!c{}qv^E^*7FPJ~^ z&gLcaXWqrUZ2rQ#npZ5~-7IFgc(N5@Me!b1v=z%!tZG&x-qUJqwc>rO)>d2I*J@|A z=l!e>R&USGP!1FXUHteU6_iG6Pfcr839TiLZ(bGax}9C^#@HUn=-S1qBD>=mP}@CW=c1zZq7s5tmOJ i2g(gh#+J%G7G6=gzSM00UP9Vz9rPVcE;F^B4gEiCF9l}+ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/Cre_Api_Hepo_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/Cre_Api_Hepo_1.java new file mode 100644 index 0000000..dcd4217 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/Cre_Api_Hepo_1.java @@ -0,0 +1,172 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_api_hepo; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Cat Runtime Environment, Others parts transferred from API, a Handler is JCRE temporary entry point object + * applet 1 + */ +public class Cre_Api_Hepo_1 extends TestToolkitApplet { + + private byte testCaseNb = (byte)0x00; + private static boolean bRes; + + /** Registry entry concerning applet instance */ + private static byte[] displayString = {(byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'O'}; + + static Object staticObject; + Object object; + + // Constructor of the applet + public Cre_Api_Hepo_1() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Cre_Api_Hepo_1 thisApplet = new Cre_Api_Hepo_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + /** Test Case 1: EnvelopeHandler with static field */ + testCaseNb = (byte)1; + + bRes = false ; + try { + staticObject = EnvelopeHandlerSystem.getTheHandler(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 2: EnvelopeHandler with field */ + testCaseNb = (byte)2; + + bRes = false ; + try { + object = EnvelopeHandlerSystem.getTheHandler(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 3: EnvelopeResponseHandler with static field */ + testCaseNb = (byte)3; + + bRes = false ; + try { + staticObject = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 4: EnvelopeResponseHandler with field */ + testCaseNb = (byte)4; + + bRes = false ; + try { + object = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 5: ProactiveHandler with static field */ + testCaseNb = (byte)5; + + bRes = false ; + try { + staticObject = ProactiveHandlerSystem.getTheHandler(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 6: ProactiveHandler with field */ + testCaseNb = (byte) 6; + + bRes = false ; + try { + object = ProactiveHandlerSystem.getTheHandler(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 7: ProactiveResponseHandler with static field */ + testCaseNb = (byte)7; + // send proactive command to have the ProactiveResponseHandler available + ProactiveHandlerSystem.getTheHandler().initDisplayText((byte)0x80, (byte)0x04, displayString, (short)0, (short)displayString.length); + (ProactiveHandlerSystem.getTheHandler()).send(); + + bRes = false ; + try { + staticObject = ProactiveResponseHandlerSystem.getTheHandler(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 8: ProactiveResponseHandler with field */ + testCaseNb = (byte)8; + bRes = false ; + try { + object = ProactiveResponseHandlerSystem.getTheHandler(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/Test_Cre_Api_Hepo.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/Test_Cre_Api_Hepo.java new file mode 100644 index 0000000..80cfada --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/Test_Cre_Api_Hepo.java @@ -0,0 +1,80 @@ +/** + * ETSI TS 102 268: UICC API testing + * Cat Runtime Environment part 5 + * Test source for Other parts transferred to framework from API + * A handler is a temporary JCRE Entry Point object + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_api_hepo; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Cre_Api_Hepo extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_api_hepo"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Api_Hepo() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("01010000 0102"); + + // test case 1 to 8: trigger applet1 + response = test.unrecognizedEnvelope(); + result = response.checkSw("9113"); + + // fetch display text proactive command + response = test.fetch("13"); + result = result & response.checkData("D0118103 01218082 0281028D 06044845" + + "4C4C4F"); + response = test.terminalResponse("81030121 80020282 81030100"); + result = result & response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result = result & response.checkData("10" + APPLET_AID_1 + "08CCCCCC CCCCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/applet.opt new file mode 100644 index 0000000..9a75dac --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_api_hepo.Cre_Api_Hepo_1 +uicc.test.catre.cre_api_hepo +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/javacard/cre_api_hepo.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_hepo/javacard/cre_api_hepo.cap new file mode 100644 index 0000000000000000000000000000000000000000..494fe81b93f88f68a87f1eae69f474aeff2347ae GIT binary patch literal 4681 zcma)94RBP|75?tqx4+qhkOUGSfrJqW^0OhtQVl49BoasMe?|U}w z9ke3->gV=D+rMp3p4a-=-)|iM@wImnW*@UoNZwOdSw7ip*}tv*vQGfVRiK1E&Rl5A1%396ubIfxsbh%xDxsHjNYpxa; z;dc22MqfDDaYa#7h{T-)u)^5EXH_}*^t+)&+i|Aw$xHWeh@?@ZyN!(4QRoS1?vO9g zC{0n2h0&xG0szNvUlZO`^Ol1#Au}{9h@2}TFQlkMWx=9P_ zSsOhwuVelBhp0eO>`F@J`+b415*7LSwY^FxMVNQ;QzfV}YT=Vui>^k9Xj_IjW)Aof znzNE~Q*azJ^pu*-N>Vd>g5i@?Ofv$e$n`qx=D^ zN@Chtn9>X@vBWrX0}{rrg<(X$v<$T%Eo0CcsQuQ!*snz>>lK)>#FUk$t_1&tZ5`sC zg57T$u2S$DhNtbvGT7E2KF!$KA&os&D7Wii>PF~s2L$s?gdVp?uyi9N-T@)8O9zce zygfuBm9R0f$-ERj4Wv!$O-Sm)s`Ua%Y5ARVOuiF-mj%R6zAgTe=%Zs@;2qtITS?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ex_E_SourceCode/uicc/test/catre/cre_api_tmid/Cre_Api_Tmid_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/Cre_Api_Tmid_1.java new file mode 100644 index 0000000..36b5ad2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/Cre_Api_Tmid_1.java @@ -0,0 +1,92 @@ +//----------------------------------------------------------------------------- +// Cre_Api_Tmid_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_api_tmid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import javacard.framework.* ; +import uicc.test.util.* ; + +/** + * Cat Runtime Environment, Other parts transferred from API, Timer Identifier test + * applet 1 + */ +public class Cre_Api_Tmid_1 extends TestToolkitApplet { + + static byte instanceNumber = (byte)0x00; + static byte firstInstanceTimerId = (byte)0x00; + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'1'}; + + // Number of tests + byte testCaseNb = (byte)0x00; + + /** + * Constructor of the applet + */ + public Cre_Api_Tmid_1() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Cre_Api_Tmid_1 thisApplet = new Cre_Api_Tmid_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short)0, (short)MenuInit.length, (byte)0, + false, (byte)0, (short)0); + + // Allocate a timer + byte timerId = thisApplet.obReg.allocateTimer(); + + if (instanceNumber == 0) { + firstInstanceTimerId = timerId; + } + instanceNumber++; + } + + + /** + * method called by the CAT RE + */ + public void processToolkit(short event) { + // Result of tests + boolean bRes = false ; + + // -------------------------------------------- + // Test Case 1 : Verify the impossibility of releasing another applet timer + testCaseNb = (byte)1; + + bRes = false; + + + try { + obReg.releaseTimer(firstInstanceTimerId); + } + catch (ToolkitException e) { + // Check the exception is the good one and the timer has been allocated + if ((e.getReason() == ToolkitException.INVALID_TIMER_ID) + && (firstInstanceTimerId != 0)) + bRes = true; + } + catch (Exception e) { + } + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/Test_Cre_Api_Tmid.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/Test_Cre_Api_Tmid.java new file mode 100644 index 0000000..63b4ee1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/Test_Cre_Api_Tmid.java @@ -0,0 +1,90 @@ +/** + * ETSI TS 102 268: UICC API testing + * Cat Runtime Environment part 5 + * Test source for Other parts transferred to framework from API + * Timer Id between Applets + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_api_tmid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Cre_Api_Tmid extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_api_tmid"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50010202"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Api_Tmid() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package + test.loadPackage(CAP_FILE_PATH); + // install instance 1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "02" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // install instance 2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "02" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0202" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09010020"); + + + // test case 1: trigger second instance + response = test.envelopeMenuSelection("900102", ""); + result = response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_2); + result = result & response.checkData("10" + APPLET_AID_2 + "01CC"); + + // delete applets and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/applet.opt new file mode 100644 index 0000000..d388044 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_api_tmid.Cre_Api_Tmid_1 +uicc.test.catre.cre_api_tmid +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/javacard/cre_api_tmid.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_api_tmid/javacard/cre_api_tmid.cap new file mode 100644 index 0000000000000000000000000000000000000000..ada13792e8f1c7a2d8ca6326340b63e22830af50 GIT binary patch literal 3933 zcma)84{Q_X6@TB|*=M^>a1w{6#DNf+Kaj?b)6oKH0NcSMI0+_68Edq_**Vt-j&05t zMj*=^hjkQaiaJ#lZB=Nu(pDpMs-U83yRlAF8C}^lI#tkhtev_t0V+&sS+%O!`y8iN zpW5iodb-cwefRsl_wIea?*#)aX9pAh&JFEY3SYbIz(L2F9#2DCr{C4#>1^|_>F#lM z_`f_0FwxbU$TZqVYCl*txqWxtU-m^ld&u3f>8SgB?BQRGj!89-J?fpj^x~=Z(dEip zeVs=>KljnAe;is8s8e~+ zFwuLy@gc+d^wV8?K3M(l4PyuE&0|6D=~U74t*u9IoT(pgaW1-AJ5+P!LSX){Zxn3F z{9tNy;qEsFBA;CCJmmO|zkR_2JGLMD@rsX*`+xubXaCyh3e^93TXo;rW5q>lA2`>v zb?GaCdrEqjJ?Lw=$PI5e_4w+4M&5qbx8yFXp;vzUu~cixni zUVG|CjlshQ-hJk-k4vjgoLSPkxN4E#;jcaO#POn&*KREL)&?dnc3s)>!lyrbwsw2@ z;(2|IuUDL!fBE|1|9GN@UwePzMB>VS8}~WZrS?7Xac}VPzdbi{anI?$?wUB+_uHX= zEO_L6&4smv%Rl^sVQaxP$@R`F$KJU4lg)2`uled1HP(UWrC|sLc+=V2h8+n4@CFC? zpXDssPeni4(dQ19tiXTN8qo%&aM-1YDa92Q6j^kIWpT5Rlr}2^Qon1futNw7a=&Y> zDD;c6Gb|(t-2L~nQ`Z=V17bUZ0A?^u;q_n;$Bx<1^8L8%T(jhMe1+PbXtTYk`q3)M zVpvJYL(~-p7Q)?Vc4&r`PzHx^G#{b%up6)%3Gf`z1V3Is;=2`BP}3j0Cz*_i3T0%$ zt_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twNpRMO2)PSw(chr`DiO ffFc@X@;$NfG@TAL)M$uY77h}i&<>eMWMBUS6mF0W literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/Cre_Apt_Eade_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/Cre_Apt_Eade_1.java new file mode 100644 index 0000000..215546a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/Cre_Apt_Eade_1.java @@ -0,0 +1,200 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Eade_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_eade; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_APPLICATION_DESELECT + * + * + * + * + * + */ + + public class Cre_Apt_Eade_1 extends TestToolkitApplet{ + + private static boolean bRes; + private byte testCaseNb = (byte) 0x00; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'1'}; + //private static byte[] ADF1AID ={(byte)0xA0,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x09,(byte)0x00 ,(byte)0x05 ,(byte)0xFF ,(byte)0xFF ,(byte)0xFF ,(byte)0xFF ,(byte)0x89 ,(byte)0xE0 ,(byte)0x00 ,(byte)0x00 ,(byte)0x02}; + //private static byte[] ADF2AID ={(byte)0xA0,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x09,(byte)0x00 ,(byte)0x05 ,(byte)0xFF ,(byte)0xFF ,(byte)0xFF ,(byte)0xFF ,(byte)0x89 ,(byte)0xD0 ,(byte)0x00 ,(byte)0x00 ,(byte)0x02}; + + + + + //Constructor of the applet + public Cre_Apt_Eade_1(){ + + } + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + //Create a new applet instace + Cre_Apt_Eade_1 thisApplet = new Cre_Apt_Eade_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT_APPLICATION_DESELECT + thisApplet.obReg.setEvent(EVENT_APPLICATION_DESELECT); + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + try{bRes=thisApplet.obReg.isEventSet(EVENT_APPLICATION_DESELECT);} + catch(Exception e){bRes=false;} + } + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + UICCTestConstants UICCTestConstants_i= new UICCTestConstants(); + EnvelopeHandler envHndlr = EnvelopeHandlerSystem.getTheHandler(); + //event EVENT_APPLICATION_DESELECT + if(event==EVENT_APPLICATION_DESELECT){ + //TEST CASE 1: 1 - METHOD isEventSet() RETURNS TRUE + switch(testCaseNb){ + case (byte)0x00: + testCaseNb=(byte)0x01; + reportTestOutcome(testCaseNb,bRes); + //TEST CASE 1:3 - THE ENVELOPE HANDLER CONTAINS THE AID OF ADF1 + testCaseNb=(byte)0x02; + + if(envHndlr.findAndCompareValue((byte)0x2F,UICCTestConstants_i.AID_ADF1, (short)0)==0){ + bRes=true; + } + else {bRes=false;} + reportTestOutcome(testCaseNb,bRes); + break; + + //TEST CASE 1:4 - APPLET IS TRIGGERED. + //THE ENVELOPE HANDLER CONTAINS THE AID OF ADF2 + case (byte)0x02: + testCaseNb=(byte)0x03; + if(envHndlr.findAndCompareValue((byte)0x2F,UICCTestConstants_i.AID_ADF2, (short)0)==0){ + bRes=true; + } + else {bRes=false;} + reportTestOutcome(testCaseNb,bRes); + //TEST CASE 2: 1 - METHOD clearEvent() IS CALLED + testCaseNb=(byte)0x04; + try{ + obReg.clearEvent(EVENT_APPLICATION_DESELECT); + bRes=true; + } + catch(Exception e){bRes=false;} + reportTestOutcome(testCaseNb,bRes); + testCaseNb=(byte)0x05; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb=(byte)0x06; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb=(byte)0x04; + break; + + case (byte)0x04: + if(envHndlr.findAndCompareValue((byte)0x2F,UICCTestConstants_i.AID_ADF1, (short)0)==0){ + testCaseNb=(byte)0x05; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + } + else if(envHndlr.findAndCompareValue((byte)0x2F,UICCTestConstants_i.AID_ADF2, (short)0)==0){ + testCaseNb=(byte)0x06; + bRes=false; + testCaseNb=(byte)0x04; + + } + else{ + reportTestOutcome((byte)0x05,false); + reportTestOutcome((byte)0x06,false); + testCaseNb=(byte)0x05; + } + break; + + case (byte)0x05: + if(envHndlr.findAndCompareValue((byte)0x2F,UICCTestConstants_i.AID_ADF2, (short)0)==0){ + testCaseNb=(byte)0x06; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + } + else{ + reportTestOutcome((byte)0x06,false); + + } + testCaseNb=(byte)0x04; + break; + + case (byte)0x08: + testCaseNb=(byte)0x09; + + //TEST CASE 2:6 - THE ENVELOPE HANDLER CONTAINS THE AID OF ADF1 + if(envHndlr.findAndCompareValue((byte)0x2F,UICCTestConstants_i.AID_ADF1, (short)0)==0){ + bRes=true; + } + else {bRes=false;} + reportTestOutcome(testCaseNb,bRes); + break; + + //TEST CASE 2:7 - APPLET IS TRIGGERED THE ENVELOPE HANDLER CONTAINS THE AID OF ADF2 + case (byte)0x09: + testCaseNb=(byte)0x0A; + if(envHndlr.findAndCompareValue((byte)0x2F,UICCTestConstants_i.AID_ADF2, (short)0)==0){ + bRes=true; + } + else {bRes=false;} + reportTestOutcome(testCaseNb,bRes); + + }//end of switch + } + + //event EVENT_MENU_SELECTION + if(event==EVENT_MENU_SELECTION){ + switch(testCaseNb){ + //TEST CASE 2:4 - APPLET IS TRIGGERED + case (byte)0x04: + testCaseNb=(byte)0x07; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb=(byte)0x08; + try{ + obReg.setEvent(EVENT_APPLICATION_DESELECT); + bRes=true; + } + catch(Exception e){bRes=false;} + reportTestOutcome(testCaseNb,bRes); + break; + + //TEST CASE 2:4 - APPLET IS TRIGGERED. THIS CASE ONLY IF APPLET IS TRIGGERED WRONGLY + case (byte)0x05: + testCaseNb=(byte)0x07; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb=(byte)0x08; + try{ + obReg.setEvent(EVENT_APPLICATION_DESELECT); + bRes=true; + } + catch(Exception e){bRes=false;} + reportTestOutcome(testCaseNb,bRes); + break; + + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/Test_Cre_Apt_Eade.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/Test_Cre_Apt_Eade.java new file mode 100644 index 0000000..3ab8d0a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/Test_Cre_Apt_Eade.java @@ -0,0 +1,89 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: UICC CAT Runtime Environment Applet Triggering +// EVENT_APPLICATION_DESELECT +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_eade; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Eade extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_eade"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String ADF1 = "A0000000 090005FF FFFFFF89 E0000002"; + static final String ADF2 = "A0000000 090005FF FFFFFF89 D0000002"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Eade() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + test.selectForActivation(ADF1); + //***TEST CASE 1: 2-APPLET IS TRIGGERED HANDLER CONTAINS THE AID OF ADF1 + test.selectForActivation(ADF2); + //***TEST CASE 1: 3-APPLET IS TRIGGERED HANDLER CONTAINS THE AID OF ADF2 + test.selectForTermination(ADF2); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.selectForActivation(ADF1); + //***TEST CASE 2: 2-APPLET IS NOT TRIGGERED + test.selectForActivation(ADF2); + //***TEST CASE 2: 3-APPLET IS NOT TRIGGERED + test.selectForTermination(ADF2); + //***TEST CASE 2: 4-APPLET IS TRIGGERED + test.envelopeMenuSelection("100101", "");//Help Request not available + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.selectForActivation(ADF1); + //***TEST CASE 2: 6-APPLET IS TRIGGERED HANDLER CONTAINS THE AID OF ADF1 + test.selectForActivation(ADF2); + //***TEST CASE 2: 7-APPLET IS TRIGGERED HANDLER CONTAINS THE AID OF ADF2 + test.selectForTermination(ADF2); + + + // check results + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10"+APPLET_AID_1+"0ACCCCCC CCCCCCCC CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/applet.opt new file mode 100644 index 0000000..8948b94 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_eade.Cre_Apt_Eade_1 +uicc.test.catre.cre_apt_eade +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/javacard/cre_apt_eade.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_eade/javacard/cre_apt_eade.cap new file mode 100644 index 0000000000000000000000000000000000000000..6cfd960125cfa0a2d2e6698702a240914fbfe30e GIT binary patch literal 3531 zcmbVO32YNb6#cWi-d$hd7~5=2qB3ZkPrnLjN=xg5F6V;G(hT@ zD;FUk5Rd`_p#o9~AWA`~Do}BhLRE2-j_G^^rlnx+`qkL<4x(wEt%1~z4fj2o<0AJpK<8h^_y2-ZwqWWXZ#g% zR*9!~T)A4^e}=Vs*UH$3gP~7tAnWnaZ(N&`{u(`V@WscGJ|~{o=QcPWt?z&M?#lJf zz@}$+e{A{v<|SA2(~{4c3a8(yJQ%FHT5havI}_Pjna6F|^?6fr(f4nboJ}t7_{q`6 z_OKloXxQ)eh5cpTP_)eNE%&<@co%zp-f+2lGJOoYeBKa&JPJ@~7b#d63WjA74l>ow zYey=E2s^QvM^G}svsQcyFFS!GuH}LGWVi^sDMll-`8X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}4G2GlxB9TmqabX$gbU)p>o%-zCmc0A;xVQJ` zeD|Jn?{{2<466ekKe|45DLhnkz=Cu2dfP(B+5)T7w$@Rwx_EuIv*52jfUb4UqHQ^b z6MH7+)C}26&V|m8Xpgg3`_0YI4)&h&UxLDtk6#Ub;b->y)2zYHts`yMyr+wIuR1W1 zbtbQDo_)xCXw-2<@YH_(?(FpD#xeZ{mG8BU=Jt{gvUKkyj2+&+Igobfm;Ud2UGol> zcTOI&o!qhrt!HJd|HwUIx?TG5MmAA)-FIV0U7%#k2 zzTvInOSz@>gJUNqzs=s>{aw|;DWQmoYCD#lEfB9$MPIwB%7eG_I)0sBTiO#manXJ4 zad)}hd3A=XkmEnK=}&H=08X<2E)1Ix3l<5RN8jr*;xB?6#O4aG*DCrVqSfmb!#=Aw z>??JL#8O|GTeMcXUvPWf;WFzQpS#Q#&i1-P6r_#xMQ>6x3zW7K4QN0W#j?|d?Rcv0 zb)&n?*h}yjLK#(lMcC&RgW;`&jfOdphS0%sSPXiKf)pS(ZwoL$0nbu0%GRt`>@#tk zK>6uxp^)Dv5yQa+H9!(m2Q-3L zlfDKFGxj5BY8wsMuZiEtw3YQcQgH@>6`^n=es?57cAy5my$+}-2!!5KPeTJw2@RYq zzUO&I4+b3wl)K*P6U&2TgodLi8g|u9gZ&`DDAp4o&{{(as0~aL)bNYifL_r8O!h2; zk+m6&mS$jQHG^u_HcFe?N&^SjdI@+2(avCL<$+T#e=tn^Qp02zwW(E`x*-AqJPZp- zSUV8U8`vf=bVDs@njyiUYJ#qNW@#1|hBOPw`VcKmQL{KPlxa{m#a#YiAT-0kHvw7n zpv$P`sw@UhvKbrxx6PXPxLG`hmKp$nfLtPFaVr+xVuiP$!sm~kQy rglhq literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/Cre_Apt_Edbs_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/Cre_Apt_Edbs_1.java new file mode 100644 index 0000000..8692b49 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/Cre_Apt_Edbs_1.java @@ -0,0 +1,121 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Edbs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_edbs; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_EVENT_DONWLOAD_BROWSING_STATUS + * + * + * + * + * + */ + + public class Cre_Apt_Edbs_1 extends TestToolkitApplet{ + + private static boolean bRes; + private byte testCaseNb = (byte) 0x00; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'1'}; + + //Constructor of the applet + public Cre_Apt_Edbs_1(){ + + } + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + //Create a new applet instace + Cre_Apt_Edbs_1 thisApplet = new Cre_Apt_Edbs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT_EVENT_BROWSING_STATUS + thisApplet.obReg.setEvent(EVENT_EVENT_BROWSING_STATUS); + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + try{bRes=thisApplet.obReg.isEventSet(EVENT_EVENT_BROWSING_STATUS);} + catch(Exception e){bRes=false;} + } + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + EnvelopeHandler envHndlr = EnvelopeHandlerSystem.getTheHandler(); + //event EVENT_EVENT_BROWSING_STATUS + if(event==EVENT_EVENT_BROWSING_STATUS){ + //TEST CASE 1: 1 - METHOD isEventSet() RETURNS TRUE + switch(testCaseNb){ + case (byte)0x00: + testCaseNb=(byte)0x01; + reportTestOutcome(testCaseNb,bRes); + //TEST CASE 1:2 - Applet is triggered + testCaseNb=(byte)0x02; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + + //TEST CASE 2: METHOD clearEvent() IS CALLED + testCaseNb=(byte)0x03; + try{ + obReg.clearEvent(EVENT_EVENT_BROWSING_STATUS); + bRes=true; + } + catch(Exception e){bRes=false;} + reportTestOutcome(testCaseNb,bRes); + //TEST CASE 2: 1 - APPLET IS NOT TRIGGERED + testCaseNb=(byte)0x04; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + break; + case (byte)0x04: + testCaseNb=(byte)0x04; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + break; + //TEST CASE 2: 3 - APPLET IS TRIGGERED + case (byte)0x06: + testCaseNb=(byte)0x07; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + break; + }//end of switch + } + + //event EVENT_MENU_SELECTION + if(event==EVENT_MENU_SELECTION){ + switch(testCaseNb){ + //TEST CASE 2:2 - APPLET IS TRIGGERED + case (byte)0x04: + testCaseNb=(byte)0x05; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + //setEvent() doesn't throws any exception + testCaseNb=(byte)0x06; + try{ + obReg.setEvent(EVENT_EVENT_BROWSING_STATUS); + bRes=true; + } + catch(Exception e){bRes=false;} + reportTestOutcome(testCaseNb,bRes); + break; + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/Test_Cre_Apt_Edbs.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/Test_Cre_Apt_Edbs.java new file mode 100644 index 0000000..cf803e8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/Test_Cre_Apt_Edbs.java @@ -0,0 +1,75 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: UICC CAT Runtime Environment Applet Triggering +// EVENT_EVENT_DONWLOAD_BROWSING_STATUS +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_edbs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Edbs extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_edbs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Edbs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("01010000 01010000 000000FF 5F"); + //***TEST CASE 1: 2-APPLET IS TRIGGERED + test.envelopeEventDownloadBrowsingStatus(); + //***TEST CASE 2: 1-APPLET IS NOT TRIGGERED + test.envelopeEventDownloadBrowsingStatus(); + //***TEST CASE 2: 2-APPLET IS TRIGGERED + test.envelopeMenuSelection("100101", "");//Help Request not available + //***TEST CASE 2: 3-APPLET IS TRIGGERED + test.envelopeEventDownloadBrowsingStatus(); + + // check results + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10"+APPLET_AID_1+"07CCCCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/applet.opt new file mode 100644 index 0000000..982fc78 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_edbs.Cre_Apt_Edbs_1 +uicc.test.catre.cre_apt_edbs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/javacard/cre_apt_edbs.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edbs/javacard/cre_apt_edbs.cap new file mode 100644 index 0000000000000000000000000000000000000000..4b1e1336c95d225b926b8fc19f8a222ad4b6c9b2 GIT binary patch literal 3092 zcma)8dr(wW82|2ry?5`jwK)r1#8n0`bVwFSol$%Q0*Sb|f-()6v@BO$Kz7}|S`tpn znu1Rh$9(-E>SWHS=%iHUU{>lVWfP+_rkO=LsZ%Otkz*!(XMJ4vG|k*|=Qrox^Z5O~ z^PO|P?>Y-P-U=cL>a^--Z1Bb{u8crWtGFOZ~wdmfXHWox5`e-|W3tYA-zBdVccQ^%u&HC&rICy}Rq`*FCu}bnkAS*EQz# zsofQ9`__>gV;fv?%!C;SzPTnSvu-qQ>)vVYSF!B*Tkee7Z5?-<+g4rMkvZo<=??H$ zHd_|R@xy;g^bYuHouetRqN}T9&+q3hE~@(H>WyjNm$lrRGt;}Qjl0g zBh`BjCgi>G-uM$|?hGE{x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YKDSZ0aOYU_3wwI*Rjs%+^1~AS!tU?m z-?!Rqw=9q6_D*|m$5@ta@$$XH6>EP!e81<=;`MbUzwU23Gv!p=y6}E_;i&1Y8>>bK z`o9>RacbtntkwI>mQ-)`#FXUpuWuL5X(>Jwd^@zPr*_u72Z2LtKe~Fnx#(c~{p{B2 zlkU&H8~fZnbb0gjZ>HNzIsWSIOFNq=fG=49JBCe&1dD{NCh4r*h`$JO5$jz}r`a$1 z{AQ=a?-k8XuUPHy_^ZWQ?0>`Yro-v*)|y`x9krs@HTqnQ=I$E{kbporNlAmp?TwJIP$YNWIGUm< z?f_Obc*y8IBw#N*83ZbNFZAuiOyUrNIS6Gwwz?aAen+FZ#8nptGMhnA+OS)Ay}G^j%nmp>cu zOg8W#Ad8-L8FgG;hJll8Muz`wvn4ui88v-{1^^%+mq=OMD*O(=%V~3o^%1x7_${u!ywrrq@6Y?2Sy*qRdSV zhjCsyA`M#^FdhGAQMsyhX*(z#dpwUiN~JORI@)3{rD#2B;?q?8yxNmg99{k|F%v5S zJ_AzzD>Fz|PT(n(c}U6=a_jPBAX!gGHz~6ol^Wy(a_N@{b}1&15`o;hT=OOC6N;@% z89;7buHusQ4o0bSlGW9R9bFbu2GWp3z(3U wZC$2VatgUNNfh~*3zbpGluAw^*BpuBjADvt1+tf_a3w$temwel3rBwa4gLKNt^fc4 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/Cre_Apt_Edcd_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/Cre_Apt_Edcd_1.java new file mode 100644 index 0000000..a5aeb26 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/Cre_Apt_Edcd_1.java @@ -0,0 +1,120 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Edcd_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_edcd; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED + * + * + * + * + * + */ + +public class Cre_Apt_Edcd_1 extends TestToolkitApplet{ + + private byte testCaseNb = (byte) 0x00; + private static boolean bRes; + //private static ToolkitRegistry obReg; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'1'}; + + //Constructor of the applet + + public Cre_Apt_Edcd_1(){ + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Edcd_1 thisApplet = new Cre_Apt_Edcd_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT DOWNLOAD CALL DISCONNECTED + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED); + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + bRes=thisApplet.obReg.isEventSet(EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED); + } + + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + + //event EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED + if(event==EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED){ + + switch(testCaseNb){ + case (byte)0x00: + testCaseNb=(byte)0x01; + reportTestOutcome(testCaseNb,bRes); + //TEST CASE 2: THE APPLET IS UNREGISTERED TO THE EVENT + testCaseNb=(byte)0x02; + try{ + //deregister to EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED + obReg.clearEvent(EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + reportTestOutcome((byte)0x03,true); + break; + case (byte)0x02: + testCaseNb=(byte)0x03; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + break; + case (byte)0x04: + //TEST CASE 5:THE APPLET MUST BE TRIGGERED + testCaseNb=(byte)0x05; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + } + } + + //event EVENT_MENU_SELECTION + if(event==EVENT_MENU_SELECTION){ + //TEST CASE 4: THE APPLET IS REGISTERED TO THE EVENT + testCaseNb=(byte)0x04; + try{ + //register to EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED + obReg.setEvent(EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + + } + + } + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/Test_Cre_Apt_Edcd.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/Test_Cre_Apt_Edcd.java new file mode 100644 index 0000000..f3511cb --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/Test_Cre_Apt_Edcd.java @@ -0,0 +1,76 @@ +//----------------------------------------------------------------------------- +// Package Definition +// UICC CAT Runtime Environment Applet Triggering +// EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_edcd; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Edcd extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_edcd"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Edcd() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09010000 09"); + //***TEST CASE 1: 1-APPLET 1 IS REGISTERED TO EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED*** + //***TEST CASE 1: 2-APPLET 1 IS TRIGGERED*** + test.envelopeEventDownloadCallDisconnected(); + //***TEST CASE 2: 1-APPLET 1 IS NOT TRIGGERED*** + test.envelopeEventDownloadCallDisconnected(); + //***TEST CASE 2: 1 IS REGISTERED TO EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED + test.envelopeMenuSelection("100101", "");//Help Request not available + //***TEST CASE 2: 2-APPLET 1 IS TRIGGERED*** + test.envelopeEventDownloadCallDisconnected(); + + + // check results + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10"+APPLET_AID_1+"05CCCCCC CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/applet.opt new file mode 100644 index 0000000..66bd17e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_edcd.Cre_Apt_Edcd_1 +uicc.test.catre.cre_apt_edcd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/javacard/cre_apt_edcd.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcd/javacard/cre_apt_edcd.cap new file mode 100644 index 0000000000000000000000000000000000000000..34c406393ed5fc07438372ebea1acde63e3e52f1 GIT binary patch literal 2984 zcma)7du&rx82|30y|?Wi-DpP{RJy^6P_}NoT-=x&h2b27WPh@*1*i zB^iUQ6*X}}&;St>af2xM2w?%DIEH`l5=Am}io`@v9s_|1^*a@~^s31{cfXy}^Z0(} zeBU|0&tA%~I^gkRoAW2bV?_rnl+Bo1lvy&n*jiRJyQFwV#oVm2;`_Y-o#hL?!E9aQ znEq!5>Q_Jc$;wT)LOEsgFIBgkvv_(BzczMndHelAeTx1q+ozX*VK@I#*?oM=n0of} zBYR9Ya?1?cQ*z?x(et!F4X(M9y|cDGSCOzoyB$a7Uf}W%$oS+H>_sdcym9 zFW#Q)x;tfGTl&4z<9<%o??3g>DUrF1e0 zx-PT*z=D7$$*?@>YO=zzrn}0uqw%()V8i@rJtw|ib^X07A6pV{9$PuA_+@Wkd0X8aXPJn zJ0Mt{4#DrXI{oe{hfk<-yPPiT%Z}v^r^D~EKI?Y4-2N=5!$(2th2F>&ie`b*Zbbts zP(-k-w_`h&s;j&|l#aaw6A|*LrhEKur{MLkB5X8_gj9qM@?Zj_P!#BaT)h>*00lft zNhrgXM%z#vCy;--BA>6;Ef78ibdpn1$TK4LTy@s)`2r*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rG7HgWP_EAc5#<@F_Ci_dJq_7c2=P)Ai#?~xonmuDGaqhTbZB8*T76CjDAAQ8yTTM7(Nz_XNs zvSr-L;$$2rP=7kB+ubPn2p^}YwWO~Z!;Jk1np#Bz_UocI5<4xpCIx2@SP&{V(rEX3$quxTR2%>*3<9CA z3)0ZcQ$jPRh_8Nf&ru9I5U6*3rQ}=aauOPjqG;FwToh%F4379Kcl;qzhQ7e6z~WJqXO z+y!1(goj}v9_w<%T#*fd*aa&=NO$a)lnx$D>=+@!fr7}m__H5|`q1ucVr@uVHSmC}NQ@qXL}!9;|*Q!|;GN6RC@ut_ocxa7G)1%Cd z2#0ZA1|l6>X2`_O3Up38i&qGLWrjpqtcLk4g-$caE{U8(u9^+&3$ z%NamvU8&--_0^18=O{H@$)OZznIjHwjJg06Ka*>vaiuQH#+RrzE~~WCx>BQL>)&ER xQnz)5Vks$<+9Xp@A6emu=q(5J><4 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/Cre_Apt_Edcs_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/Cre_Apt_Edcs_1.java new file mode 100644 index 0000000..7e63768 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/Cre_Apt_Edcs_1.java @@ -0,0 +1,258 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Edcs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_edcs; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + * + * + * + * + */ +public class Cre_Apt_Edcs_1 extends TestToolkitApplet { + + private byte testCaseNb = (byte) 0x01; + private static boolean bRes; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'1'}; + + public final static byte QUALIFIER_1 = (byte)0x01; + public final static byte QUALIFIER_2 = (byte)0x02; + public static byte[] ADDRESS_VALUE = {(byte)0x81, (byte)0x55, (byte)0x66, (byte)0x77, (byte)0x88}; + public static byte[] BEARER_VALUE = {(byte)0x03, (byte)0x00}; + public static byte[] BUFFER_SIZE_VALUE = {(byte)0x00, (byte)0x0A}; + + /* Constructor of the applet */ + public Cre_Apt_Edcs_1() { + + } + + + /* Method called by the JCRE at the installation of the applet */ + public static void install (byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instace + Cre_Apt_Edcs_1 thisApplet = new Cre_Apt_Edcs_1(); + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + } + + + /* Method called by the UICC CAT Runtime Environment*/ + public void processToolkit(short event) { + + bRes=false; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler(); + + if (event==EVENT_MENU_SELECTION) { + + switch(testCaseNb) { + /* Test Case 1: Applet Registration to EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS */ + case (byte)0x01: + // 2-The applet is registered to EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + try { + obReg.setEvent(EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS); + bRes=true; + } + catch(Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x02; + + // 3- The applet shall not be triggered by EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + bRes=true; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x03; + break; + + case (byte)0x03: + /* 5- Open a channel with init() method + type = Open Channel + qualifier = 01 + dstDevice = ME */ + try { + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)5); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)2); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)2); + // 6- send() method is called + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x04; + + // 8- The applet shall not be triggered by EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + bRes=true; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x05; + break; + + case (byte)0x05: + /* 10- Open a channel with init() method + type = Open Channel + qualifier = 01 + dstDevice = ME */ + try { + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)5); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)2); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)2); + + // 11- send() method is called + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x06; + break; + /* Test Case 3: Applet Deregistration to EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS */ + case (byte)0x07: + /* 1- Open a channel with init() method + type = Open Channel + qualifier = 02 + dstDevice = ME */ + try { + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_2, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)5); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)2); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)2); + // send() method is called + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x08; + // 2- Close the opened channel unsuccessfully + try { + proHdlr.initCloseChannel((byte)0x02); + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x09; + break; + /* Test Case 5: The applet is not triggered after a reset */ + case (byte)0x0B: + /* 1- Open a channel with init() method + type = Open Channel + qualifier = 01 + dstDevice = ME */ + try { + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)5); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)2); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)2); + // 2- send() method is called + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0C; + // 3- isEventSet() + bRes = obReg.isEventSet(EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS); + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0D; + // 5- The applet is not triggered by EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + bRes=true; + reportTestOutcome(testCaseNb, bRes); + break; + + } + } + + if (event==EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS) { + + switch(testCaseNb) { + /* Test Case 1: 3/8- The applet shall not be triggered by EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS */ + case (byte)0x03: + bRes=false; + testCaseNb = (byte) 0x02; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x03; + break; + case (byte)0x05: + bRes=false; + testCaseNb = (byte) 0x04; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x05; + break; + /* Test Case 2: The applet is triggered by EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS */ + case (byte)0x06 : + bRes=true; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x07; + break; + /* Test Case 3: Applet Deregistration to EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS */ + case (byte)0x09: + // 4- Close the opened channel successfully + try { + proHdlr.initCloseChannel((byte)0x02); + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0A; + /* Test Case 4: 1- The applet is not triggered by EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS */ + bRes=true; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0B; + break; + /* Test Case 4: 1- The applet shall not be triggered by EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS */ + case (byte)0x0B: + bRes=false; + testCaseNb = (byte) 0x0A; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0B; + break; + /* Test Case 5: 5- The applet is not triggered by EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS */ + case (byte)0x0D: + bRes=false; + reportTestOutcome(testCaseNb, bRes); + break; + } + } + } + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/Test_Cre_Apt_Edcs.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/Test_Cre_Apt_Edcs.java new file mode 100644 index 0000000..1664274 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/Test_Cre_Apt_Edcs.java @@ -0,0 +1,154 @@ +//----------------------------------------------------------------------------- +// Package Definition +// UICC CAT Runtime Environment Applet Triggering +// EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_edcs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Edcs extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_edcs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Edcs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "03" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "02" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + //***TEST CASE 1: 1-APPLET 1 IS TRIGGERED BY EVENT_FIRST_COMMAND_AFTER_ATR, + //*** 2-APPLET 2 IS TRIGGERED BY EVENT_PROFILE_DONWLOAD + //*** 3_APPLET 3 IS NOT TRIGGERED + test.terminalProfileSession("09010020 000C0000 00000003 40"); + //***TEST CASE 1: 1-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result = response.checkSw("9000"); + + //***TEST CASE 1: 3-APPLET 1 IS NOT TRIGGERED BY EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + response = test.envelopeEventDownloadChannelStatus("38028100"); + result &= response.checkSw("9000"); + + //***TEST CASE 1: 4-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("911A"); + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + //TERMINAL RESPONSE WITH PROACTIVE UICC SESSION TERMINATED BY USER + test.terminalResponse("81030140 01820282 81830110"); + + //***TEST CASE 1: 8-APPLET 1 IS NOT TRIGGERED BY EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + response = test.envelopeEventDownloadChannelStatus("38020100"); + result &= response.checkSw("9000"); + + //***TEST CASE 1: 9-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("911A"); + //APPLET 1 BUILD A PROACTIVE COMMAND OPEN CHANNEL + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + //SUCCESSFUL TERMINAL RESPONSE + response = test.terminalResponse("81030140 01820282 81830100 38028100" + + "35020300 3902000A"); + result &= response.checkSw("9000"); + + //***TEST CASE 2: 1-APPLET 1 IS TRIGGERED BY EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + response = test.envelopeEventDownloadChannelStatus("38028100"); + result &= response.checkSw("9000"); + + //***TEST CASE 3: 1-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("911A"); + //APPLET 1 BUILD A PROACTIVE COMMAND OPEN CHANNEL + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400282 02818206 05815566" + + "77883502 03003902 000A"); + //TERMINAL RESPONSE WITH PARTIAL COMPREHENSION + response = test.terminalResponse("81030140 02820282 81830101 38028200" + + "35020300 3902000A"); + result &= response.checkSw("910B"); + //APPLET 1 BUILD A PROACTIVE COMMAND CLOSE CHANNEL + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028122"); + //UNSUCCESSFUL TERMINAL RESPONSE: TERMINAL CURRENTLY UNABLE TO PERFORM THE COMMAND + response = test.terminalResponse("81030141 00820282 81830120"); + result &= response.checkSw("9000"); + + //***TEST CASE 3: 4-APPLET 1 IS TRIGGERED BY EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + response = test.envelopeEventDownloadChannelStatus("38028200"); + result &= response.checkSw("910B"); + //APPLET 1 BUILD A PROACTIVE COMMAND CLOSE CHANNEL + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028122"); + //TERMINAL RESPONSE WITH MISSING INFORMATION + response = test.terminalResponse("81030141 00820282 81830102"); + result &= response.checkSw("9000"); + + //***TEST CASE 4: 4-APPLET 1 IS NOT TRIGGERED BY EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + response = test.envelopeEventDownloadChannelStatus("38028200"); + result &= response.checkSw("9000"); + + //***TEST CASE 5: 1-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("911A"); + //APPLET 1 BUILD A PROACTIVE COMMAND OPEN CHANNEL + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + //SUCCESSFUL TERMINAL RESPONSE + test.terminalResponse("81030140 01820282 81830100 38028200" + + "35020300 3902000A"); + result &= response.checkSw("9000"); + test.reset(); + test.terminalProfileSession("09010020 000C0000 00000003 40"); + response = test.envelopeEventDownloadChannelStatus("38028200"); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10"+APPLET_AID_1+"0DCCCCCC CCCCCCCC CCCCCCCC CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/applet.opt new file mode 100644 index 0000000..c262122 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_edcs.Cre_Apt_Edcs_1 +uicc.test.catre.cre_apt_edcs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/javacard/cre_apt_edcs.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edcs/javacard/cre_apt_edcs.cap new file mode 100644 index 0000000000000000000000000000000000000000..f51f87b9c293608a154942e094eb9c5dc07c21fb GIT binary patch literal 3766 zcmb_eYfKbZ6h8CZ*%=oHLSTg=mWoy)yWm^VDu}2>U=g&5FS;&kL@B$nqgAwYS+#;9 zDvh>UB_NTusrYCrT0x>x2x^0xw!Zo>rj1yQsWrB#rj?$%YKEQ0W`1}l-=4jXIp4kK z?4JAC(it`s1bn!%@gt#E3k4Q3rsO8aPtQ!VW+Z1$Pn(jHYspA^d={W_W`@g`U~YZ? zUUbP1LG59CJSP$xjOXTkozPs}&~j{%xIeVMr?hpKqC ziaYo9$=+~f$3gGX^56eyDlv~45p(ob+|Zm6+f$tFO&1Qu*|v(^*P06N>^$hLn<-xW zX3?B1cVq3~(A4plgTLB)sBvoR%`4q;9jD^X=Z-AxXiv(6hAUEkb4+BW`Rdl$UnZ^j zF~JjgZD7U2g6-MsU%z(ukH*p+2TtvuwX)&!BbCXCN_BSqnU8K%%sZVOeYtM=$(qyc z?2^%umUw#feAbuSc6xX8j#c}jOUt&*j4SWAYh~7rWAFUgHQ6()=G@uc59d~-bZ$#Z zQ93)zvp4>|Y|K>4%WXN8RW;+bf85oT(>*wA%k4|m-%k9wWVjM_;qgRn-SPR4nvNcy zKX*fOw(`d9oR;x$ZSD1Sb;cu&S+;b8u=%^_++`F%2Mb`sw2A&?k+dxgJ86r;9zgaZ)tPOGEXnP+z^dCq)?$GXJ6!tSsa=Ub;a?fK4Pi^J}wAmXR9J$EUZ1xl_(2S(s} zuvOUbdmz>QrJ>7XaFk#;LLXIXL9x@JxQbU1HX5QK0uc&HkOpDQ0vHT6=xP_zvJlKt z8p>(+y9R~hJc0hxCA-~)PKEF>5UM#91r($Po~y`O_5Eu|K%k#w`de;Sv7dy6ByI5S zp(~m))S_8PA!R^hLvR$HP68FUmk}p&TBhSP!6<~j7*BQ;c@%q*Vsp6)$+0;MZZM6n z(_Umk%L9yMyg(xa9>+KwqI^c6*3#s=!25y#=Zut(BYgrI!3J)Qk9~NnAI=h35jr;Hdg{~X3L>ONZbPSgi2s6 zk>)5i*&G$S3E0R@z(ua5R)c{-R5RGBuz>POC0q=~PuvVre3Wdcr$Y{ahc;pCC5S?s zi)f}zR0wS%4^`br$>CKrmR=U$avLq=WjAd;0Bb*-Q{M=ANvob((TgO)}hG_zhbjZAhAkI^mn zB6lz2ZX-Ahqv@rH|2?K`B>bf>{8)X;;aMU{0@ZBECQV?Y)i$Vu1wZs7c0TB`Uib9TJR|*_y1USJ04@sMzRm(ICzskY-5z z5wuA%1jRC<#E3>|fMk#)Ml!-OgWzwx$o64*)@WoboIzj&o(VSaC>%zkwUUQQ;1&iQoTRY?Ohc_TJKs>qk4Z2?|6N|(MlXGhgO@Y9IxOnMkmKJrJ{ANl_aY3 z3f<0Cfui-Ut)Qy+F@oN$YwD?%LR%+QiX*xyG*weep)E@)#iv*)^d%s$NZHak)UALL NN&*4n{GtEP{4XYRl4Ae> literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/Cre_Apt_Edda_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/Cre_Apt_Edda_1.java new file mode 100644 index 0000000..797f6ab --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/Cre_Apt_Edda_1.java @@ -0,0 +1,261 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Edda_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_edda; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE + * + * + * + * + */ + +public class Cre_Apt_Edda_1 extends TestToolkitApplet { + + private byte testCaseNb = (byte) 0x01; + private static boolean bRes; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'1'}; + + public final static byte QUALIFIER_1 = (byte)0x01; + public final static byte QUALIFIER_2 = (byte)0x02; + public static byte[] ADDRESS_VALUE = {(byte)0x81, (byte)0x55, (byte)0x66, (byte)0x77, (byte)0x88}; + public static byte[] BEARER_VALUE = {(byte)0x03, (byte)0x00}; + public static byte[] BUFFER_SIZE_VALUE = {(byte)0x00, (byte)0x0A}; + + /* Constructor of the applet */ + public Cre_Apt_Edda_1() { + + } + + + /* Method called by the JCRE at the installation of the applet */ + public static void install (byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Cre_Apt_Edda_1 thisApplet = new Cre_Apt_Edda_1(); + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + } + + + /* Method called by the UICC CAT RE */ + public void processToolkit(short event) { + + bRes=false; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler(); + + if (event==EVENT_MENU_SELECTION) { + + switch(testCaseNb) { + /* Test Case 1: Applet Registration to EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE */ + case (byte)0x01: + // 2-The applet is registered to EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE + try { + obReg.setEvent(EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE); + bRes=true; + } + catch(Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x02; + + // 3- The applet shall not be triggered by EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE + bRes=true; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x03; + break; + + case (byte)0x03: + /* 5- Open a channel with init() method + type = Open Channel + qualifier = 01 + dstDevice = TERMINAL */ + try { + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)ADDRESS_VALUE.length); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)BEARER_VALUE.length); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)BUFFER_SIZE_VALUE.length); + // 6- send() method is called + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x04; + + // 8- The applet shall not be triggered by EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE + bRes=true; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x05; + break; + + case (byte)0x05: + /* 10- Open a channel with init() method + type = Open Channel + qualifier = 01 + dstDevice = TERMINAL */ + try { + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)ADDRESS_VALUE.length); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)BEARER_VALUE.length); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)BUFFER_SIZE_VALUE.length); + + // 11- send() method is called + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x06; + break; + /* Test Case 3: Applet Deregistration to EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE */ + case (byte)0x07: + /* 1- Open a channel with init() method + type = Open Channel + qualifier = 02 + dstDevice = TERMINAL */ + try { + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_2, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)ADDRESS_VALUE.length); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)BEARER_VALUE.length); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)BUFFER_SIZE_VALUE.length); + + + + // send() method is called + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x08; + // 2- Close the opened channel unsuccessfully + try { + proHdlr.initCloseChannel((byte)0x02); + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x09; + break; + /* Test Case 5: The applet is not triggered after a reset */ + case (byte)0x0B: + /* 1- Open a channel with init() method + type = Open Channel + qualifier = 01 + dstDevice = TERMINAL */ + try { + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)ADDRESS_VALUE.length); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)BEARER_VALUE.length); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)BUFFER_SIZE_VALUE.length); + // 2- send() method is called + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0C; + // 3- isEventSet() + bRes = obReg.isEventSet(EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE); + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0D; + // 5- The applet is not triggered by EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE + bRes=true; + reportTestOutcome(testCaseNb, bRes); + break; + + } + } + + if (event==EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE) { + + switch(testCaseNb) { + /* Test Case 1: 3/8- The applet shall not be triggered by EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE */ + case (byte)0x03: + bRes=false; + testCaseNb = (byte) 0x02; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x03; + break; + case (byte)0x05: + bRes=false; + testCaseNb = (byte) 0x04; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x05; + break; + /* Test Case 2: The applet is triggered by EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE */ + case (byte)0x06 : + bRes=true; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x07; + break; + /* Test Case 3: Applet Deregistration to EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE */ + case (byte)0x09: + // 4- Close the opened channel successfully + try { + proHdlr.initCloseChannel((byte)0x02); + proHdlr.send(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0A; + /* Test Case 4: 1- The applet is not triggered by EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE */ + bRes=true; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0B; + break; + /* Test Case 4: 1- The applet shall not be triggered by EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE */ + case (byte)0x0B: + bRes=false; + testCaseNb = (byte) 0x0A; + reportTestOutcome(testCaseNb, bRes); + testCaseNb = (byte) 0x0B; + break; + /* Test Case 5: 5- The applet is not triggered by EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE */ + case (byte)0x0D: + bRes=false; + reportTestOutcome(testCaseNb, bRes); + break; + } + } + } + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/Test_Cre_Apt_Edda.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/Test_Cre_Apt_Edda.java new file mode 100644 index 0000000..f8aa56e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/Test_Cre_Apt_Edda.java @@ -0,0 +1,154 @@ +//----------------------------------------------------------------------------- +// Package Definition +// UICC CAT Runtime Environment Applet Triggering +// EVENT_EVENT_DATA_DOWNLOAD_AVAILABLE +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_edda; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Edda extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_edda"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Edda() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "03" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "02" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + //***TEST CASE 1: 1-APPLET 1 IS TRIGGERED BY EVENT_FIRST_COMMAND_AFTER_ATR, + //*** 2-APPLET 2 IS TRIGGERED BY EVENT_PROFILE_DONWLOAD + //*** 3_APPLET 3 IS NOT TRIGGERED + test.terminalProfileSession("09010020 000C0000 00000003 40"); + //***TEST CASE 1: 1-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result = response.checkSw("9000"); + + //***TEST CASE 1: 3-APPLET 1 IS NOT TRIGGERED BY EVENT_EVENT_DATA_DOWNLOAD_AVAILABLE + response = test.envelopeEventDownloadDataAvailable("38028100"); + result &= response.checkSw("9000"); + + //***TEST CASE 1: 4-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("911A"); + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + //TERMINAL RESPONSE WITH PROACTIVE UICC SESSION TERMINATED BY USER + test.terminalResponse("81030140 01820282 81830110"); + + //***TEST CASE 1: 8-APPLET 1 IS NOT TRIGGERED BY EVENT_EVENT_DATA_DOWNLOAD_AVAILABLE + response = test.envelopeEventDownloadDataAvailable("38020100"); + result &= response.checkSw("9000"); + + //***TEST CASE 1: 9-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("911A"); + //APPLET 1 BUILD A PROACTIVE COMMAND OPEN CHANNEL + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + //SUCCESSFUL TERMINAL RESPONSE + response = test.terminalResponse("81030140 01820282 81830100 38028100" + + "35020300 3902000A"); + result &= response.checkSw("9000"); + + //***TEST CASE 2: 1-APPLET 1 IS TRIGGERED BY EVENT_EVENT_DATA_DOWNLOAD_AVAILABLE + response = test.envelopeEventDownloadDataAvailable("38028100"); + result &= response.checkSw("9000"); + + //***TEST CASE 3: 1-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("911A"); + //APPLET 1 BUILD A PROACTIVE COMMAND OPEN CHANNEL + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400282 02818206 05815566" + + "77883502 03003902 000A"); + //TERMINAL RESPONSE WITH PARTIAL COMPREHENSION + response = test.terminalResponse("81030140 02820282 81830101 38028200" + + "35020300 3902000A"); + result &= response.checkSw("910B"); + //APPLET 1 BUILD A PROACTIVE COMMAND CLOSE CHANNEL + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028122"); + //UNSUCCESSFUL TERMINAL RESPONSE: TERMINAL CURRENTLY UNABLE TO PERFORM THE COMMAND + response = test.terminalResponse("81030141 00820282 81830120"); + result &= response.checkSw("9000"); + + //***TEST CASE 3: 4-APPLET 1 IS TRIGGERED BY EVENT_EVENT_DATA_DOWNLOAD_AVAILABLE + response = test.envelopeEventDownloadDataAvailable("38028200"); + result &= response.checkSw("910B"); + //APPLET 1 BUILD A PROACTIVE COMMAND CLOSE CHANNEL + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028122"); + //TERMINAL RESPONSE WITH MISSING INFORMATION + response = test.terminalResponse("81030141 00820282 81830102"); + result &= response.checkSw("9000"); + + //***TEST CASE 4: 4-APPLET 1 IS NOT TRIGGERED BY EVENT_EVENT_DATA_DOWNLOAD_AVAILABLE + response = test.envelopeEventDownloadDataAvailable("38028200"); + result &= response.checkSw("9000"); + + //***TEST CASE 5: 1-APPLET 1 IS TRIGGERED BY EVENT MENU SELECTION + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("911A"); + //APPLET 1 BUILD A PROACTIVE COMMAND OPEN CHANNEL + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + //SUCCESSFUL TERMINAL RESPONSE + response = test.terminalResponse("81030140 01820282 81830100 38028200" + + "35020300 3902000A"); + result &= response.checkSw("9000"); + test.reset(); + test.terminalProfileSession("09010020 000C0000 00000003 40"); + response = test.envelopeEventDownloadDataAvailable("38028200"); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10"+APPLET_AID_1+"0DCCCCCC CCCCCCCC CCCCCCCC CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/applet.opt new file mode 100644 index 0000000..9f11511 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_edda.Cre_Apt_Edda_1 +uicc.test.catre.cre_apt_edda +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/javacard/cre_apt_edda.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edda/javacard/cre_apt_edda.cap new file mode 100644 index 0000000000000000000000000000000000000000..fb16fcbe1fccd9c145655fd16c2ba9b92074c577 GIT binary patch literal 3814 zcmcImdvHu=6hHU5_hFNp*u+{=gdh=FN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BE;V|(_9W%qIHLR=Yg%GUA z!?2KywGHuxo^1wwFKh&LDS(?R#0rfnxK0u38lq^mR%+@QLV=jL<5O`d# zY6i0CVV6d)THWC84W!(g-hh7&{H9k zQz1-CM=m-tuMMW5>#|w~&I*El+Lk5_jn6&YxyI?Ntk4;NNnahYq zah?g0iLES{ga5Os`HHH{9h8(XQ(S~sDarb0kA%hYpHRmE{n#)vW<%>EwwJyDAD>?n2_Xc vU7}c03aK`U6#1A7IdVvX?4wB|rjxD)e&;M}GYc?Sl_s literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/Cre_Apt_Edis_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/Cre_Apt_Edis_1.java new file mode 100644 index 0000000..ba4e55b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/Cre_Apt_Edis_1.java @@ -0,0 +1,125 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Edis_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_edis; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE + * + * + * + * + * + */ + +public class Cre_Apt_Edis_1 extends TestToolkitApplet{ + + private byte testCaseNb = (byte) 0x00; + private static boolean bRes; + //private static ToolkitRegistry obReg; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'1'}; + + + + //Constructor of the applet + + public Cre_Apt_Edis_1(){ + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Edis_1 thisApplet = new Cre_Apt_Edis_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT DOWNLOAD IDLE SCREEN AVAILABLE + //obReg = ToolkitRegistry.getEntry(); + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE); + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + bRes=thisApplet.obReg.isEventSet(EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE); + } + + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + + + //event EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE + if(event==EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE){ + + switch(testCaseNb){ + + case (byte)0x00: + testCaseNb=(byte)0x01; + reportTestOutcome(testCaseNb,bRes); + //TEST CASE 2: UNREGISTER THE APPLET TO THE EVENT + testCaseNb=(byte)0x02; + try{ + //deregister to EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE + obReg.clearEvent(EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + reportTestOutcome((byte)0x03,true); + break; + case (byte)0x02: + testCaseNb=(byte)0x03; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + break; + case (byte)0x04: + //TEST CASE 5: THE APPLET MUST BE TRIGGERED + testCaseNb=(byte)0x05; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + } + } + + //event EVENT_MENU_SELECTION + if(event==EVENT_MENU_SELECTION){ + //TEST CASE 4: REGISTER THE APPLET TO THE EVENT + testCaseNb=(byte)0x04; + try{ + //Register to EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE + obReg.setEvent(EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + + } + + } + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/Test_Cre_Apt_Edis.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/Test_Cre_Apt_Edis.java new file mode 100644 index 0000000..a6b159e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/Test_Cre_Apt_Edis.java @@ -0,0 +1,79 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: UICC CAT Runtime Environment Applet Triggering +// EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_edis; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Edis extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_edis"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Edis() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09010000 41"); + //***TEST CASE 1: 1-APPLET 1 IS REGISTERED TO EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE *** + //***TEST CASE 1: 2-APPLET 1 IS TRIGGERED*** + test.envelopeEventDownloadIdleScreenAvailable(); + //***TEST CASE 2: 1-APPLET 1 IS NOT TRIGGERED*** + test.envelopeEventDownloadIdleScreenAvailable(); + //***TEST CASE 2: 1 IS REGISTERED TO EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE *** + test.envelopeMenuSelection("100101", "");//Help Request not available + //***TEST CASE 2: 2-APPLET 1 IS TRIGGERED*** + test.envelopeEventDownloadIdleScreenAvailable(); + + + // check results + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10"+APPLET_AID_1+"05CCCCCC CCCC"); + + + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/applet.opt new file mode 100644 index 0000000..0166d5d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_edis.Cre_Apt_Edis_1 +uicc.test.catre.cre_apt_edis +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/javacard/cre_apt_edis.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edis/javacard/cre_apt_edis.cap new file mode 100644 index 0000000000000000000000000000000000000000..d93d476def59867a2bf458071eb038621d181f5e GIT binary patch literal 2983 zcma)73rtg282<00y|)Fmg%&yykXQK19%_lyliIdDF7$Q>5$N!!4 z|L1(awUA+Tz~jd?Oqm2v6&0fZU3$G(08rLiA|;b zC2POTk8JuRZ~Bo9hxNHbwzBN-)R?td-k+mY?Jd@>2iYY(C)a(r;!?L`)3LCh!2CXc zq~rVrUqVTQZ`%t0d(ZpxZ+88Dv^VZRspZPGie0J4&(sf{F7c<-ef>()iMB{f-S*jo zYs$=BPV<3`OH;ek(_XJVaPZK@q7TLm?29-fe5KdsH=RzenmE}rML#d&mVM6Nkr~!6 z+F!m?`NNL9cdz6fF4TQ?@4>Ql8y@y6mguHUJ9@US{(kbE&&Q7X^W>tGS3Mh@ia!#} z_YLQ?qwSWJC$wU$&8@CTDE`Pl3w*P)0#n?A^zW3n8 z!K<0OE$4Rk?aX*{zjDXPrMGsz&Bt|L&b_VQ%nc`G7OmemaCUUZJDqP_xIVaIWZI{9 zm-cUaP_>f#MrDqyirH!{%zU zRsv`lKhOwXN%|Tw%-D~hspT|azbbSiBeEM-K7%s|ObD49skV7MWCu!!GW&rFfSS;k zH_*_?Q|d-e65m^|ZEeAz1A%i3fS0Hpom>gX|!!LaDc7Fz%z*T43;(&LuJ;JVd57blMt`b z&a2%69+;1ZVL^*^0ix8vHiKagECJOj2s0>}q5F|pn#F}K)i|==MT=9EEKYQdF({jZ zE`KuMiZt-eKo&jeiq~-Sk_?<^GdTQjo4(MvC6#wgG5`PpxkU2fHq&eKI_wsQP#ttD zkI#}kNQwdepT}gJK<-f}Rp9EqrVOMYkWW=CR8DuIHaVO%B!Vhjs*Q

-hxkNAN*+b!GyZEik+k1|^<1%h->D}tSdZ@GT)~zcAv?rsl+53+_ zW;WL94cj(t`JIm=nkx}C0!O1CJ%(eNI`YO;)EG?!bvo>JvnqR4v)!sHve~Z43sr|} zq06>J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IR%av=a;a5IrB!ae51@J&9YvDLO|#qVv>;v7h31fHElyX>f!;vtpq^ z=OZzW@jKR^CLwGr0A_A|#GfuT02=}jav6glWLNG0grofsW(6SRvUw~$h9Mk)uq6ax zO9;Z25QK9>5H^P(oXsH2hUcpTfHj05oQ^HTaLV!Hlz-0!DW`zVLzCG+HV!|mw9>T?q_FfxZ2ah?M?9Cb3bc=*u!7@J zD+oW0w9>Utp0M=kLbT?GA3$2^+DA-S`fsC_9y-86Pa3Tb?YkqaV+D3hbO2O@ULjiH z+Gj;r_?@VQhaVYQ>Dn7^So#^f(V{b5bKljf&|Y4{Dw_1ss?c0zwJNkX)3A!mQLBi& kr)o85FLz-LcW{P9=cj?IUSq8U=MoZbEXe@zOgyXoA5jj?Z2$lO literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/Cre_Tin_Prlv_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/Cre_Tin_Prlv_1.java new file mode 100644 index 0000000..3f24d93 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/Cre_Tin_Prlv_1.java @@ -0,0 +1,98 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_1; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Prlv_1 extends TestToolkitApplet +{ + + private static byte bNbInstance = (byte)0 ; // instance number + private static byte bNbInstanceTriggered = (byte)0 ; // number of times the applet is triggered + private byte bMyInstanceId ; + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_1() + { + Cre_Tin_Prlv_1.bNbInstance ++; + this.bMyInstanceId = bNbInstance; + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Prlv_1 thisApplet = new Cre_Tin_Prlv_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + bNbInstanceTriggered ++ ; + switch (bMyInstanceId) { + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 2 + // ----------------------------------------------------------------- + + case (byte)1: + if ( bNbInstanceTriggered == (byte)2 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)2: + if ( bNbInstanceTriggered == (byte)1 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + default: + reportTestOutcome ((byte)1, false); + break; + + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/Test_Cre_Tin_Prlv_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/Test_Cre_Tin_Prlv_1.java new file mode 100644 index 0000000..f2b7010 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/Test_Cre_Tin_Prlv_1.java @@ -0,0 +1,103 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_1; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_1 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_1"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50010202"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_1() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01" + "CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/applet.opt new file mode 100644 index 0000000..3754f0d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_prlv_1.Cre_Tin_Prlv_1 +uicc.test.catre.cre_tin_prlv_1 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/javacard/cre_tin_prlv_1.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_1/javacard/cre_tin_prlv_1.cap new file mode 100644 index 0000000000000000000000000000000000000000..fc0363bfa6298b32774cf48deb31d65f9336455f GIT binary patch literal 3782 zcmb7G3s6*L6h8N{PY_pJV3W7_Kn<290TCbZZsp-38Om9#5R5nYVG-;Y$_q2lgy1Q+2DtY_0Fs?)*Jw#jSh?ly^UvAGQ8y+~#g$$Cap` z$6VRH?7q<&a+H7h<2QTm-8butCZyQHLd+GXb=tz(%%NBRYOanrH%d!t+vjMrU`KbARRa?g&}P3fcDt>Ys%O>U?> zw|)PSLoLT-4X2JysB=)mU{;@M;>MzS%GcR83aeUNztt4VzmCID5 zP$qo&P8vr6yvPEW@Tk<@10qLt=EIb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N!< literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/Cre_Tin_Prlv_10.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/Cre_Tin_Prlv_10.java new file mode 100644 index 0000000..24a9277 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/Cre_Tin_Prlv_10.java @@ -0,0 +1,29 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_10.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_10; + + + +public class Cre_Tin_Prlv_10 +{ + + public static byte bNbInstanceTriggered = (byte)0 ; // number of times the applet is triggered + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_10() + { + + } + + +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/Test_Cre_Tin_Prlv_10.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/Test_Cre_Tin_Prlv_10.java new file mode 100644 index 0000000..93ec866 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/Test_Cre_Tin_Prlv_10.java @@ -0,0 +1,167 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_10; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_10 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_10"; + static final String CAP_FILE_PATH_A = "uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a"; + static final String CAP_FILE_PATH_B = "uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10b"; + static final String CLASS_AID_A = "A0000000 090005FF FFFFFF89 50110001"; + static final String APPLET_AID_A1 = "A0000000 090005FF FFFFFF89 50110102"; + static final String APPLET_AID_A2 = "A0000000 090005FF FFFFFF89 50110202"; + static final String CLASS_AID_B = "A0000000 090005FF FFFFFF89 50210001"; + static final String APPLET_AID_B1 = "A0000000 090005FF FFFFFF89 50210102"; + static final String APPLET_AID_B2 = "A0000000 090005FF FFFFFF89 50210202"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_10() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install packages + test.loadPackage(CAP_FILE_PATH); + test.loadPackage(CAP_FILE_PATH_A); + test.loadPackage(CAP_FILE_PATH_B); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install AppletA1 + test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A, APPLET_AID_A1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install AppletA2 + test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A, APPLET_AID_A2, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_A1); + result &= response.checkData("10" + APPLET_AID_A1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_A2); + result &= response.checkData("10" + APPLET_AID_A2 + "01" + "CC"); + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install AppletB1 + test.installApplet(CAP_FILE_PATH_B, CLASS_AID_B, APPLET_AID_B1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install AppletB2 + test.installApplet(CAP_FILE_PATH_B, CLASS_AID_B, APPLET_AID_B2, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_A1); + result &= response.checkData("10" + APPLET_AID_A1 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_A2); + result &= response.checkData("10" + APPLET_AID_A2 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_B1); + result &= response.checkData("10" + APPLET_AID_B1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_B2); + result &= response.checkData("10" + APPLET_AID_B2 + "01" + "CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_A1); + test.deleteApplet(APPLET_AID_A2); + test.deleteApplet(APPLET_AID_B1); + test.deleteApplet(APPLET_AID_B2); + test.deletePackage(CAP_FILE_PATH_B); + test.deletePackage(CAP_FILE_PATH_A); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/applet.opt new file mode 100644 index 0000000..067564a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/applet.opt @@ -0,0 +1,3 @@ +-out EXP CAP JCA +uicc.test.catre.cre_tin_prlv_10 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/Cre_Tin_Prlv_10A.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/Cre_Tin_Prlv_10A.java new file mode 100644 index 0000000..5181ee8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/Cre_Tin_Prlv_10A.java @@ -0,0 +1,152 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_10A.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_10.cre_tin_prlv_10a; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; +import uicc.test.catre.cre_tin_prlv_10.Cre_Tin_Prlv_10 ; + + + +public class Cre_Tin_Prlv_10A extends TestToolkitApplet +{ + + private static byte bNbInstance = (byte)0 ; // instance number + private byte bMyInstanceId ; + private static byte bNbCall = (byte)1; // number of triggering calls of the applet + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_10A() + { + Cre_Tin_Prlv_10A.bNbInstance ++; + this.bMyInstanceId = bNbInstance; + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance + Cre_Tin_Prlv_10A thisApplet = new Cre_Tin_Prlv_10A(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + Cre_Tin_Prlv_10.bNbInstanceTriggered ++ ; + switch (bMyInstanceId) { + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)1: + // --------------------------------------------------------- + // First call with only this package applets installed, Execution in 1st place + // --------------------------------------------------------- + switch ( bNbCall ) { + + case (byte)1: + if ( Cre_Tin_Prlv_10.bNbInstanceTriggered == (byte)1 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + // --------------------------------------------------------- + // Second call with all applets installed, Execution in 2nd place + // --------------------------------------------------------- + case (byte)2: + if ( Cre_Tin_Prlv_10.bNbInstanceTriggered == (byte)2 ) { + reportTestOutcome((byte)2, true) ; + } + else { + reportTestOutcome((byte)2, false) ; + } + break; + + default: + break; + } + break; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 2 + // ----------------------------------------------------------------- + + case (byte)2: + // --------------------------------------------------------- + // First call with only this package applets installed, Execution in 2nd place + // --------------------------------------------------------- + switch ( bNbCall ) { + + case (byte)1: + + if ( Cre_Tin_Prlv_10.bNbInstanceTriggered == (byte)2 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + + bNbCall = (byte)2 ; + Cre_Tin_Prlv_10.bNbInstanceTriggered = (byte)0 ; + + break; + + // --------------------------------------------------------- + // Second call with all applets installed, Execution in 4th place + // --------------------------------------------------------- + case (byte)2: + + if ( Cre_Tin_Prlv_10.bNbInstanceTriggered == (byte)4 ) { + reportTestOutcome((byte)2, true) ; + } + else { + reportTestOutcome((byte)2, false) ; + } + break; + + default: + break; + } + + break; + + default: + reportTestOutcome ((byte)1, false); + break; + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/applet.opt new file mode 100644 index 0000000..dbd90c8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x11:0x00:0x01 uicc.test.catre.cre_tin_prlv_10.cre_tin_prlv_10a.Cre_Tin_Prlv_10A +uicc.test.catre.cre_tin_prlv_10.cre_tin_prlv_10a +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x10:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/javacard/cre_tin_prlv_10a.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_10/cre_tin_prlv_10a/javacard/cre_tin_prlv_10a.cap new file mode 100644 index 0000000000000000000000000000000000000000..703787f16de34e66be160807741cf6e79d05ccfc GIT binary patch literal 4473 zcmbtX3s6+o8UF5LpCDNfWo1Pd2o@Z}qHT>14P<#GxC^c>wVg5sm*pZ0>+X8@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r~Zin`l1;DeVH@Z@nrs^cc(|w zBaz$xeF6!^iZau7H$T@Rj`0O76v@!hv literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/Cre_Tin_Prlv_11.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/Cre_Tin_Prlv_11.java new file mode 100644 index 0000000..34ccf59 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/Cre_Tin_Prlv_11.java @@ -0,0 +1,191 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_11.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_11; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Prlv_11 extends TestToolkitApplet +{ + + private static byte bNbInstance = (byte)0 ; // instance number + private static byte bNbInstanceTriggered = (byte)0 ; // number of times the applet is triggered + private static byte bNbCall = (byte)1 ; // number of triggering calls of the applet + private byte bMyInstanceId ; + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_11() + { + Cre_Tin_Prlv_11.bNbInstance ++; + this.bMyInstanceId = bNbInstance; + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Prlv_11 thisApplet = new Cre_Tin_Prlv_11(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + bNbInstanceTriggered ++ ; + switch (bMyInstanceId) { + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)1: + + // --------------------------------------------------------- + // For the 1st call, this instance is triggered 4th + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)4) && (bNbCall == (byte)1) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 2nd call, this instance is triggered 3th + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)3) && (bNbCall == (byte)2) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 3rd call, this instance is triggered 2nd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)2) && (bNbCall == (byte)3) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + reportTestOutcome(bNbCall, false) ; + } + } + } + + bNbCall ++ ; + bNbInstanceTriggered = (byte)0 ; + + break; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)2: + + // --------------------------------------------------------- + // For the 1st call, this instance is triggered 3rd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)3) && (bNbCall == (byte)1) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 2nd call, this instance is triggered 2nd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)2) && (bNbCall == (byte)2) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 3rd call, this instance is triggered 1st + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)1) && (bNbCall == (byte)3) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + reportTestOutcome(bNbCall, false) ; + } + } + } + + break; + + // ----------------------------------------------------------------- + // Instance 3 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)3: + // --------------------------------------------------------- + // For the 1st call, this instance is triggered 2nd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)2) && (bNbCall == (byte)1) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 2nd call, this instance is triggered 1st + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)1) && (bNbCall == (byte)2) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + reportTestOutcome(bNbCall, false) ; + } + } + + break; + + // ----------------------------------------------------------------- + // Instance 4 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)4: + // --------------------------------------------------------- + // For the 1st call, this instance is triggered 1st + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)1) && (bNbCall == (byte)1) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + reportTestOutcome(bNbCall, false) ; + } + + break; + + default: + reportTestOutcome ((byte)1, false); + break; + + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/Test_Cre_Tin_Prlv_11.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/Test_Cre_Tin_Prlv_11.java new file mode 100644 index 0000000..9211fec --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/Test_Cre_Tin_Prlv_11.java @@ -0,0 +1,188 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_11; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_11 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_11"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50010202"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50010302"; + static final String APPLET_AID_4 = "A0000000 090005FF FFFFFF89 50010402"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_11() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install packages + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet3 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_3, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet4 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_4, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_4); + result &= response.checkData("10" + APPLET_AID_4 + "01" + "CC"); + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + // delete Applet4 + test.deleteApplet(APPLET_AID_4); + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "02" + "CCCC"); + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + // delete Applet4 + test.deleteApplet(APPLET_AID_3); + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "03" + "CCCCCC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "03" + "CCCCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/applet.opt new file mode 100644 index 0000000..da5bf6b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_prlv_11.Cre_Tin_Prlv_11 +uicc.test.catre.cre_tin_prlv_11 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/javacard/cre_tin_prlv_11.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_11/javacard/cre_tin_prlv_11.cap new file mode 100644 index 0000000000000000000000000000000000000000..90c593cea2f8ff1864324af9ecb02fdf1bac85a1 GIT binary patch literal 4220 zcmb7G3s6+o8UD__cb|Z+uu)_oET9cO!Uk#{LeK$}5dnijOe{8LSuV1&?r!d0Q5dU$ zk;X@T#K$C|MNJbQGiZ$ls$a47V`D09#@ZSBNa=r;$L`)H1AFiM zbI;?R@B7a=|M|~XQ7TGS80r1AsqsOCJyu94UszRef60-PXL1kMCbPr|;}i=Ee5&SC*%}+VcZezq?fB@@ypoGYp75@z>ihZi&M#!QuCD8y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I>1%U~I}P*KVRE3MIp!VlMzT;WGP-=z0Big|c5zfOCGP`X$Yxh|wcwFFu@ z86wD~;2P^BjGpTVajE6dO2-h#nP@mdLQ+eh)r=v6B+8-Vo re initialize instance number + if (bNbInstance == (byte)5) { + bNbInstance = (byte)0; + } + + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance + Cre_Tin_Prlv_12 thisApplet = new Cre_Tin_Prlv_12(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + bNbInstanceTriggered ++ ; + switch (bMyInstanceId) { + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)1: + + // --------------------------------------------------------- + // For the 1st call, this instance is triggered 2nd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)2) && (bNbCall == (byte)1) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 2nd call, this instance is not installed + // --------------------------------------------------------- + // For the 3rd call, this instance is triggered 1st + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)1) && (bNbCall == (byte)3) ) { + reportTestOutcome((byte)(bNbCall-2), true) ; + } + else { + reportTestOutcome(bNbCall, false) ; + } + } + + break; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 2 + // ----------------------------------------------------------------- + + case (byte)2: + + // --------------------------------------------------------- + // For the 1st call, this instance is triggered 4th + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)4) && (bNbCall == (byte)1) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 2nd call, this instance is triggered 4th + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)4) && (bNbCall == (byte)2) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 3rd call, this instance is triggered 5th + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)5) && (bNbCall == (byte)3) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + reportTestOutcome(bNbCall, false) ; + } + } + } + + bNbCall ++ ; + bNbInstanceTriggered = (byte)0 ; + + break; + + // ----------------------------------------------------------------- + // Instance 3 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)3: + // --------------------------------------------------------- + // For the 1st call, this instance is triggered 1st + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)1) && (bNbCall == (byte)1) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 2nd call, this instance is triggered 1st + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)1) && (bNbCall == (byte)2) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + // --------------------------------------------------------- + // For the 3rd call, this instance is triggered 2nd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)2) && (bNbCall == (byte)3) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + reportTestOutcome(bNbCall, false) ; + } + } + } + + break; + + // ----------------------------------------------------------------- + // Instance 4 execution, Priority Level 2 + // ----------------------------------------------------------------- + + case (byte)4: + // --------------------------------------------------------- + // For the 1st call, this instance is triggered 3rd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)3) && (bNbCall == (byte)1) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + + // --------------------------------------------------------- + // For the 2nd call, this instance is triggered 3rd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)3) && (bNbCall == (byte)2) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + // --------------------------------------------------------- + // For the 3rd call, this instance is triggered 4th + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)4) && (bNbCall == (byte)3) ) { + reportTestOutcome(bNbCall, true) ; + } + else { + reportTestOutcome(bNbCall, false) ; + } + } + } + + break; + + // ----------------------------------------------------------------- + // Instance 5 execution, Priority Level 2 + // ----------------------------------------------------------------- + + case (byte)5: + // --------------------------------------------------------- + // For the 1st call, this instance is not installed + // --------------------------------------------------------- + // For the 2nd call, this instance is triggered 2nd + // --------------------------------------------------------- + + if ( (bNbInstanceTriggered == (byte)2) && (bNbCall == (byte)2) ) { + reportTestOutcome((byte)(bNbCall-1), true) ; + } + else { + + // --------------------------------------------------------- + // For the 3rd call, this instance is triggered 3rd + // --------------------------------------------------------- + if ( (bNbInstanceTriggered == (byte)3) && (bNbCall == (byte)3) ) { + reportTestOutcome((byte)(bNbCall-1), true) ; + } + else { + reportTestOutcome((byte)(bNbCall-1), false) ; + } + } + + break; + + default: + reportTestOutcome ((byte)1, false); + break; + + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/Test_Cre_Tin_Prlv_12.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/Test_Cre_Tin_Prlv_12.java new file mode 100644 index 0000000..613b4b8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/Test_Cre_Tin_Prlv_12.java @@ -0,0 +1,223 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_12; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_12 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_12"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50010202"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50010302"; + static final String APPLET_AID_4 = "A0000000 090005FF FFFFFF89 50010402"; + static final String APPLET_AID_5 = "A0000000 090005FF FFFFFF89 50010502"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_12() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + String[] menuList = new String[3]; + String[] menuIdList = new String[3]; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install packages + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet3 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_3, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet4 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_4, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_4); + result &= response.checkData("10" + APPLET_AID_4 + "01" + "CC"); + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + // delete Applet1 + test.deleteApplet(APPLET_AID_1); + + // Install Applet5 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_5, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_4); + result &= response.checkData("10" + APPLET_AID_4 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_5); + result &= response.checkData("10" + APPLET_AID_5 + "01" + "CC"); + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "03" + "CCCCCC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "03" + "CCCCCC"); + response = test.selectApplication(APPLET_AID_4); + result &= response.checkData("10" + APPLET_AID_4 + "03" + "CCCCCC"); + response = test.selectApplication(APPLET_AID_5); + result &= response.checkData("10" + APPLET_AID_5 + "02" + "CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deleteApplet(APPLET_AID_4); + test.deleteApplet(APPLET_AID_5); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/applet.opt new file mode 100644 index 0000000..55c2faf --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_prlv_12.Cre_Tin_Prlv_12 +uicc.test.catre.cre_tin_prlv_12 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/javacard/cre_tin_prlv_12.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_12/javacard/cre_tin_prlv_12.cap new file mode 100644 index 0000000000000000000000000000000000000000..ff1fb5bd5d203a67673d380f2670f565786bae45 GIT binary patch literal 4440 zcmb7H4OA4@75?7L?98$(g1RVzBtZ1|lfnWq#+XLr*RF`Jf~JuqWLXAScUd;OBLs>O z(fA*m#Gh)CimffdYCJKDX-_q^)%?^Po7Sd(VoiT6Ju$V7wl%h=DZOtOSazBm*qL+p zy}9qb``!EAefQqAmx_`FMtZNdG~J6~j|CFSiYxLnZHr5+W%-M3CB@|xS!E^vJrBI{ z{L&@svn@}5V7nc^=KW1gnSrP4E4|>yKZ?#ICnC%$o20 z+vyMPuS;LHZ~ixK#C8|d&RDSB-h0zxjLUf=@BKWlvGAe8xy7-Q4jq|eNp3RS{Q2fb zdiOMBzBy*jOx5zt3D><_H>}9sYT2-|%W?GN@^>cpwpwBIe)!fo`?bf=@SI)`V zXOH%u8T;GV^B?ZNwd2DZ4L`czt?!)Dcd+^LFP7W-Tfg$1uYE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gclcFDwMRv2NNPxqbwHlYtEv84hx2oW2V;K#an)rlwqPP~soA? zt{&vTGVG(m@2aa){b~&q;ubnQ9>`yGd0pB(h|_1RfTY#C0?1huw(_%!4xNn;Kyh&e zNSrdgvY@C{340cVH_7Bkh3zL z4#yy#R&mc2$vY()zmsN+BmW#vx$7=WBJLEV(mM?almN)P1#({wO0&k(x(r6OOd{_H zm_Rtx5vf**r*1NRD9EPXILd0{X?Qk`q)}o|r*|#^Od>6c1-c;u?jBHvy})Q82@KvF z0}4pZF(@K|>2#YikO@1oC>AXxF-2HOyk)3FIrSc+_EA(*>p}xoApkElti@`yV+)$F z6}u@g>_I1(Gr?u@T2`0-Ml-*J;*waTYsq4nM&zyoXD85xw{mUP2#k;G4LK z|KK1#WfHoWfhjmlXE7c<%)(M}lHI{(;53`b?!g;u7R$pqHlNw>CR@ms;vKe(4*UYE zU{$!p9%ml(vIh1f{=iz;)A%FX$eu+XdyYMiYiuXmi|cG3+lQO>QYKhve+U1)46l{> zzn948^Zv_lDW(CZ_^i4*EaeD`B4&oGY(0R!R1O2oB_|!}Mh(S>h{9Qqp)ZTW7_UWx z5iXMT0Q!1343JE*c+^IOt7AQYzSa!`bVdU(82tt-UpJjTD^RI z?HZQ9CmQ+TN>&e`uXDlx?@|OCwE?=SM~|YfbiycBB?=T>-J?g*7bszrE771tmMeM? hea#RCd6nYxs5fk=g0PnwXrp-vW5z~0(^F>t^*_8ih06c{ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/Cre_Tin_Prlv_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/Cre_Tin_Prlv_2.java new file mode 100644 index 0000000..19830cb --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/Cre_Tin_Prlv_2.java @@ -0,0 +1,98 @@ +//----------------------------------------------------------------------------- +// FWK_TIN_PRLV_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_2; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.*; + + + +public class Cre_Tin_Prlv_2 extends TestToolkitApplet +{ + + private static byte bNbInstance = (byte)0 ; // instance number + private static byte bNbInstanceTriggered = (byte)0 ; // number of times the applet is triggered + private byte bMyInstanceId ; + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_2() + { + Cre_Tin_Prlv_2.bNbInstance ++; + this.bMyInstanceId = bNbInstance; + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Prlv_2 thisApplet = new Cre_Tin_Prlv_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + bNbInstanceTriggered ++ ; + switch (bMyInstanceId) { + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)1: + if ( bNbInstanceTriggered == (byte)1 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 2 + // ----------------------------------------------------------------- + + case (byte)2: + if ( bNbInstanceTriggered == (byte)2 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + default: + reportTestOutcome ((byte)1, false); + break; + + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/Test_Cre_Tin_Prlv_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/Test_Cre_Tin_Prlv_2.java new file mode 100644 index 0000000..d5e617e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/Test_Cre_Tin_Prlv_2.java @@ -0,0 +1,103 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_2; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_2 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_2"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50010202"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_2() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01" + "CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/applet.opt new file mode 100644 index 0000000..e2294eb --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_prlv_2.Cre_Tin_Prlv_2 +uicc.test.catre.cre_tin_prlv_2 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/javacard/cre_tin_prlv_2.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_2/javacard/cre_tin_pr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ry2S@hplB$FUxKQW^@y< znen;=)~HKJTLH586(EmaN@+AJX$*$-Omc!oQ#)}XsDevXd%zDlL2E@p3hAv?>sS_j z)HguKGUS_xy|QP$n$BKj$G1Mzj!UyY-4uhG5y?Rb*N#@fF1VaUF3ufPQHfV1cs0mx zD8t@m>P>wSnMfoIlewx=FGdiT*F%h`!Yj!1Oy~o#GDglS*=SZ3E!U`&GL=#pN*I$j z^`?MiL`I;5t5N~yck(VDMghVX1#`&_q#3|>3Eik{RJ4wmy*9-i|YqQFPeSK|d->R+HR9Y1jkV%rFgY4Ao82ajQy$Qp&4a2u37``D{oIX!*x%D;-^ftWH zwJxC}nn91y6`3U9L*Hj%zlyid;pTh!TD`T#&U1E$n}dW7&<+@VCtR^d;P@)L^CiPw z0mTn74s%^`FuFLo;!2>#L6oD+(bWUm=lFI0TYAj683z1G-`yC>)cjs{EV)loi{hoTpl-0X1Rj zG*mYq?{#v1f2Y2{rdtt0#sxSJ@m+L3B?*c&FhM88DoBPAQh`AMJpvyUwmQlkMyDn4@EVQ*q*6FY7NyeA z6S1+uKre(+qC)|0VIa0*VGz#h1w(^QpM?oC1^qM*9UEPrM$e~7RO#428HLxE0FwK_ zVs@3`Kpq12!LlJ9?}P~#r$Yf`U|JXtddPxe1RDVsj2UB~9P)9@28B=rQ*pc$rhysX znU)fY)*^6M+4y{wLdwR_=Ve7CK~Z;_@X3s3=w~01o&MsqO0hTvPi24ktG>@ zC)|TDb=4G7cxmY%!Y_{iUMwV}_|oJp;@99+4tM*KR4yfv=5LXtEdmlrHkXn}bGAs5 phc#iinuKO>DTg$liX4n05{}O7YAKQ7)&L`FG%Ud593BkC{{bi4`4RvC literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/Cre_Tin_Prlv_5.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/Cre_Tin_Prlv_5.java new file mode 100644 index 0000000..1dadcba --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/Cre_Tin_Prlv_5.java @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_5.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_5; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Prlv_5 extends TestToolkitApplet +{ + + private static byte bNbInstance = (byte)0 ; // instance number + private static byte bNbInstanceTriggered = (byte)0 ; // number of times the applet is triggered + private byte bMyInstanceId ; + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_5() + { + Cre_Tin_Prlv_5.bNbInstance ++; + this.bMyInstanceId = bNbInstance; + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Prlv_5 thisApplet = new Cre_Tin_Prlv_5(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + bNbInstanceTriggered ++ ; + switch (bMyInstanceId) { + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)1: + if ( bNbInstanceTriggered == (byte)3 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)2: + if ( bNbInstanceTriggered == (byte)2 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + // ----------------------------------------------------------------- + // Instance 3 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)3: + if ( bNbInstanceTriggered == (byte)1 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + default: + reportTestOutcome ((byte)1, false); + break; + + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/Test_Cre_Tin_Prlv_5.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/Test_Cre_Tin_Prlv_5.java new file mode 100644 index 0000000..49cbc35 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/Test_Cre_Tin_Prlv_5.java @@ -0,0 +1,119 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_5; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_5 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_5"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50010202"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50010302"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_5() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet3 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_3, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "01" + "CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/applet.opt new file mode 100644 index 0000000..b796129 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_prlv_5.Cre_Tin_Prlv_5 +uicc.test.catre.cre_tin_prlv_5 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/javacard/cre_tin_prlv_5.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_5/javacard/cre_tin_prlv_5.cap new file mode 100644 index 0000000000000000000000000000000000000000..684bb37d4cd8410bfb34e1049059e46ab11e0908 GIT binary patch literal 3832 zcmb7GdvHu=6hHT|Pr+g(+r%b8kr3G=^(@LJ5h9Xo9?~Hq-N#LGWwX2PUa5#SuZE;S zDA6*lQB0;@ooQ(>Q-7p?=#0)VjH0NaRCR_{JBpS{&$rpQ_71vxHz)VI-{bfD&iT%F z&aq@MtRB?(`=zFOB0TfxfraeZh34^@IT@yGb53T)?1I9??2IQT01o7rC39B^o&1-)j@K<|O+m3w;w(e}cnlf%cb7M(E#F6RAt-G9&h zwP@tY&F>BRP#3>38D-ydrAAI}8$CIvZ z`lelTsQTREmF(r=w0ZAayUv$()EtO;xAAcP+?M!lwe9;B*4;UtdMss0+r{k>EvHlV zZMYu$)0vyGbzK?jt8z~cdVTBC?>iT*+jH(g=k^;_qxebzyetCq_n>CAt!adxFl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in_Prlv_6.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/Cre_Tin_Prlv_6.java new file mode 100644 index 0000000..b8973d9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/Cre_Tin_Prlv_6.java @@ -0,0 +1,102 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_6.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_6; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Prlv_6 extends TestToolkitApplet +{ + + private static byte bNbInstance = (byte)0 ; // instance number + private static byte bNbInstanceTriggered = (byte)0 ; // number of times the applet is triggered + private byte bMyInstanceId ; + + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_6() + { + Cre_Tin_Prlv_6.bNbInstance ++; + this.bMyInstanceId = bNbInstance; + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance + Cre_Tin_Prlv_6 thisApplet = new Cre_Tin_Prlv_6(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + + + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + bNbInstanceTriggered ++ ; + switch (bMyInstanceId) { + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 2 + // ----------------------------------------------------------------- + + case (byte)1: + if ( bNbInstanceTriggered == (byte)2 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)2: + if ( bNbInstanceTriggered == (byte)1 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + default: + reportTestOutcome ((byte)1, false); + break; + + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/Test_Cre_Tin_Prlv_6.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/Test_Cre_Tin_Prlv_6.java new file mode 100644 index 0000000..1558d05 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/Test_Cre_Tin_Prlv_6.java @@ -0,0 +1,105 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_6; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_6 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_6"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_6() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01" + "CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/applet.opt new file mode 100644 index 0000000..de10e67 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_prlv_6.Cre_Tin_Prlv_6 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_prlv_6.Cre_Tin_Prlv_6 +uicc.test.catre.cre_tin_prlv_6 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/javacard/cre_tin_prlv_6.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_6/javacard/cre_tin_prlv_6.cap new file mode 100644 index 0000000000000000000000000000000000000000..0c828295eda0320cafa6e32a680534f201377b04 GIT binary patch literal 3816 zcmb7G3rtgI6h8M+`T(TUsucu_LxrhSh@u8mC|KoDRt2BTVOuV6rMBhv!scU>$6OdX z)HtKlxM^IBGd>njV|-*rnKK$^+>D#kFpcpsgh;YEA6v%GU%+c`)V25K^#1)H-}j&M zpZ}a=&1F~}sPMhNta<{x@aTXA%k;vGvDx`%qa`Ch+dRFXFwtWE_dLMvL%2gApYuP}~fc1>kI+`IVeJC`n;_#xuk(`5;9tzniMo1Y$C(0=!+Mz_0rL)BJK z=AbE8Hdbe)z9Xi+AG<`?7He+VXZmb-vi;F*gZo7Kl_T2^bTz?(3F%k+86Kpie?Kc_ zPxQO#9lEYBe!R7*JnoQtOJ~uFvO66MHw?S>@Lt|u>h`3MLbuQNJl(wOVp@6GrHbav zW7nR}^}14&P2C;tU)uS|Vr#BaRXj2Bj7R~rvjA2+IgRhU$jL3$6#klq|A-``RPhdn zQRKX$(P0w>&gc-hVv%3zT*T zLa0H}jn5}mY{$GF&wnp`==A0|TttMp)a%zud&%Mj&LO&mWn?=v#KL5hQIG_QpocY} zfguQ1N#6t-zrfHk6Ld`I?0O3ahy-JT43EdjiG-7ZQMAA66i_hOzl$ba{t8cP+2k0H ztVDug&R*(q3qEERk{FrUyAX_~lsoWar*I#ByXcR-{(JaGXtP;|bdH`rwf{C^x^7L1!Wl%!Rs!CJ z)8_RO{t!HC$gBaX8#L(YkXlPaor==bDP;;jJG=PfCY(Sd7^7P_vD{rksFdhbv{t_s z=#`*kGm2_JsmE3WELSA017^xvU=ySC(QJl3dc+z~M6H34sCr7PZK5$;E@uqUT5Uzn zN>KZjsthIF8_h{17#Gjt>{Vq%g)j_Z$ohKyVeIS2jhPtH z3o)WweGwfD()22kcNz;Z_7~!vuHeO<00#s7S0s`g07IW=f>Ob@lzY!DR2U1&Z31Vr zJ2{B%0qub?_QGYmL{2ERIbJc`7f`$qZnrGU_C*&5mt6vs2}14p_P!p_z3`_{;LFN5 zfh&QKG~UIFQ-O(3mU4rKzQ|NyLZA?Ph9KCM0bOJQ zrTy*FQZFY0Re)jq!NPydIUadY!R14XX|ZI=xJeOA&m}6;R3wZ{cxOkCxbVT#nBk->kq?V0KNu@ z04?GSrqO8$JiLKp0K+L9B#VaAFc7h^!N4GdQlUcuZXp3%{b3Bw8U#k4(6s<$xzQXdw!i5x;{?Dt*OoF26HRa2S90}zZ z6?i<6N*+1Byl|25&3Ll^ag?;3`Oki5y>E zW=QzQgTU{L5q(96oJC$mNGvAwoj?yFv#+L*!^=wt34UJ?@KPZm$CoE>3BM7qa-iFn zrE)omJbz0h9YK)Dvbmf@p0g#AMOYICs)>IFmvhMTsl+it84O2ncD3dzaBF}OH4IkZ KanAFF;{O1kVh{)b literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/Cre_Tin_Prlv_7.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/Cre_Tin_Prlv_7.java new file mode 100644 index 0000000..806972f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/Cre_Tin_Prlv_7.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_7.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_7; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Prlv_7 extends TestToolkitApplet +{ + + private static byte bNbInstance = (byte)0 ; // instance number + private static byte bNbInstanceTriggered = (byte)0 ; // number of times the applet is triggered + private byte bMyInstanceId ; + + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_7() + { + Cre_Tin_Prlv_7.bNbInstance ++; + this.bMyInstanceId = bNbInstance; + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Prlv_7 thisApplet = new Cre_Tin_Prlv_7(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + + + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + bNbInstanceTriggered ++ ; + switch (bMyInstanceId) { + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)1: + if ( bNbInstanceTriggered == (byte)2 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 1 + // ----------------------------------------------------------------- + + case (byte)2: + if ( bNbInstanceTriggered == (byte)1 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + break; + + default: + reportTestOutcome ((byte)1, false); + break; + + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/Test_Cre_Tin_Prlv_7.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/Test_Cre_Tin_Prlv_7.java new file mode 100644 index 0000000..fdc2282 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/Test_Cre_Tin_Prlv_7.java @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_7; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_7 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_7"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_7() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + String[] menuList = new String[3]; + String[] menuIdList = new String[3]; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01" + "CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/applet.opt new file mode 100644 index 0000000..cf9edf5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_prlv_7.Cre_Tin_Prlv_7 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_prlv_7.Cre_Tin_Prlv_7 +uicc.test.catre.cre_tin_prlv_7 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/javacard/cre_tin_prlv_7.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_7/javacard/cre_tin_prlv_7.cap new file mode 100644 index 0000000000000000000000000000000000000000..0d9274aa936964d24969b8c7ed253e5f750c3954 GIT binary patch literal 3817 zcmb7GdrVVj6hHSxAE4HXQcp5BKGa?@zM;l5uwvA}@T91!uS;0jO zOo&>Z|3&+nd3kr%=;_2Q#^y6=OH((*%op#9gB`xDpB!%g{a$CY83x>4dOqs1+xyz` zs`PCqkN;FJ2$gXsmtCB*wxs0hr1@X}U~SglKcat0rQ~P(B#OeO*swc;i+lIeh%56HrotoJ1!r~9c zE_xE9%i!AfwbmuZYC2*o?p-=J_h(<(=3$rrxK&uAX}7TcogdZx_2Iq;lPcZk-G{TT zT)w=2Li!HoWZlCbefP&~@YxDf>gzX7jaxziw6g#j5HAC~QaIhp7h|Ma>~N)qu{?-KPoOMttXu@k4M15wew# zx8ZU4{e(XP&lx?}M5V zNk<9Qj&{i*39ej$_XJc_kr8)jIqBM@3dQxx&s^x2wsswasUi{nh7dIM-~5;Pjs8@l@5`2 zI6XYXb%S=pn0w&zyb>=~I9x9n?hPn@=;O53<^`gQi_a?uY8pg3i=4eZ5dF-bVo_MQ zkQe!Kh?pdJ1!)Q}Nux`Fl_~{4mF9Bu8b|LRwC{==%F!dO!Z?))i@qT}gzQ88g5rX4ucrWo?bU!r-iZn0* zC&WUD!w9Lupnx8Mj|N-BCDGY>S`>O(6j?~4LsGZ^?{!}sC*H~64P$G*|2W~(ixgDGC@GXhicE1V3<|kqQQ|905gC6x6S@j=VWPxW zmKidBTNwDgF`~EVP_ihi2$>}deJ9j|$m*>rl<>;Z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(aRIcE{xR5Y~EQC5uzkR1UT8fxNa!>-@ zX%_Fb3l0xf69O9wbMVk$UZO@>1KX&=tZ2Xq9bnPXnmr`@Kj%(OXP)0oBcnQ`^t?M6zL9^L(BkKQt~X|#43jurW8na z{;#%389fP<4pPmWPEaP5nk**NtSC1Mf^8wNr6y387gtt#c@Y>3jth9#Jh2KG6Q~LL zQ%6L21h<{{dY^6wxFic|k@I!DOT-Mqv{RAF$b!t5e8|P*SOk=qaJaOxUOelfUgniS$F|R>DSBfl&XCh45(O-qew`^xj~SG zxf2hgv5h7`Dz?&rh?c@)a{Eg46VTxdzDPPNNqG*&BUCs{K&&Xpz)xZz6NcjFCRD74 zY;!)tYH_-cXg<$i2+{Pv{)=`JE$XMm=ik_lq~$Qy@_q*SSq@6vhsL8Bi-cE$!3Y%3 zkH656G&_+X?*{=XaTOYmrX>_}B2c`(ven&GV71e*m@8iU$Ay literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/javacard/cre_tin_prlv_8.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_8/javacard/cre_tin_prlv_8.cap new file mode 100644 index 0000000000000000000000000000000000000000..06cebe6140fc1efcc385fb7264ef6a979fe899da GIT binary patch literal 2929 zcmb7F4NMzl7=EumPzrO^6%;l{bY#E6ZF3tx4i_jOP^brEa}pgnu19y+we@-+ut+e@ zxW&~FHe$9(oal%o8gx1_PE5v3G|Vg(jgW{sGbOsXIF&$%g!+Cpc)QOzdf(-3@4KJp zdEe)Izvnoo(PRe;9>26UZ-pC%9ZXPJTvL!)<|<(;3tVL-#XD=VDof@^0G_L^dSZB^ zt(~3PF>z(ObIY~e;g6bn3O}_UKa*cxI&eo{zw^u9NPCDo+q?YWs+T67p84so&B?XN zdmjDca9{Q5Nn7>gf&K!1(;7DZsp}PvmOWpk^_8DElUI{6nCz|{edzl?hmMcm`+RL# z>Uhff&f&DA*UxwFYCC)X$%d^{L)l?Vm-XmT@3{>j$191mnO~O{cDV;ujPKoeY5L9d zxbV6qY}KgSwYu?H&*bf)HuGuU+daZ(6URa$;lKy8hc5QLIGTQN{O9*x_=dATemy^D zjpLEzy1^Ou7b#8e85&T=#Tdq3a@?J!1zwRwR*=OyMe@}JWN&j_4%^5#^8zos*;0{r zi*lC02N=lxZX|NeU@!nL`%2c5j7_v2kl5thUzJ@8&W z7$mqvBY+NoNK_te@*fsjmnY(F5_+Vm6qS8`H-V4G1z>D<9RX<5LZ`pWzq$lrNn~Th zs>@D=S0tfC61`D;vb@n{{qMT&=nOk7h)hBcL$%mY;m7Wm{610vwle}SW^MYJBWt}x zI1+l4DQ;P48Y?6)U|>k{RLdNjxjVEPFO%4Y5vw#sVo;E!0PX~mcOtetih?_y{E_zS zFv2rTyv?I5eYrrR3z3nc?f9|?lS9QyB;zZsmOt*Q-h|%MNJ26 z#C2FN@AI$^*Eix;hh^F)vd9BquXoj#MK_Hg*2t2_Bgm_mr#F8L(oK`^dew;N2# zJ}C%ng{~AHK=p`zQ&(v3fg^Div8HSv6i5E zF^y0AuZn+B2R`k_Gz)FRD$9E8mRPHBESNG4Py4V6e@F+s>dG`eZN@786&?7LHPa-t zAFCwA*#EI=M7c9fLi@5x(yN0+b!i%(_GT4-UI)I`sc8<{g;kCg^pseI`qz^=r#X&5 NB;j!Yle`?A{SE75Im7?} literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/Cre_Tin_Prlv_9.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/Cre_Tin_Prlv_9.java new file mode 100644 index 0000000..1cd35cb --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/Cre_Tin_Prlv_9.java @@ -0,0 +1,29 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_9.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_9; + + + +public class Cre_Tin_Prlv_9 +{ + + public static byte bNbInstanceTriggered = (byte)0 ; // number of times the applet is triggered + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_9() + { + + } + + +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/Test_Cre_Tin_Prlv_9.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/Test_Cre_Tin_Prlv_9.java new file mode 100644 index 0000000..9570eaa --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/Test_Cre_Tin_Prlv_9.java @@ -0,0 +1,114 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_9; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Prlv_9 extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_prlv_9"; + static final String CAP_FILE_PATH_A = "uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a"; + static final String CAP_FILE_PATH_B = "uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50110001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50110102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50210001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50210102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Prlv_9() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + String[] menuList = new String[3]; + String[] menuIdList = new String[3]; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install packages + test.loadPackage(CAP_FILE_PATH); + test.loadPackage(CAP_FILE_PATH_A); + test.loadPackage(CAP_FILE_PATH_B); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH_A, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // Install Applet2 + test.installApplet(CAP_FILE_PATH_B, CLASS_AID_2, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // Card Initialisation + test.reset(); + test.terminalProfileSession("09030020 21"); + + // Trigger the applets + response = test.envelopeEventDownloadUserActivity(); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01" + "CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01" + "CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH_B); + test.deletePackage(CAP_FILE_PATH_A); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/applet.opt new file mode 100644 index 0000000..d92a215 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/applet.opt @@ -0,0 +1,3 @@ +-out EXP CAP JCA +uicc.test.catre.cre_tin_prlv_9 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/Cre_Tin_Prlv_9A.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/Cre_Tin_Prlv_9A.java new file mode 100644 index 0000000..ce0f5e9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/Cre_Tin_Prlv_9A.java @@ -0,0 +1,72 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_9A.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_9.cre_tin_prlv_9a; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; +import uicc.test.catre.cre_tin_prlv_9.Cre_Tin_Prlv_9 ; + + + +public class Cre_Tin_Prlv_9A extends TestToolkitApplet +{ + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_9A() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Prlv_9A thisApplet = new Cre_Tin_Prlv_9A(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + Cre_Tin_Prlv_9.bNbInstanceTriggered ++ ; + + // ----------------------------------------------------------------- + // Instance 1 execution, Priority Level 1, Execution in 2nd place + // ----------------------------------------------------------------- + + if ( Cre_Tin_Prlv_9.bNbInstanceTriggered == (byte)2 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/applet.opt new file mode 100644 index 0000000..d3f95f1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x11:0x00:0x01 uicc.test.catre.cre_tin_prlv_9.cre_tin_prlv_9a.Cre_Tin_Prlv_9A +uicc.test.catre.cre_tin_prlv_9.cre_tin_prlv_9a +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x10:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/javacard/cre_tin_prlv_9a.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9a/javacard/cre_tin_prlv_9a.cap new file mode 100644 index 0000000000000000000000000000000000000000..f240f1d14247bba2292d3ee512ec5737434069db GIT binary patch literal 4008 zcmbtW2~ZPf6n?weT!0ubYRaM9V!;GutixE3gn%MfFkCHzHVF$vLJ~I%7VLBcY&#Xi ztL?N}MLR81+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2SL|rs5%3Dq}(zWr$3o6rHB4XH;KTASRJ)6n}SWWIZ;{ z?#60DV1uC?4-MueYLv9ltqRPF7M#!k7G6wKCAQ57h$CZ6o>UyglQEV^_23}B6@j9` zQ8Y}I*2Zk4RLuUFRGMU#iq`wO&G?G6XCnf$!GMb6a1;)SI5!EBF?V7h1>0yW z%)nMU5z$g0G@~ih(X1zUjWr3zw>vKA|fCL759As^iTkxzAQkD gDQ?yR=CgADH#*w7O}SDu9k7arKnjMd#!I&T1*eLCw*UYD literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/Cre_Tin_Prlv_9B.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/Cre_Tin_Prlv_9B.java new file mode 100644 index 0000000..9f254b5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/Cre_Tin_Prlv_9B.java @@ -0,0 +1,72 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Prlv_9B.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_prlv_9.cre_tin_prlv_9b; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; +import uicc.test.catre.cre_tin_prlv_9.Cre_Tin_Prlv_9; + + + +public class Cre_Tin_Prlv_9B extends TestToolkitApplet +{ + + /** + * Constructor of the applet + */ + public Cre_Tin_Prlv_9B() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Prlv_9B thisApplet = new Cre_Tin_Prlv_9B(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + Cre_Tin_Prlv_9.bNbInstanceTriggered ++ ; + + // ----------------------------------------------------------------- + // Instance 2 execution, Priority Level 1, Execution in 1st place + // ----------------------------------------------------------------- + + if ( Cre_Tin_Prlv_9.bNbInstanceTriggered == (byte)1 ) { + reportTestOutcome((byte)1, true) ; + } + else { + reportTestOutcome((byte)1, false) ; + } + } + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/applet.opt new file mode 100644 index 0000000..238d7d7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x21:0x00:0x01 uicc.test.catre.cre_tin_prlv_9.cre_tin_prlv_9b.Cre_Tin_Prlv_9B +uicc.test.catre.cre_tin_prlv_9.cre_tin_prlv_9b +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x20:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/javacard/cre_tin_prlv_9b.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_prlv_9/cre_tin_prlv_9b/javacard/cre_tin_prlv_9b.cap new file mode 100644 index 0000000000000000000000000000000000000000..df704e2ebdf2bef561928b52f2f2c3e90ab04cfc GIT binary patch literal 4009 zcmbtWdrVVj6hHU&mX>z~gpS9A3W)NkIGtJKV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epf9N7q(TfQ z<_-c}EFMsAHz_a)F`l^Z3wW1(z!R|mF{rrp3!qx$ciwJNL}O+@=J&`{h4G_X}EmS~|oTi&Y+P1}&->@eWqc6U2FplC2O zrme&_QELiFVkpM&!(viNtfeVwiKa+sB2XefNLyk}6)|lSlwc_IoNeehw^nxUD{-E+Tj6-5|hz=Fq2W5bK^(1-yel;o9XB^Q+DJ4>=k3-a^aNA%u|DoeLpwN_Ya>P zSw9>*pWAU~*m5M%c6g#oX*<#SN#?CFOWcWpZ!0%--0Ys5%J{H-=j`U_f!*NzYZ=^se`9m3W6jK9 zA3xZUT6gC14M+QQ?AvX@q3x#jq%TehS4V5kmX262%^zuSm)u^R?fr4aTruIDwwnV5 zr<=xq>H8+(@Vl3KCLCA3yOWjiNB6aLZf@+)gIm73GToJWuW+n)bhdxAzUunq`44K( zoh!O98n<9`zftW7tQvWx{ODZ#>Ccfitl z830@;wKXI#NnMe;*s%j=6k9OrB|&g1Vo-4kydsNEK^ChN$yXJSy$x0A&N{w<7kIha z`I^XAi*ky<2RKOoX=v%L!C(N+-iZ)VU|Pb_;==Q|$Kz>px%hJB!UlYaf_mWb@2a`v zO0p;@ez}p-F+e<|V*uE|4AIz8Rxn{s3EVnB1%Q6Ew2R)txK((ALXQLm?*#m^LYzjh zall1(B7g@tE&8^oKw1>upm+%*+@f;)zM#VU6qn!cB@Po-!((7PU z_DDf+7VAo3JE})2lAH#J_-8^olB|F`Gm>r^@Ipv%OXxbaO$5;Q%Lq@pia0|IPL@A$ z4?8kFq8lg%4Xd+!9nT zX7O47Rq=;);InSbvamL+vTVX`3Ac)zWm9J1Sszy6TXevyuFT@IW~}1>sso>~W|oBY zW0fQy`#)Tb7 MAX_SERVICE_ID ) { + bRes = false; + } + + // each timerId shall be different from each other + for(j = (short)(i+1); j < MAX_SERVICE_ID ;j++) { + if (Cre_Tin_Sval_2.serviceIdBuffer[i] == Cre_Tin_Sval_2.serviceIdBuffer[j] ) { + bRes = false; + } + } + + } + + reportTestOutcome(testCaseNb, bRes) ; + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/Test_Cre_Tin_Sval.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/Test_Cre_Tin_Sval.java new file mode 100644 index 0000000..d60697b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/Test_Cre_Tin_Sval.java @@ -0,0 +1,157 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_sval; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Sval extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_Sval"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Sval() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "09"); // V Maximum number of services + + result = response.checkSw("6A80"); + + // Select applet1 + response = test.selectApplication(APPLET_AID_1); + result &= response.getStatusWord().substring(1,3).compareTo("61") != 0; + + + /*********************************************************************/ + /** Testcase 2-4 */ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install Applet2 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "02" + // V Id of menu entry 1 + "02" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "04"); // V Maximum number of services + + result &= response.checkData("00"); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet2 + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /** Testcase 5-8 */ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install Applet3 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Id of menu entry 1 + "03" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "08"); // V Maximum number of services + result &= response.checkData("00"); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet3 + response = test.envelopeMenuSelection("100103", ""); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "03" + "CCCCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // Send an unrecognized envelope to release static field in applet 2 + // before deletion. + test.unrecognizedEnvelope(); + // delete applets and package + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/applet.opt new file mode 100644 index 0000000..2ef5c92 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_sval.Cre_Tin_Sval_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_tin_sval.Cre_Tin_Sval_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_sval.Cre_Tin_Sval_1 +uicc.test.catre.cre_tin_sval +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/javacard/cre_tin_sval.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_sval/javacard/cre_tin_sval.cap new file mode 100644 index 0000000000000000000000000000000000000000..fb34a2d97ba128c0a0f7a1bdaf5c346c64117930 GIT binary patch literal 5679 zcmb7I3vg7`8UD|`cOThok|obgLP8*hBm!9zS32xdSA3NnDNDvH4lv}3E*wl=M{c8X4!YAeW$jKZK(TeZ}gnto>=+1)#pS$5~_ zp8MbbeE;|V|GED;=e9PAQYvZj{bJkj5{mewl0?n*9p*)rmIhO^xy8~@-`-Ku-0{Dx z)|Aau5TayS#JBz6GN#lJU;c$?#}vmKmYn=XY#@0AFi%EU@5Md z(AzVQIX z!lvJhT*+%bIAQzt*efk*FYl>O`udsTb4wSl&aKSoG`x{lxBr>CC+59pyL#fjPZB?U z=wO@abo7+n*X4Y4ZK&Wasiz_dIa?&xg0ytZQ@} zzI#LamuDWDx2fh@U17!K6PLd0-nO{?!u8J|J@@n6j@{eVCTS)qSyBwUT|n{;`=XraiyoVQKKD8S^41vBf6#{YDHFc{#^2`Zq$_QEXNgZ zx1kN$Z8non_WDdVtIs2wY#zDCXLt5^hpi6NX6vxkX7%)$R>{^r*;8V(x*09I@Xqw- zf*=ty90x!gsiyJS)r$V?8=*z>c=MraAK!u@ye&q%(a125I=e@<`COiDoQgnmX&G8M zRnTUt6Y?mZ+K8B5Q-&!ll0gy`&aZgw%6Juw@fN%DX1CiR`?y7s%Ef4>88KQOEfOH= zjuwf;SaG!fPSf7MRf7g^u~V^Zal1TzDiT#FGw=^U2~2Ywf4vOEqBtZ&O2M1NqPgsG zH}-GAZQhom#g>a&m(%OBI(@A!mxBjKg(PGNqu@X#yfNMvM@h@bNNS=^^aXych8**f z*f{16k(%v9$i@@6Zk#xt0O|tQFJ-_{6Uz*Zm@fG+C_OQSjMHa_2)FA(t-dxD!~-+-%+ zlhO!zYI=V3cKSOd&{fjWSCmLsM|Dh139Nr~DSHzCCqeiOC9;!{PvP2Ne2n5oRHcv8 ztg6Q-xg^_|Bbkjk1-mIDdpAiVls6L8(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a3udeW{~APJ3-o$C0P$EM^yWqgv;n5Nk*B+nl`Y7glU!saHw}>u`PxdG z=w8}}jE>O#$mj#~2()(5KIrYIC!l+Po#QM1Q{T9S%p)`O63S-~A}x5`#`qh}xL;H=; z(OhXmd0r0Nco8!uHVD4Ru|C9xt~m23O(@SZ zVH3qzxneV+INc~sD32mx6X#+!5q&UGT2SuA!xqZ0ONh;hnVorSqY5u%2$fM!GG@q` HS^VmMm&`){ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Cre_Tin_Tarv_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Cre_Tin_Tarv_1.java new file mode 100644 index 0000000..1a67897 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Cre_Tin_Tarv_1.java @@ -0,0 +1,47 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Sval_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_tarv; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Tarv_1 extends TestToolkitApplet { + + /** + * Constructor of the applet + */ + public Cre_Tin_Tarv_1() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Cre_Tin_Tarv_1 thisApplet = new Cre_Tin_Tarv_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Cre_Tin_Tarv_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Cre_Tin_Tarv_2.java new file mode 100644 index 0000000..b7393c5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Cre_Tin_Tarv_2.java @@ -0,0 +1,47 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Sval_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_tarv; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Tarv_2 extends TestToolkitApplet { + + /** + * Constructor of the applet + */ + public Cre_Tin_Tarv_2() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Cre_Tin_Tarv_2 thisApplet = new Cre_Tin_Tarv_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Test_Cre_Tin_Tarv.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Test_Cre_Tin_Tarv.java new file mode 100644 index 0000000..674c0cb --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/Test_Cre_Tin_Tarv.java @@ -0,0 +1,119 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_tarv; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Tarv extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_tarv"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Tarv() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + // Install package + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet2 with TAR "020202é + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800B" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + // LV TAR Value(s) + "03020202" + + "00"); // V Maximum number of services + + // Check correct installation + result = response.checkSw("9000"); + result = response.checkData("00"); + + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // Install Applet1 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8013" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "02" + // V Id of menu entry 1 + "02" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + // LV TAR Value(s) + "09010101020202030303" + + "00"); // V Maximum number of services + + result &= response.checkSw("6A80"); + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Install Applet1 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800F" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "02" + // V Id of menu entry 1 + "02" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + // LV TAR Value(s) + "050101010303" + + "00"); // V Maximum number of services + + result &= response.checkSw("6A80"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/applet.opt new file mode 100644 index 0000000..2a1c9a5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_tarv.Cre_Tin_Tarv_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_tarv.Cre_Tin_Tarv_1 +uicc.test.catre.cre_tin_tarv +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/javacard/cre_tin_tarv.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tarv/javacard/cre_tin_tarv.cap new file mode 100644 index 0000000000000000000000000000000000000000..d0232f10447c9dc3c4410b1d48eebb3ac9300094 GIT binary patch literal 3834 zcmb7G4Nz276h80m|3bz;sNf(PXkJ2DHh$pSWL%(6b@$->gxCki^FAd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@dsD8qrpfOV9S@O7>;rB|tyo=QFW5p!5h z`?qgFd}1WM<;9T7IBgtTjwhK=ct8y~G_(TeE2`-lE$(bJcKCq`dw|m6cP9Wd3>zju z7)-=>q#v_RJSE(1N|f6a#NFVGGt_3)bO+I0zL6ui;s{!Gaarf~T^C18~_6e^ma+T-P(;qi z1tnk1Iw3kkaPu*r6S0ShpkYaQvD-ltnV+1Uj4n!>E2A}7NGm5uiq zOxY^F7^q~>6ROdmCzNvz8{>42`VPv-Y(!Bp6-*ibGz%OrS-$v@<$IcV;uA3?F^#bn z(s(IcnTg^^g@sXr35+$G#s~5ivyhxwlH3Z+L?vE<-~pc4uca~1Ne31M@+}LZ;92k@ zH#8n&Qr9u%eQ~@VErHCb{( z*+#O>@coU2jtT%9PxRim4$gih+J*+kKP7}l5ob(c3pfQs9b-Yyv^rNYSN|MLBGY|A zz(~=hazsEsE*pKU5{-!yDTh>b2pqAPG4eJbWlV!e!KI=?06#1nT#y)2bg3{9&==!L zl;^rcCP*oy+CZQbVX&_K|qE?g_g;*#^8Khrnf#LR3FpPe)%_bF20xZLx Mz~Clsbm^-90M!8lng9R* literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_1.java new file mode 100644 index 0000000..b592b7b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_1.java @@ -0,0 +1,46 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Tmal_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_tmal ; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Tmal_1 extends TestToolkitApplet { + + /** + * Constructor of the applet + */ + public Cre_Tin_Tmal_1() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + // Create a new applet instance + Cre_Tin_Tmal_1 thisApplet = new Cre_Tin_Tmal_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + } + + + /** + * Method called by the UIC CRE + */ + public void processToolkit(short event) { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_2.java new file mode 100644 index 0000000..8b46f8c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_2.java @@ -0,0 +1,103 @@ +//----------------------------------------------------------------------------- +// FWK_TIN_TMAL_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_tmal; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import uicc.test.util.* ; + + + +public class Cre_Tin_Tmal_2 extends TestToolkitApplet { + + // Timer ID array : initially all at '0' which is not a correct Timer ID + static byte[] timerIdBuffer ; + static byte[] menu = {(byte)'A', (byte)'p', (byte)'p', (byte)'l', (byte)'e', (byte)'t', (byte)'2'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Tmal_2() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + timerIdBuffer = new byte[8]; + + // Create a new applet instance + Cre_Tin_Tmal_2 thisApplet = new Cre_Tin_Tmal_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_MENU_SELECTION event + thisApplet.obReg.initMenuEntry(menu, (short)0, (short)menu.length, (byte)0, false, (byte) 0, (short) 0); + + // register instance with the EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent((short)EVENT_UNRECOGNIZED_ENVELOPE); + } + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb; + + if (event == EVENT_MENU_SELECTION) { + + // -------------------------------------------- + // Test Case 3 : Allocate 4 timers + testCaseNb = (byte)0x01 ; + bRes = false ; + + try { + timerIdBuffer[0] = obReg.allocateTimer(); + timerIdBuffer[1] = obReg.allocateTimer(); + timerIdBuffer[2] = obReg.allocateTimer(); + timerIdBuffer[3] = obReg.allocateTimer(); + bRes = true ; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 4 : Allocate one more timer + testCaseNb = (byte)0x02 ; + bRes = false ; + + try { + obReg.allocateTimer(); + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.NO_TIMER_AVAILABLE); + } + reportTestOutcome(testCaseNb, bRes) ; + } + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) + { + // Release referenced static buffer timerIdBuffer before deletion + timerIdBuffer = null; + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_3.java new file mode 100644 index 0000000..6aef203 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Cre_Tin_Tmal_3.java @@ -0,0 +1,121 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Tmal_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_tmal; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import uicc.test.util.* ; + + +public class Cre_Tin_Tmal_3 extends TestToolkitApplet { + + + //Timer ID value range + short MIN_TIMER_ID = 1; + short MAX_TIMER_ID = 8; + static byte[] menu = {(byte)'A', (byte)'p', (byte)'p', (byte)'l', (byte)'e', (byte)'t', (byte)'3'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Tmal_3() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Cre_Tin_Tmal_3 thisApplet = new Cre_Tin_Tmal_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register instance with the EVENT_MENU_SELECTION event + thisApplet.obReg.initMenuEntry(menu, (short)0, (short)menu.length, (byte)0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb; + + short i, j; + + if (event == EVENT_MENU_SELECTION) { + + // -------------------------------------------- + // Test Case 6 : Allocate 4 timers + testCaseNb = (byte)0x01 ; + bRes = false ; + + try { + Cre_Tin_Tmal_2.timerIdBuffer[4] = obReg.allocateTimer(); + Cre_Tin_Tmal_2.timerIdBuffer[5] = obReg.allocateTimer(); + Cre_Tin_Tmal_2.timerIdBuffer[6] = obReg.allocateTimer(); + Cre_Tin_Tmal_2.timerIdBuffer[7] = obReg.allocateTimer(); + bRes = true ; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : Allocate one more timer + testCaseNb = (byte)0x02 ; + bRes = false ; + + try { + obReg.allocateTimer(); + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.NO_TIMER_AVAILABLE); + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : each timerId shall be between 1 and 8 and shall be different from each other + testCaseNb = (byte)0x03 ; + bRes = true ; + + for(i = 0; i < MAX_TIMER_ID ;i++) { + + // each timerId shall be between 1 and 8 + if ((short)(Cre_Tin_Tmal_2.timerIdBuffer[i]) < MIN_TIMER_ID || + (short)(Cre_Tin_Tmal_2.timerIdBuffer[i]) > MAX_TIMER_ID ) { + bRes = false; + } + + // each timerId shall be different from each other + for(j = (short)(i+1); j < MAX_TIMER_ID ;j++) { + if (Cre_Tin_Tmal_2.timerIdBuffer[i] == Cre_Tin_Tmal_2.timerIdBuffer[j] ) { + bRes = false; + } + } + + } + + reportTestOutcome(testCaseNb, bRes) ; + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Test_Cre_Tin_Tmal.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Test_Cre_Tin_Tmal.java new file mode 100644 index 0000000..b363888 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/Test_Cre_Tin_Tmal.java @@ -0,0 +1,151 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_tmal; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Tmal extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_tmal"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Tmal() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "09" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + result = response.checkSw("6A80"); + + // Select applet1 + response = test.selectApplication(APPLET_AID_1); + result &= !(response.checkData("10" + APPLET_AID_1 + "00") && response.checkSw("9000")); + + + // test script + test.reset(); + test.terminalProfileSession("09030120"); + + + /*********************************************************************/ + /** Testcase 2-4 */ + /*********************************************************************/ + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "04" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "02" + // V Id of menu entry 1 + "02" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet2 + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /** Testcase 5-8 */ + /*********************************************************************/ + + // Install Applet3 + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "08" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Id of menu entry 1 + "03" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet3 + response = test.envelopeMenuSelection("100103", ""); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "02" + "CCCC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "03" + "CCCCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // Send an unrecognized envelope to release static field in applet 2 + // before deletion. + test.unrecognizedEnvelope(); + // delete applets and package + test.deleteApplet(APPLET_AID_3); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/applet.opt new file mode 100644 index 0000000..6db6b1a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_tmal.Cre_Tin_Tmal_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_tin_tmal.Cre_Tin_Tmal_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_tmal.Cre_Tin_Tmal_1 +uicc.test.catre.cre_tin_tmal +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/javacard/cre_tin_tmal.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_tmal/javacard/cre_tin_tmal.cap new file mode 100644 index 0000000000000000000000000000000000000000..f2890dc365f06b060cbe2544b60ee94847f9e449 GIT binary patch literal 5534 zcmb7I4RBP|6+ZX9w{KrIn`HA#LI@b){0UVDY!0d8(Bm#pDdE7rLm*7ys34Sy`{FbX;ou;M@7r3 z@6Qk&@8}wQaY5G2GrpPg?^898EPnjVeb1g~_cz~N_U_cJUzR$*d}?9&H=iB6^WgQa z;ri0U!@4S2NFY2k@aQ5Ko>|4K5+rR(hZKec%K5*+uq4Pw;@{Q@;oyV7K@t+UoedN4%-cv6< zbm7AX>@4$qN_Sr1t@oU-zw>zc8+SZgac<|~FM1ANJ8-tW^O?tdCr7^6e~SLH;iHLW zOZs^4tFM02yMM{=#3#q6uKDw$Z;sd8_CQic-&>mpq~}_s+n*diI{TKN9XopSSK`fq zqN3jZ51(K6?VIcEEgKIl`0kBO$1EFPK61zC`h)%XIpt{&O*oWp+mRdA7p_VF)bZV^ ztgpYzJF@3o)x?dv_x|MNSKfd5l^3!eE?D}X6CZD`T3X++Ztp}{_W{eZ>F3k3W(L=l z4(@7se$aK*Xjf@q-b=08Q=hNNU-7Wp*Z0l?+kVya^e@bddfq>`Ixuzjga5ed=TqmG zbe|bJeD>&{exJTbS#$D{zgZp~d{H~Q{hJwWYt72$=YHL~j}e_W5w#(!7Co0dt0TcX zQ#r=Js}LLr#xbM6(Gfm`OfMG6|F_i3aCSIS(AHfiX^rJ74SfdsK~E6ls|l?=&MurSU8Q ztmb%@NQ`C1`|q{yd3Ob1a7r9X(~#d6(4k0FZOp(0s1lg@5Po_XfW=|R0GGlKiN#~t zK5OdO5FT?{3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zag_x#Hd-*F7BFKgpv5ifHh_xT)h_;vdO$tSH>fAne%_*SgtPdcA~bxX-TWy+pf_`|I@zUTe03XnxEjwVO(B`j&dV^s!j+ z=9ypr&U#bnO!!k+zC2wo{IzBa zuYZ-gsr04?)b-L2B{tXeCdbuHRWv=3u2(Sxzs%-&r^)$rQx#251M5|E#_?41R5U&t lY^tH@K~BAfLn+PI5IfeHGG5~x&SWt?6v91ay?H5~{txYAv&jGe literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/Test_Cre_Uta_Adel.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/Test_Cre_Uta_Adel.java new file mode 100644 index 0000000..397bb42 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/Test_Cre_Uta_Adel.java @@ -0,0 +1,436 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_adel; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Uta_Adel extends UiccTestModel { + + static final String CAP_FILE_PATH_A = "uicc/test/catre/cre_uta_adel/cre_uta_adel_a"; + static final String CLASS_AID_A_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_A_1 = "A0000000 090005FF FFFFFF89 50010102"; + + static final String CLASS_AID_A_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_A_2 = "A0000000 090005FF FFFFFF89 50020102"; + + + static final String CAP_FILE_PATH_B = "uicc/test/catre/cre_uta_adel/cre_uta_adel_b"; + static final String CLASS_AID_B_1 = "A0000000 090005FF FFFFFF89 50110001"; + static final String APPLET_AID_B_1 = "A0000000 090005FF FFFFFF89 50110102"; + + static final String CLASS_AID_B_2 = "A0000000 090005FF FFFFFF89 50120001"; + static final String APPLET_AID_B_2 = "A0000000 090005FF FFFFFF89 50120102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Uta_Adel() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install packageA + test.loadPackage(CAP_FILE_PATH_A); + // Install packageB + test.loadPackage(CAP_FILE_PATH_B); + + + + // Install AppletA1 + test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A_1, APPLET_AID_A_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Install AppletA2 + test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A_2, APPLET_AID_A_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "02" + // V Id of menu entry 1 + "02" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Install AppletB1 + test.installApplet(CAP_FILE_PATH_B, CLASS_AID_B_1, APPLET_AID_B_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Id of menu entry 1 + "03" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + // Install AppletB2 + test.installApplet(CAP_FILE_PATH_B, CLASS_AID_B_2, APPLET_AID_B_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "04" + // V Id of menu entry 1 + "04" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + // The deletion shall fail if any object owned by the applet instance + // is referenced from an object owned by another applet instance on the card + + + // 1- Trigger AppletA1 + test.envelopeMenuSelection("100101", ""); + + // 3- Trigger AppletA2 + test.envelopeMenuSelection("100102", ""); + + // 5- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result = !response.checkSw("9000"); //response shall be different from 90 00 + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 6- Trigger AppletA1 + test.envelopeMenuSelection("100101", ""); + + // 7- Trigger AppletA2 + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + // 9- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result &= response.checkSw("9000"); + + // 10- Install AppletA1 + response = test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A_1, APPLET_AID_A_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + result &= response.checkData("00"); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 11- Trigger AppletA1 + test.envelopeMenuSelection("100101", ""); + + // 13- Trigger AppletB2 + test.envelopeMenuSelection("100104", ""); + + // 15- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result &= !response.checkSw("9000"); //response shall be different from 90 00 + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 16- Trigger AppletA1 + test.envelopeMenuSelection("100101", ""); + + // 17- Trigger AppletB2 + response = test.envelopeMenuSelection("100104", ""); + result &= response.checkSw("9000"); + + // 19- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result &= response.checkSw("9000"); + + // 20- Install AppletA1 + response = test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A_1, APPLET_AID_A_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + result &= response.checkData("00"); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + // The deletion shall failed if any object owned by the applet instance + // is referenced from a static field on any package on the card + + + // 1- Trigger AppletA1 + test.envelopeMenuSelection("100101", ""); + + // 3- Trigger AppletA2 + test.envelopeMenuSelection("100102", ""); + + // 5- Delete AppletA2 + response = test.deleteApplet(APPLET_AID_A_2); + result &= response.checkSw("9000"); + + // 6- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result &= !response.checkSw("9000"); //response shall be different from 90 00 + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 7- Trigger AppletA1 + test.envelopeMenuSelection("100101", ""); + + // 9- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result &= response.checkSw("9000"); + + // 10- Install AppletA1 + response = test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A_1, APPLET_AID_A_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + result &= response.checkData("00"); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 11- Trigger AppletA1 + test.envelopeMenuSelection("100101", ""); + + // 13- Trigger AppletB2 + test.envelopeMenuSelection("100104", ""); + + // 15- Delete AppletB2 + response = test.deleteApplet(APPLET_AID_B_2); + result &= response.checkSw("9000"); + + // 16- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result &= !response.checkSw("9000"); //response shall be different from 90 00 + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 17- Trigger AppletA1 + test.envelopeMenuSelection("100101", ""); + + // 18- Trigger AppletB1 + test.envelopeMenuSelection("100103", ""); + + //check data + response = test.selectApplication(APPLET_AID_A_1); + result &= response.checkData("10" + APPLET_AID_A_1 + + "08CCCCCC CCCCCCCC CC"); + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 20- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result &= response.checkSw("9000"); + + // 21- Install AppletA1 + response = test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A_1, APPLET_AID_A_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + result &= response.checkData("00"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + // Deletion of an active applet instance + + // 1- Delete AppletB1 + response = test.deleteApplet(APPLET_AID_B_1); + result &= response.checkSw("9000"); + + // 2- Install AppletB1 + response = test.installApplet(CAP_FILE_PATH_B, CLASS_AID_B_1, APPLET_AID_B_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Id of menu entry 1 + "03" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + result &= response.checkData("00"); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 3- Select AppletB1 on a different channel + response = test.manageChannel("00", "00");//Open channel if P1=00 P2 is reserved + response = test.selectApplication(response.getData(), APPLET_AID_B_1); + result &= response.checkData("10" + APPLET_AID_B_1 + + "00"); + result &= response.checkSw("9000"); + + // 4- Delete AppletB1 + response = test.deleteApplet(APPLET_AID_B_1); + result &= !response.checkSw("9000"); //response shall be different from 90 00 + + + // 5- Select AppletB1 + response = test.selectApplication(APPLET_AID_B_1); + result &= response.checkData("10" + APPLET_AID_B_1 + + "00"); + result &= response.checkSw("9000"); + + // 6- reset + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + // Selection of a deleted applet instance + + + + // 1- Delete AppletB1 + response = test.deleteApplet(APPLET_AID_B_1); + result &= response.checkSw("9000"); + + // 2- Select AppletB1 + response = test.selectApplication(APPLET_AID_B_1); + result &= !response.checkSw("9000"); //response shall be different from 90 00 + + // 3- Install AppletB1 + response = test.installApplet(CAP_FILE_PATH_B, CLASS_AID_B_1, APPLET_AID_B_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Id of menu entry 1 + "03" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + result &= response.checkData("00"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 5 */ + /*********************************************************************/ + // Object owned by a deleted applet can’t be accessed by other applets + + + // 1- Delete AppletA1 + response = test.deleteApplet(APPLET_AID_A_1); + result &= response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 2- Trigger AppletB1 + test.envelopeMenuSelection("100103", ""); + + response = test.selectApplication(APPLET_AID_B_1); + result &= response.checkData("10" + APPLET_AID_B_1 + + "01CC"); + + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + // delete AppletB1 + test.deleteApplet(APPLET_AID_B_1); + + test.deletePackage(CAP_FILE_PATH_B); + test.deletePackage(CAP_FILE_PATH_A); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_1.java new file mode 100644 index 0000000..d102bbf --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_1.java @@ -0,0 +1,126 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Adel_A_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_adel.cre_uta_adel_a; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; + +/** + * Test Area : uicc.catre... + * + * Applet is triggered on Install (Install) + * + * + */ + +//server applet +public class Cre_Uta_Adel_A_1 extends TestToolkitApplet implements Cre_Uta_Adel_A_3 { + + + static byte[] menuA1 = {(byte)'A', (byte)'p', (byte)'p', (byte)'l', (byte)'e', (byte)'t', (byte)'A', (byte)'1'}; + + static byte menuIdentifier; + + static byte[] appletAidA2 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, (byte)0x50, (byte)0x02, (byte)0x01, (byte)0x02}; + + static byte[] appletAidB1 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, (byte)0x50, (byte)0x11, (byte)0x01, (byte)0x02}; + + static byte[] appletAidB2 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, (byte)0x50, (byte)0x12, (byte)0x01, (byte)0x02}; + + + //as the applet is installed and deleted several times an auxiliar static array is used + //to check the applet is triggered + static byte staticBTestCaseNbA1 = (byte)0x01; + static boolean[] staticArrayTestCaseNbA1 = {(boolean) false,(boolean) false,(boolean) false,(boolean) false, + (boolean) false,(boolean) false,(boolean) false,(boolean) false}; + + + + /** + * Constructor of the applet + */ + public Cre_Uta_Adel_A_1() { + + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Cre_Uta_Adel_A_1 thisApplet = new Cre_Uta_Adel_A_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // register instance with the EVENT_MENU_SELECTION event + thisApplet.obReg.initMenuEntry(menuA1, (short)0, (short)menuA1.length, (byte)0, false, (byte) 0, (short) 0); + + } + + public byte getMenuId() { + + return(menuIdentifier); + + } + + public Shareable getShareableInterfaceObject(AID clientAID, byte parameter) { + + if ((clientAID == null) && (parameter == (byte)0x01)) { + return((Shareable) this); + } else { + if((clientAID.equals(appletAidA2, (short)0, (byte) appletAidA2.length) == true) + ||(clientAID.equals(appletAidB1, (short)0, (byte) appletAidB1.length) == true) + ||(clientAID.equals(appletAidB2, (short)0, (byte) appletAidB2.length) == true)) { + return((Shareable) this); + } else { + return(null); + } + } + } + + public void processToolkit(short event) { + + // Get the system instance of the EnvelopeHandler class + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + boolean bRes = false; + + if (event == EVENT_MENU_SELECTION) { + + if (staticBTestCaseNbA1 == 0x06) { + //It is the sixth trigger + Cre_Uta_Adel_A_2.shareInterfaceStatic = null; + + } else { + //staticBTestCaseNbA1 -> 1,2,3,4,5,7,8 + menuIdentifier = envHdlr.getItemIdentifier(); + } + + bRes = true; + } + staticArrayTestCaseNbA1[staticBTestCaseNbA1-1] = bRes; + if(staticBTestCaseNbA1 == 0x08){ + + for (byte i=0; i<8; i++){ + reportTestOutcome((byte) (i+1), staticArrayTestCaseNbA1[i]); + } + } + staticBTestCaseNbA1++; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_2.java new file mode 100644 index 0000000..cda7f8c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_2.java @@ -0,0 +1,96 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Adel_A_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_adel.cre_uta_adel_a; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; + +/** + * Test Area : uicc.catre... + * + * Applet is triggered on Install (Install) + * + * + */ + +public class Cre_Uta_Adel_A_2 extends TestToolkitApplet{ + + static byte[] menuA2 = {(byte)'A', (byte)'p', (byte)'p', (byte)'l', (byte)'e', (byte)'t', (byte)'A', (byte)'2'}; + + static byte[] appletAidA1 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, (byte)0x50, (byte)0x01, (byte)0x01, (byte)0x02}; + + AID serverAid; + + byte bTestCaseNbA2 = (byte)0x01; + + Cre_Uta_Adel_A_3 shareInterface; + + static Cre_Uta_Adel_A_3 shareInterfaceStatic; + + /** + * Constructor of the applet + */ + public Cre_Uta_Adel_A_2(){ + + serverAid = new AID(appletAidA1, (short) 0, (byte) appletAidA1.length); + + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Cre_Uta_Adel_A_2 thisApplet = new Cre_Uta_Adel_A_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(menuA2, (short)0, (short)menuA2.length, (byte)0, false, (byte) 0, (short) 0); + + } + + + public void processToolkit(short event) { + + byte menuIdA1 = (byte)0; + + if (event == EVENT_MENU_SELECTION) { + + + switch(bTestCaseNbA2){ + + case 0x01: + shareInterface = (Cre_Uta_Adel_A_3) JCSystem.getAppletShareableInterfaceObject(serverAid,(byte) 0); + menuIdA1 = shareInterface.getMenuId(); + break; + + case 0x02: + shareInterface = null; + break; + + case 0x03: + shareInterfaceStatic = (Cre_Uta_Adel_A_3) JCSystem.getAppletShareableInterfaceObject(serverAid,(byte) 0); + menuIdA1 = shareInterfaceStatic.getMenuId(); + break; + + } + bTestCaseNbA2++; + } + + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_3.java new file mode 100644 index 0000000..ed024f3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/Cre_Uta_Adel_A_3.java @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Adel_A_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_adel.cre_uta_adel_a; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; + + +public interface Cre_Uta_Adel_A_3 extends Shareable{ + + + public byte getMenuId(); + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/applet.opt new file mode 100644 index 0000000..2f85883 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_uta_adel.cre_uta_adel_a.Cre_Uta_Adel_A_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_uta_adel.cre_uta_adel_a.Cre_Uta_Adel_A_1 +uicc.test.catre.cre_uta_adel.cre_uta_adel_a +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/javacard/cre_uta_adel_a.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_adel/cre_uta_adel_a/javacard/cre_uta_adel_a.cap new file mode 100644 index 0000000000000000000000000000000000000000..12c512d977285f37d0b9c02bb4bd4ddeda1d74da GIT binary patch literal 4135 zcmbVOeNa@_6+idAyKmoqNFFQV6Ic*}Rjjhhrio@0VZ(yKm1PGgt6?In%L*&h-7KpT zmR6RHqEUlmqaAG~wI(A|TcZ+Urm^G1q}Gm^#AH%4v1#;=Mw@Y>37s@;I%(;-yI~&t zI{D|_<#0dFedl-1J@=k-yl$T6fQY}G#L5R@M#}*T4Ye)KrS+aVTZ7Y6Usv1QQr=Ma z-zxy8e%crwu9hx+UOG5Zd2Zy=j<@># z{v&5Px80tMkCu(T0Zn_VoG^$`Q zlA90x^~SPxIPu}pl@GWcdd@yxe9d7WUH#be8!x|?_a`~gRkC4ZmAGrO&R4$vft6W5 z^A27JwVWs{eMKx8y*zedu`{yhwOvoYY5)ArFE*U+*j>8h*};YGXyL!CKNdY1i`K8XcA~X)wr^+mT>Vb{)i?k0x37J>3LZW1uq*cZ9}oOv(fI0j z3XVKwzVqpvN&DaX<@5dWEtmZETAnio!EA|Yu$qFZ`iwE`6|})>%JX^ zu`bVNkB`NlyOQ(In(UXO8xOl}OO|9;^o-qbxF=S*yT%8W9dB&-VC~eI&+e@KGOum4 zYQrhr?VT_FaO}>XZCA~Vu#yE78$4aOKe4-2_Wn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94v8FILm_xv5J(Yx2!Q}30+{e0i3BX@B#}W9O|TAO z`v=^p;7BjnTL?Rz>NSMqh_GbLBUr5KCQNn<icBDx++G9GlAW3gt*b&ifE}u3%uF(qTBcX)zOIfk`_BDWtSyi;y>DLq00tQY>i&7O@s$KOt**Vm+3E zNsEXGHcTlKOj1&$h|*FZBA%CvC@Bn5MCsiwA~xbRENeqUZ+b@ok6j*KkNE4vd`Jsi GG5-PsbO0&< literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/Test_Cre_Uta_Dafs.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/Test_Cre_Uta_Dafs.java new file mode 100644 index 0000000..a9abc65 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/Test_Cre_Uta_Dafs.java @@ -0,0 +1,119 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_dafs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Uta_Dafs extends UiccTestModel { + + static final String CAP_FILE_PATH_A = "uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a"; + static final String CLASS_AID_A_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_A_1 = "A0000000 090005FF FFFFFF89 50010102"; + + + static final String CAP_FILE_PATH_B = "uicc/test/catre/cre_uta_dafs/cre_uta_dafs_b"; + static final String CLASS_AID_B_1 = "A0000000 090005FF FFFFFF89 50110001"; + static final String APPLET_AID_B_1 = "A0000000 090005FF FFFFFF89 50110102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Uta_Dafs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package A + test.loadPackage(CAP_FILE_PATH_A); + // Install package B + test.loadPackage(CAP_FILE_PATH_B); + + // Install Applet A1 + test.installApplet(CAP_FILE_PATH_A, CLASS_AID_A_1, APPLET_AID_A_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of menu entry 1 + "01" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + // Install Applet B1 + test.installApplet(CAP_FILE_PATH_B, CLASS_AID_B_1, APPLET_AID_B_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "02" + // V Position of menu entry 1 + "02" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("09010020"); + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + + + // 1- Trigger Applet1 2- AppletA1 stores the menu Id + test.envelopeMenuSelection("100101", ""); + + // 3- Send an envelope Menu Selection to trigger AppletB1 + // 4- AppletB1 uses the shareable interface of AppletA1 to retrieve the Menu Id that was + // used to trigger AppletA1 previously + test.envelopeMenuSelection("100102", ""); + + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_B_1); + result = response.checkData("10" + APPLET_AID_B_1 + + "01CC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + // delete AppletA1 and AppletB1 + test.deleteApplet(APPLET_AID_B_1); + test.deleteApplet(APPLET_AID_A_1); + test.deletePackage(CAP_FILE_PATH_B); + test.deletePackage(CAP_FILE_PATH_A); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_1.java new file mode 100644 index 0000000..6d8e5a1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_1.java @@ -0,0 +1,92 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Dafs_A_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_dafs.cre_uta_dafs_a; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; + +/** + * Test Area : uicc.catre... + * + * Applet is triggered on Install (Install) + * + * + */ + +//server applet +public class Cre_Uta_Dafs_A_1 extends TestToolkitApplet{ + + + static byte[] menuA1 = {(byte)'A', (byte)'p', (byte)'p', (byte)'l', (byte)'e', (byte)'t', (byte)'A', (byte)'1'}; + + Cre_Uta_Dafs_A_3 shareClass; + + static byte menuIdentifier; + + static byte[] appletAidB1 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, (byte)0x50, (byte)0x11, (byte)0x01, (byte)0x02}; + + + + /** + * Constructor of the applet + */ + public Cre_Uta_Dafs_A_1(){ + + shareClass = new Cre_Uta_Dafs_A_3(); + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Cre_Uta_Dafs_A_1 thisApplet = new Cre_Uta_Dafs_A_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // register instance with the EVENT_MENU_SELECTION event + thisApplet.obReg.initMenuEntry(menuA1, (short)0, (short)menuA1.length, (byte)0, false, (byte) 0, (short) 0); + + } + + + public void processToolkit(short event){ + + // Get the system instance of the EnvelopeHandler class + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + if (event == EVENT_MENU_SELECTION) { + + menuIdentifier = envHdlr.getItemIdentifier(); + + } + + } + + public Shareable getShareableInterfaceObject(AID clientAID, byte parameter) { + + if ((clientAID == null) && (parameter == (byte)0x01)) { + return((Shareable) this); + }else{ + if(clientAID.equals(appletAidB1, (short)0, (byte) appletAidB1.length) == true) { + return((Shareable) shareClass); + }else { + return(null); + } + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_2.java new file mode 100644 index 0000000..ff29464 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_2.java @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Dafs_A_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_dafs.cre_uta_dafs_a; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; + +/** + * Test Area : uicc.catre... + * + * Applet is triggered on Install (Install) + * + * + */ + +public interface Cre_Uta_Dafs_A_2 extends Shareable{ + + + public byte getMenuId(); + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_3.java new file mode 100644 index 0000000..a66bfcd --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/Cre_Uta_Dafs_A_3.java @@ -0,0 +1,28 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Dafs_A_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_dafs.cre_uta_dafs_a; + + + +public class Cre_Uta_Dafs_A_3 implements Cre_Uta_Dafs_A_2 { + + /** + * Constructor of the class + */ + public Cre_Uta_Dafs_A_3() { + } + + + public byte getMenuId() { + + return(Cre_Uta_Dafs_A_1.menuIdentifier); + + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/applet.opt new file mode 100644 index 0000000..f3eb628 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_uta_dafs.cre_uta_dafs_a.Cre_Uta_Dafs_A_1 +uicc.test.catre.cre_uta_dafs.cre_uta_dafs_a +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/javacard/cre_uta_dafs_a.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_dafs/cre_uta_dafs_a/javacard/cre_uta_dafs_a.cap new file mode 100644 index 0000000000000000000000000000000000000000..e174e8e8ef16251fcda9d3973e99145489dbd211 GIT binary patch literal 3521 zcmbVOdrVVT82`?_x9x3tRaPejVLm5Oqy?wUiEI_12W^ z6XOyb^T9Me7Tjdwj3~avXLO0nG&)_J60(G;n^UI?>^nGf?MeLSp61tk?rHD&eUI~f zziUb51s#a^8R&^04=)TI2#}VXZW^01!)!=1%}6mP&rXj{GxweaXjwPkQDxLs-%WWO zbm)3??Y3suA={3ca~bCg+D8Tq9^A-{IoW+UbLp&v>h3RoX}Z+)pd$Y6xu(upV&e(N zkk-f=eQZE;-WrG=dL-!Stz)s%>#uJKi>v=J{?Fuwo^k3g{Vy!Mx&No}^UJ%!7DU!p z93J(4+s2FADmNOAoE!Owi^y*Cb{6)mbxbVUFW$>v_j+^pzF&J)nPkGA$zkJ?ikghA z!~ZsJ-Tw85Ew@J8e>Gk288qywnTXZ%RJ$j)4k`(4*^;p-v~5@C+P9R$9&P{Dqp_Cw zAE-Wie8=g~H#YrjJP|x+QAONLzlg_*gukY~bL7(H<<3zT_5=m*Tzfxu^cBNR*X=2_ z-C|>+*?hkFbmRWiB(;9u;`C|Rx(2=KOx><&r%KOEyE5?R1H;OBKYZ}+qQ0{0wM$o& z@WoeZ+OMwvxag~Yju#ef*lpT%r(@~pSqJAP=VxfYKlJeO+a)_YvQMUFKfQRVHDg6W z&-Aw5nvRsKrB6Du=awIPvU=I?I}bcmSW;DD%Qtt*DhNQA0ARrkYWnj=Gx*1XzzyMe zNAWhIFxO@?xa}^t!De+k?FO6Eo>}O&W@cHlT|PINR>LA|k=15(W*Mg1tyy+ww9Q&T zAoRxBz8=CUfoM15erizk;i$3T+?Uz^&7md3aFt>TLKbsUuG4OFJDjDIoP*aO6rqDj zV1^0cg-FnY0iUKn+fCC=5DgY%wkrJ;2?{QA}D&PGj7ePwxc;$9t5V zvXZrRVY~jfiTDHs4W&F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x(V|Ilb;W)F(n72CeuU0XXyr7hr=zP&Fc;X)uwF1rr&g9+LE9U>XGQ z-v~Og#;73%Qb13}n4YsS^QMzAh$x>g;ocN5j*Q^$r@aZsX$TW!Dk{Y?MdhTeipuH0 ze_~`rrYEdYbXJO!xKxqNu~`{bi-P&As6SsQNKp@MFDmiGiUwX>R3s~3iSA(5qXGA}0;51NeDeTnQRxny(|pebny zmnegne6oUPekSNN7p>e9*RWhJNylk2T1q9dK`dsnE=CC}%}DE|#8`&qRTd+qo-`w^ bkrLyOT*gqvv{@Bs2p|l9yD>(CDl+>YM1zb6 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/Cre_Uta_Odel_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/Cre_Uta_Odel_1.java new file mode 100644 index 0000000..ff0b662 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/Cre_Uta_Odel_1.java @@ -0,0 +1,66 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Odel_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_odel; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; + +/** + * Test Area : uicc.catre... + * + * Applet is triggered on Install (Install) + * + * + */ + +public class Cre_Uta_Odel_1 extends TestToolkitApplet{ + + /** + * Constructor of the applet + */ + public Cre_Uta_Odel_1(){ + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + + // Create a new applet instance. + Cre_Uta_Odel_1 thisApplet = new Cre_Uta_Odel_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.setEvent(EVENT_PROFILE_DOWNLOAD); + + + + } + + + public void processToolkit(short event){ + + boolean bRes = false; + byte bTestCaseNb = (byte)1; + + if (JCSystem.isObjectDeletionSupported()){ + bRes =true; + } + reportTestOutcome(bTestCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/Test_Cre_Uta_Odel.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/Test_Cre_Uta_Odel.java new file mode 100644 index 0000000..ffec940 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/Test_Cre_Uta_Odel.java @@ -0,0 +1,76 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_odel; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Uta_Odel extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_uta_odel"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Uta_Odel() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + //Object deletion is supported + test.reset(); + test.terminalProfile("0101"); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "01CC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + // delete Applet and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/applet.opt new file mode 100644 index 0000000..4270321 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_uta_odel.Cre_Uta_Odel_1 +uicc.test.catre.cre_uta_odel +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/javacard/cre_uta_odel.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_odel/javacard/cre_uta_odel.cap new file mode 100644 index 0000000000000000000000000000000000000000..db97e5370a9f8458033f478c4116c304eea21119 GIT binary patch literal 2676 zcma)7YfKbZ82#q8%q}XcT>%%D6$qu}wV)tv0-*~+3JbUeB)(c)mQl8@EbK0zG!j8u zwLpC|mcTD!X{pv?0!3q0Xrir1ZCb3+KBQ@D3O|hPQYlT^0R1kh9rvb9=1xv#=FZGH zbH01;xmF9u>p;XKxH&x)9&0+_p)jY^oRC+PYbrDs<>ls-lqMGD&W!?mP`qXR{v=&f z%#WGVFBnHR*VoQ0uC*i;g>()bS1lQ+<>IAp<}M5OR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8K@Xx8147 zrw%4enHv0c?XxCG<)vV-ok(Cd3Qvh2y z04s)6BDtX+9U9ZU@@Y~X}9Y=j!KW-Zu7Vudb`_ESmm)5RuntRMGu8GeW`7e z&2DoS>z6ug#SV9Z-Bv+C*zK!h4=7pzl;#lX3jl5m$4)EG#mtwB?5#6VO7IRs7IU`K z?XY`X?vDvM4KpAN5epe$LbO60=zxP!1Pxl2mRJz;!`6hk$V?#HcSA)*xx+)~8HlCD zK2tzJwOB->h!=0fogWKY-$oM%WSf!uQH9IxH-m)?7AWN*)K&x({dz{BEh0-E<)V}z2O%p)M%RW)k8Oj;>T;Enec~`UA#?+>0|N@YF%3W?cm>MvfCA;i zQv<*%e1SM;$ed>C6*L7gT*bsRB_3=_qiq7t z%O~vxDys?Tgm7&HYtTl->;fiy7qHd;X$d$@KTyu;H&BA-4GBTp;4Bp z!}d_13a$g*%O>j9^O0;BtKF=t0X42vx4gd#0{s$d^J_j1`GSyd$|SyEKe2Jam{K8zCzk1s(u7aq&QZ(Uk`%B`_jn?RU1L((ZOvU_m7ws$rCYbEpdk1qS@p`{#hggkdmw zxq8~i`;=qEF^DHOdi=)LF;I_dNVsrN0qFZ&h$nM31!<^LEx6pj84v=qF*oDzzc{?&aju6X{EdeN6LPL3v6<4a zeM!^_DiI$N*}i1jpf1taOEghdGew7j@U1hsWs+|l@p#jh57DB6H@8DXl7C_X+sjY(lB3TaS827N+xXt0@-|Q=Ca5nZ9&Q?t@Z-rX}OG& v+An34R(OFi4Zj^^`6$$TDVem=3uFi7l8NiS)y&~O0R-Zu#se|xukZf>sBG%V literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/Cre_Uta_Pdel_B_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/Cre_Uta_Pdel_B_1.java new file mode 100644 index 0000000..90cc362 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/Cre_Uta_Pdel_B_1.java @@ -0,0 +1,90 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Pdel_B_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_pdel.cre_uta_pdel_b; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; +import uicc.test.catre.cre_uta_pdel.cre_uta_pdel_a.*; + + + +/** + * Test Area : uicc.catre... + * + * Applet is triggered on Install (Install) + * + * + */ + +public class Cre_Uta_Pdel_B_1 extends TestToolkitApplet{ + + static byte[] menuB1 = {(byte)'A', (byte)'p', (byte)'p', (byte)'l', (byte)'e', (byte)'t', (byte)'B', (byte)'1'}; + + static byte[] appletAidA2 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, (byte)0x50, (byte)0x01, (byte)0x01, (byte)0x02}; + + AID serverAid; + + Cre_Uta_Pdel_A_3 shareInterface; + + /** + * Constructor of the applet + */ + public Cre_Uta_Pdel_B_1() { + + serverAid = new AID(appletAidA2, (short) 0, (byte) appletAidA2.length); + + + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength){ + // Create a new applet instance. + Cre_Uta_Pdel_B_1 thisApplet = new Cre_Uta_Pdel_B_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // register instance with the EVENT_MENU_SELECTION event + thisApplet.obReg.initMenuEntry(menuB1, (short)0, (short)menuB1.length, (byte)0, false, (byte) 0, (short) 0); + + + } + + + public void processToolkit(short event) { + + boolean bRes = false; + byte bTestCaseNb = (byte)1; + byte menuIdA2 = (byte)0; + + if (event == EVENT_MENU_SELECTION) { + + shareInterface = (Cre_Uta_Pdel_A_3) JCSystem.getAppletShareableInterfaceObject(serverAid,(byte) 0); + menuIdA2 = shareInterface.getMenuId(); + + if (menuIdA2 == 0x01){ + bRes = true; + } + reportTestOutcome(bTestCaseNb, bRes); + + } + + } + +} + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/Cre_Uta_Pdel_B_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/Cre_Uta_Pdel_B_2.java new file mode 100644 index 0000000..d90d66a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/Cre_Uta_Pdel_B_2.java @@ -0,0 +1,54 @@ +//----------------------------------------------------------------------------- +// Cre_Uta_Pdel_B_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_uta_pdel.cre_uta_pdel_b; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; + +/** + * Test Area : uicc.catre... + * + * Applet is triggered on Install (Install) + * + * + */ + +public class Cre_Uta_Pdel_B_2 extends TestToolkitApplet +{ + + /** + * Constructor of the applet + */ + public Cre_Uta_Pdel_B_2(){ + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Cre_Uta_Pdel_B_2 thisApplet = new Cre_Uta_Pdel_B_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + + } + + + public void processToolkit(short event){ + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/applet.opt new file mode 100644 index 0000000..2592c33 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x12:0x00:0x01 uicc.test.catre.cre_uta_pdel.cre_uta_pdel_b.Cre_Uta_Pdel_B_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x11:0x00:0x01 uicc.test.catre.cre_uta_pdel.cre_uta_pdel_b.Cre_Uta_Pdel_B_1 +uicc.test.catre.cre_uta_pdel.cre_uta_pdel_b +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x10:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/javacard/cre_uta_pdel_b.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_uta_pdel/cre_uta_pdel_b/javacard/cre_uta_pdel_b.cap new file mode 100644 index 0000000000000000000000000000000000000000..248a6d0e9695a0246faa4e718fac8d284b39bed3 GIT binary patch literal 3384 zcmbVOeN0nV6hH5y?Q6mDK)?z^5k(Y%0uBTV+mHexAE^q=%uTGNtY~RTd2F#bl`_H< z#)s3W+jImob!J542gW&#QzTAI*l^RtWo`*FHIs>%A|})B+&WVFjQ_mX{QB-Y@1FBJ z_nvdldHOtt4FnE>AGxV?@{oaBfADhe`8zk}SKqHww(jGP zzPibIsdHBO$054w7Ama~{1yx~wPd6Zdp9{Q&tbPC0!geQ#q&e z>km1fatr)A9>%=)^`swTiyvNr!Y?ko(|td<;_mc~jlV|(@bRy8ullV$`ow@hr6#+s zmi%J)D)yg_12s+EV~cA?Vxmv&`f$pnhQQs7uD02C#evp)?b^)QGtSI@+>$aivam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<*sqm$*B4xO8~fBrVU=E5u~tQaphSTd5>6QDGJ{itDY1@h7Q_qUtMV6qi>IW06AQ X8oi6HK2L_O1Nh)?FXqEX?n?U~X{5An literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/Api_3_Hbd_Bthdbs_1.java b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/Api_3_Hbd_Bthdbs_1.java new file mode 100644 index 0000000..99aa851 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/Api_3_Hbd_Bthdbs_1.java @@ -0,0 +1,132 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.system.api_3_hbd_bthdbs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.system.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.system package, HandlerBuilder class, buildTLVHandler() method + * applet 1 + */ +public class Api_3_Hbd_Bthdbs_1 extends TestToolkitApplet { + + private byte testCaseNb = (byte) 0x00; + private static boolean bRes; + private static byte[] HandlerBuffer = {(byte)0x02, (byte)0x04, (byte)0xAA, (byte)0xBB, (byte)0x11, (byte)0x22, (byte)0x33 }; + public final static short HANDLER_CAPACITY = (short)10; + public final static short NEGATIVE_CAPACITY = (short)-10; + + + // Constructor of the applet + public Api_3_Hbd_Bthdbs_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength){ + + // Create a new applet instance + Api_3_Hbd_Bthdbs_1 thisApplet = new Api_3_Hbd_Bthdbs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + ViewHandler testObject; + + /** test case 1: Call buildTLVHandler() method with EDIT_HANDLER type */ + testCaseNb = (byte)0x01; + bRes = true; + try { + testObject = (EditHandler)HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, HANDLER_CAPACITY); + if (testObject == null) { + bRes = false; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 2: Call buildTLVHandler() method with BER_EDIT_HANDLER type */ + testCaseNb = (byte)0x02; + bRes = true; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, HANDLER_CAPACITY); + if (testObject == null) { + bRes = false; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 3: Negative capacity */ + testCaseNb = (byte)0x03; + bRes = false; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, NEGATIVE_CAPACITY); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + bRes = true; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 4: Type does not match with predefined values (3) */ + testCaseNb = (byte)0x04; + bRes = false; + try { + testObject = HandlerBuilder.buildTLVHandler((byte)3, HANDLER_CAPACITY); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + bRes = true; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 5: Type does not match with predefined values (0) */ + testCaseNb = (byte)0x05; + bRes = false; + try { + testObject = HandlerBuilder.buildTLVHandler((byte)0, HANDLER_CAPACITY); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + bRes = true; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/Test_Api_3_Hbd_Bthdbs.java b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/Test_Api_3_Hbd_Bthdbs.java new file mode 100644 index 0000000..63413f9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/Test_Api_3_Hbd_Bthdbs.java @@ -0,0 +1,73 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.system package part 4 + * Test source for HandlerBuilder class + * buildTLVHandler(byte type, short capacity) method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.system.api_3_hbd_bthdbs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_3_Hbd_Bthdbs extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/system/api_3_hbd_bthdbs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 30010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 30010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_3_Hbd_Bthdbs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // test case 1 to 5: trigger applet1 + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "05CCCC CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/applet.opt b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/applet.opt new file mode 100644 index 0000000..72d9514 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x30:0x01:0x00:0x01 uicc.test.system.api_3_hbd_bthdbs.Api_3_Hbd_Bthdbs_1 +uicc.test.system.api_3_hbd_bthdbs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x30:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/javacard/api_3_hbd_bthdbs.cap b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs/javacard/api_3_hbd_bthdbs.cap new file mode 100644 index 0000000000000000000000000000000000000000..ef89d5a4beb6d6d1a06165dfa6cf48cd3e96dfb9 GIT binary patch literal 4641 zcmb7H4Nz3q75?7axBGS%5Ku@EP!~~4{9%Fk6BU1!KLJ-DEU`w?;@joHE-dW2yP%+q z%a2L|hSEgSB-+s=?X=oB+L$(KGaXGc^=C||GgZ^1MmtU?M%$8_7&Dm(J$ILN{iclbuhrd1$vL;?pVnV~G`VDJ-+aqDb^mwYCid(9v^R6c z8=R;8!zEK}lb?+{AHAj1T$q|&5N)}bs>|(0Z0q|22Teoo%^et8b0?>4gF|y8;pm_% z_w!c{b_~zUdNJzL|I{{A)yIA|T(EK1?{|xrbE`GCsxDr>v(2{sERN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2ecA^ox@G6|xO~r*h*h@3_;n(nBKi)(O z4&pFc@mn0jMjWToPS!bzO?VHdNcU+fTgY(d2;l=4j>8@DG@d=}6&-nViOrHJW z8v8ux?-$deAH8Y+kM)POoZuqL9O3@}N(d#54?|eUGaeo+?ncBhq+W@lr0ijobCIEh z3A_?Q$<@OU3&>9+*hrYUDPS+K~-u?%-CCu9Z literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/Api_3_Hbd_Bthdbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/Api_3_Hbd_Bthdbs_Bss_1.java new file mode 100644 index 0000000..7a5cf5f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/Api_3_Hbd_Bthdbs_Bss_1.java @@ -0,0 +1,262 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.system.api_3_hbd_bthdbs_bss; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.system.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.system package, HandlerBuilder class, buildTLVHandler() method + * applet 1 + */ +public class Api_3_Hbd_Bthdbs_Bss_1 extends TestToolkitApplet { + + + private byte testCaseNb = (byte) 0x00; + private static boolean bRes; + private static byte[] HandlerBuffer = {(byte)0, (byte)1, (byte)2, (byte)3, (byte)4, (byte)5, (byte)6, (byte)7, (byte)8, (byte)9}; + private byte copyBuffer[] = new byte[HANDLER_CAPACITY] ; + public final static short HANDLER_CAPACITY = (short)10; + public final static short NEGATIVE_CAPACITY = (short)-10; + + /** + * Constructor of the applet + */ + public Api_3_Hbd_Bthdbs_Bss_1() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength){ + + // create a new applet instance + Api_3_Hbd_Bthdbs_Bss_1 thisApplet = new Api_3_Hbd_Bthdbs_Bss_1(); + + // register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // initialise the data of the test applet + thisApplet.init(); + + // registration to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + ViewHandler testObject; + EditHandler testHandler; + short length = (short)0; + short offset = (short)0; + short result = (short)0; + + + /** test case 1: Call buildTLVHandler() method with EDIT_HANDLER type */ + testCaseNb = (byte)0x01; + bRes = true; + offset = (short)0; + length = (short)0; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, HANDLER_CAPACITY, + HandlerBuffer, offset, length); + if (testObject == null) { + bRes = false; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 2: Call buildTLVHandler() method with BER_EDIT_HANDLER type */ + testCaseNb = (byte)0x02; + bRes = true; + offset = (short)0; + length = (short)0; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, HANDLER_CAPACITY, + HandlerBuffer, offset, length); + if (testObject == null) { + bRes = false; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 3: Negative capacity */ + testCaseNb = (byte)0x03; + bRes = false; + offset = (short)0; + length = (short)0; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, NEGATIVE_CAPACITY, + HandlerBuffer, offset, length); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + bRes = true; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 4: Type does not match with predefined values (0) */ + testCaseNb = (byte)0x04; + bRes = false; + offset = (short)0; + length = (short)0; + try { + testObject = HandlerBuilder.buildTLVHandler((byte)0, HANDLER_CAPACITY, HandlerBuffer, offset, length); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + bRes = true; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 5: Type does not match with predefined values (3) */ + testCaseNb = (byte)0x05; + bRes = false; + offset = (short)0; + length = (short)0; + try { + testObject = HandlerBuilder.buildTLVHandler((byte)3, HANDLER_CAPACITY, HandlerBuffer, offset, length); + } + catch (SystemException e) { + if (e.getReason() == SystemException.ILLEGAL_VALUE) { + bRes = true; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 6: Internal Buffer starts at bOffset */ + testCaseNb = (byte)0x06; + bRes = false; + offset = (short)4; + length = (short)5; + try { + testHandler = (EditHandler)HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, HANDLER_CAPACITY, + HandlerBuffer, offset, length); + // Copy the EditHandler in copyBuffer + short copyBufferOffset = (short)0 ; + short copyBufferLength = (short)testHandler.getLength() ; + testHandler.copy(copyBuffer, copyBufferOffset, copyBufferLength) ; + // Compare copyBuffer to HandlerBuffer + result = javacard.framework.Util.arrayCompare(copyBuffer, copyBufferOffset, HandlerBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 7: Buffer is null */ + testCaseNb = (byte)0x07; + bRes = false; + offset = (short)0; + length = (short)0; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, HANDLER_CAPACITY, + null, offset, length); + } + catch (NullPointerException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 8: bOffset > Buffer Length */ + testCaseNb = (byte)0x08; + bRes = false; + offset = (short)11; + length = (short)0; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, HANDLER_CAPACITY, + HandlerBuffer, offset, length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 9: bOffset < 0 */ + testCaseNb = (byte)0x09; + bRes = false; + offset = (short)-1; + length = (short)0; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, HANDLER_CAPACITY, + HandlerBuffer, offset, length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 10: bLength < 0 */ + testCaseNb = (byte)0x0A; + bRes = false; + offset = (short)0; + length = (short)-1; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, HANDLER_CAPACITY, + HandlerBuffer, offset, length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 11: bOffset+bLength > buffer length */ + testCaseNb = (byte)0x0B; + bRes = false; + offset = (short)7; + length = (short)8; + try { + testObject = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, HANDLER_CAPACITY, + HandlerBuffer, offset, length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/Test_Api_3_Hbd_Bthdbs_Bss.java b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/Test_Api_3_Hbd_Bthdbs_Bss.java new file mode 100644 index 0000000..8b40305 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/Test_Api_3_Hbd_Bthdbs_Bss.java @@ -0,0 +1,71 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.system package part 4 + * Test source for HandlerBuilder class + * buildTLVHandler(byte type, short capacity, byte[] buffer, short bOffset, short bLength) method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.system.api_3_hbd_bthdbs_bss; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Api_3_Hbd_Bthdbs_Bss extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/system/api_3_hbd_bthdbs_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 30010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 30010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_3_Hbd_Bthdbs_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // test case 1 to 11: trigger applet1 + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "0BCCCCCC CCCCCCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/applet.opt new file mode 100644 index 0000000..c51817b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x30:0x01:0x00:0x01 uicc.test.system.api_3_hbd_bthdbs_bss.Api_3_Hbd_Bthdbs_Bss_1 +uicc.test.system.api_3_hbd_bthdbs_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x30:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/javacard/api_3_hbd_bthdbs_bss.cap b/source/Annex_E_SourceCode/uicc/test/system/api_3_hbd_bthdbs_bss/javacard/api_3_hbd_bthdbs_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..777aba8ae7444616c125785574c99ef9e8c281ac GIT binary patch literal 6400 zcmbVQ34D`P693Qpa`zz6QUc{D($WKHxdgd{wzRbN;wT`8ThcbAk+cm-Do_y8f(y!x zqMQnH$RW5QD5$u&yP$$pWmOjB=7)kThvI^)0y|$0(nNGA-}jrmnRm?py_tM(=DmSg zk|G=$ey>e>>S5G*!l6J;T7Ghe%-r;(oaEfh^t2)Qi8<-F_XAr7A1|-zXxJTlx<%El zC&JBx&hAWI-}FG&l4X|`g~uJuuHMn_r%S`56ZF!%OBSd;zA)i~YhBtj4BD7+y2-hk zy$iJq)^C39V0@+-AI&^7pdj^>d1>01eN$S_o}O_b7qLI?7&~;(;vPo^g%y8#WAeu4 zU$vt?i#i^*cK_3O_Vc#AowbS2PD8-|Pjy}E2w*4rZ&ZW-2dZKY}Q_+5wEt!Z$ z4XK4O(lOnoz6sKrnCW3h4jwc(#yX~l+?uSpQd-txQ^K@?S!&IJDbck~0-ja^1KEo@ zm+xdRrsoVkpURR{58Xe&<2Fd2(Yw!|W%mC*0R{yUe1P=NHSSd$jYJN!J`k@=YWQtLmnC-#gq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u5uO%#h#To-0x!3|L+toT`s7Y^JMm0|*Z5fjB!{3@o28O%Q;{*2pVrkH~}Vy>7+ zB<71nB*gP#IVr>nv4WHXvq*%yHZb=cVcmNt`Hs;4`Mn!MS&PoI)86Zj%BN)?)jM(Y z-B<;}1YS7#V8*bw?l0=!O?CXPp8}BrFPD5sC+d&nyJ`xA3A|PE!DRF0L_HVeyJHH3 z3A_~Y!TeNz7;kFly&?((3%t+qfvxAiS3TF1>b>0wL~u>ua7fmnfOJ0DhG&T{IxF8`BWAXMOS$_Ldw=mDTS YhpT~EO1_2!hy7rD%>S#0= 256) { + bRes = true; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 3: Store the instance in a class variable */ + testCaseNb = (byte)0x02; + bRes = false; + try { + classVariable = UICCPlatform.getTheVolatileByteArray(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 4: Store the instance in an instance variable */ + testCaseNb = (byte)0x03; + bRes = false; + try { + instanceVariable = UICCPlatform.getTheVolatileByteArray(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + /** test case 5: Store the instance in an array component */ + testCaseNb = (byte)0x04; + bRes = false; + try { + arrayComponent[0] = UICCPlatform.getTheVolatileByteArray(); + } + catch (SecurityException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + } + + private short callNumber = 0; + + public void process(APDU apdu) { + + byte[] localVariable; + + if (callNumber++ == 0){ + testCaseNb = (byte)0x06; + bRes = false; + try { + localVariable = UICCPlatform.getTheVolatileByteArray(); + if (localVariable.length >= 256) { + bRes = true; + } + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + } + else + super.process(apdu); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Api_ShareableInterface.java b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Api_ShareableInterface.java new file mode 100644 index 0000000..9f27526 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Api_ShareableInterface.java @@ -0,0 +1,15 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.system.api_3_upf_gvba; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + + +public interface Api_ShareableInterface extends javacard.framework.Shareable { + + public boolean getVolByteArray(); +} diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Test_Api_3_Upf_Gvba.java b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Test_Api_3_Upf_Gvba.java new file mode 100644 index 0000000..8347cbe --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/Test_Api_3_Upf_Gvba.java @@ -0,0 +1,102 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.system package part 4 + * Test source for UICCPlatform class + * getTheVolatileByteArray() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.system.api_3_upf_gvba; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +// Interface UICCPlatform, Method getTheVolatileByteArray() + +public class Test_Api_3_Upf_Gvba extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/system/api_3_upf_gvba"; + static final String CAP_FILE_PATH2 = "uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 30010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 30010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 30110001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 30110102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_3_Upf_Gvba() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // install client package and applet for shareable test case + test.loadPackage(CAP_FILE_PATH2); + test.installApplet(CAP_FILE_PATH2, CLASS_AID_2, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // test case 1, 3 to 5: trigger applet1 + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // test case 2: select client applet. It calls applet1 shared method. + test.selectApplication(APPLET_AID_2); + result &= response.checkSw("9000"); + + // test case 1: select applet1 + response = test.selectApplication(APPLET_AID_1); + result &= response.checkSw("9000"); + + + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "06CCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH2); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/Api_GetShareableClientApplet.java b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/Api_GetShareableClientApplet.java new file mode 100644 index 0000000..f7a97b1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/Api_GetShareableClientApplet.java @@ -0,0 +1,48 @@ +// ----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.system.api_3_upf_gvba.api_3_upf_gvba2; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.test.system.api_3_upf_gvba.*; + +public class Api_GetShareableClientApplet extends javacard.framework.Applet { + + Api_ShareableInterface myShareObject; + + // Constructor of the applet + public Api_GetShareableClientApplet() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_GetShareableClientApplet thisApplet = new Api_GetShareableClientApplet(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset + 1), bArray[bOffset]); + } + + /** + * Method called by the JCRE at the selection of the applet + */ + public void process(APDU apdu) { + byte[] baServerAid = {(byte) 0xA0, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x09, (byte) 0x00, (byte) 0x05, (byte) 0xFF, + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x89, + (byte) 0x30, (byte) 0x01, (byte) 0x01, (byte) 0x02}; + + AID serverAppletAid = new AID(baServerAid, (short) 0, + (byte) baServerAid.length); + + myShareObject = (Api_ShareableInterface) JCSystem + .getAppletShareableInterfaceObject(serverAppletAid, (byte) 0x01); + myShareObject.getVolByteArray(); + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/applet.opt b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/applet.opt new file mode 100644 index 0000000..cd16a0f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x30:0x11:0x00:0x01 uicc.test.system.api_3_upf_gvba.api_3_upf_gvba2.Api_GetShareableClientApplet +uicc.test.system.api_3_upf_gvba.api_3_upf_gvba2 +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x30:0x11:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/javacard/api_3_upf_gvba2.cap b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/api_3_upf_gvba2/javacard/api_3_upf_gvba2.cap new file mode 100644 index 0000000000000000000000000000000000000000..99c8c285139cd2a62dde0dbe383ba12de7776ff9 GIT binary patch literal 4190 zcmbtWeN0nV6hH5yeJus8SX}|dp{OX*B12^&Y61BWkZRGy0kYTj)mHmu`+(ucCT>np zoQpFqEY7cOnz+c^X8d-#L}RAz4`X!3Y(||y(dnGQWeaoc+@jPzbq0E0&dGiEzIT4- z-h0luKVuQYYCwTcdtJ>qc&cfDg_3DyhLpk?dHNE=jKaKWrZQbg-oK{-J~dT(R-|f{ zjl4FcebJJneGiAld79d;r>$+aElD4sYl)$gSKc~SmAq*AutQ@KCLHzNyL<3vg>6#5 zem5eH)t{aA$$^H6C-yB>Ru~$F^l3eLeA_MC+(i2by18{##rL}W^NC)!>&(8^rJQbb zuDX4L`@)xywYjnSol5Ju#pUk5=AL%mY5sUnN5%VZ9Xd11(Ncc@>PH^R^jpc0%G^IU z9k7;O=1-h$jL-RY&6W|vZ;g-ETi;l%{(Q~E!u_j{$Tl}eocTt(VaM#YYi)H~rlw3eFsHWvyF*k3WwP62I!?{o`$Nq=+0miJ z9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8x`?LSUutp)%9 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/applet.opt b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/applet.opt new file mode 100644 index 0000000..2825160 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x30:0x01:0x00:0x01 uicc.test.system.api_3_upf_gvba.Api_3_Upf_Gvba_1 +uicc.test.system.api_3_upf_gvba +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x30:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/javacard/api_3_upf_gvba.cap b/source/Annex_E_SourceCode/uicc/test/system/api_3_upf_gvba/javacard/api_3_upf_gvba.cap new file mode 100644 index 0000000000000000000000000000000000000000..ea3c4f4078cad784b185792f8b643d70fa931cc2 GIT binary patch literal 5679 zcmb7I3vg8B6+ZvHckkWZyf(>#8$w9LA`f9V4-SM+Nsz|DYa_V4xP$avBefs>jOLWRnza^O|s-R4$0m* zcmMl8&UeoF|9c*{rc#uwWW;s3V^cm|@w1Xd%gR={7F1N1JC?bsE6U4iSJ{`9e{+`T z_`Z67Pqwx1ql(XyesSKuvvoz@w%;7E+uuBJ>AA``TsgnD-u}goZ@!wc`_r7#`l_WR z4?X|HM;)&gsofuU9DXs$?n#!d8^lY87A&khsboI?h3njl@3tM0H_Tj@cKYqY3xl>@ z;<=OO^6MY^N&XXAQ=WdiV%4!%?|5CkKTtJ$_x7fPcjeS?Q`3429+)xxna670zu5H3 ze;X?kb55LIZatb%Vr{Kyzx2Rgr#|@9pVYl~t}cJ+V0_+%J1bm|{r2pv7I}&L<$>?@ zyUzCXK0dXiIq>!1v6ugoH1Kq{`|{qWU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}Md}>>hW4U`HB0i;$Khw@9()7`6r7@_sYMcGR7RM-8 zN@~)=Yy7_Aj}eIEV2d{# zO%G@a7xKzAQSmaO3!_sV!%JeyjypUOWTz5 zH`5xD!p+_gsa)rIiws^DvcdA8{aYc8n=4lUl!yQ))CkBFk zj}{6I9|Dr*)WR?ZZ4=)^Wq6RLkFRA->FOfBC2F9dozlkDflq;xL3WkMU8g`|G=Lzf zB3a_?;h$pUxt5Vk5m$$-$c)s4QG6t9@i~c<6q(B4&XT#a0;N!Dq=g)qreFo{n~D_? z2Z^NG1`aC(EMQ1#Tait`TVtWK2O4jK(|+ayyDZ;0l*wMjVyH=JB)?V-|#nWL%XI zJ6D0nG(>oArR7Lp=OZvl0%C<3dJe00fI(|+s{=v=8oL)o+(}Xtu{YY7OARAEuuXK% z;*p-hk)CM~i;Gu>e+7yfA>JJjE``01y=VCuSFk3r>p zdK?PhOh3YjD57IEl}xZ=;m9|WD{FE7&1CHF+rFT1F6PLqMUgKr`no;FjCtocnqKhhxKZ1e>CupDa`d4`m#HQab_|Yu_9a#@Sd*TjsaxjL%@WUh*jTu0DZX} z19)RH03%U-q buffer.length + bte_handler.appendArray(buffer,(short)6,(short)0); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x03; + try{ + //-offset < 0 + bte_handler.appendArray(buffer,(short)-1,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x04; + try{ + //-length > buffer.length + bte_handler.appendArray(buffer,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x05; + try{ + //-offset + length > buffer.length + bte_handler.appendArray(buffer,(short)3,(short)3); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x06; + try{ + //- length < 0 + bte_handler.appendArray(buffer,(short)0,(short)-1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7-------------- + try { + bRes = false; + testCaseNb = (byte) 0x07; + buffer = new byte[(short)(bte_handler.getCapacity()+1)]; + try{ + //- Handler overflow exception + bte_handler.appendArray(buffer,(short)0,(short)(bte_handler.getCapacity()+1)); + } + catch(ToolkitException ex){ + if (ex.getReason()==ToolkitException.HANDLER_OVERFLOW){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8-------------- + try { + bRes = false; + testCaseNb = (byte) 0x08; + bte_handler.clear(); + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x00}; + bte_handler.appendArray(bArray,(short)0,(short)9); + //- select command details TLV (0x81) + bte_handler.findTLV((byte)0x81,(byte)0x01); + //- successfull call + buffer = new byte[]{(byte)0xFF,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB,(byte)0xFA,(byte)0xF9,(byte)0xF8}; + bte_handler.appendArray(buffer,(short)0,(short)8); + //-verify current TLV + if(bte_handler.getValueLength()==(short)3){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9-------------- + try { + bRes = false; + testCaseNb = (byte) 0x09; + //-clear the handler + bte_handler.clear(); + compareBuffer = new byte[18]; + buffer = new byte[]{(byte)0xFF,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB,(byte)0xFA,(byte)0xF9,(byte)0xF8}; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)0,(short)8); + //-successful call + bte_handler.appendArray(buffer,(short)0,(short)8); + //-call copy() method + bte_handler.copy(buffer,(short)0,(short)8); + //-compare the array + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)8)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10-------------- + try { + bRes = false; + testCaseNb = (byte) 0x0A; + //-initialize compare buffer + buffer = new byte[]{(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07}; + Util.arrayCopy(buffer,(short)2,compareBuffer,(short)8,(short)6); + //-successful call + bte_handler.appendArray(buffer,(short)2,(short)6); + //-call copy() method + buffer=new byte[14]; + bte_handler.copy(buffer,(short)0,(short)14); + //-compare the array + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)14)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11-------------- + try { + bRes = false; + testCaseNb = (byte) 0x0B; + //-initialize compare buffer + buffer = new byte[]{(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55,(byte)0x66,(byte)0x77,(byte)0x88}; + Util.arrayCopy(buffer,(short)2,compareBuffer,(short)14,(short)4); + //-successful call + bte_handler.appendArray(buffer,(short)2,(short)4); + //-call copy() method + buffer=new byte[18]; + bte_handler.copy(buffer,(short)0,(short)18); + //-compare the array + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)18)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12-------------- + try { + bRes = false; + testCaseNb = (byte) 0x0C; + bte_handler.clear(); + bArray=new byte[(short)253]; + compareBuffer = new byte[(short)253]; + buffer=new byte[253]; + for(short i=0;i<(short)253;i++){ + bArray[i]=(byte)i; + } + Util.arrayCopy(bArray,(short)0,compareBuffer,(short)0,(short)253); + bte_handler.appendArray(bArray,(short)0,(short)253); + if((short)bte_handler.getLength()==(short)253){ + bte_handler.copy(buffer,(short)0,(short)253); + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)253)==(byte)0x00){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/Test_Api_2_Bte_Apda.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/Test_Api_2_Bte_Apda.java new file mode 100644 index 0000000..a6abfa0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/Test_Api_2_Bte_Apda.java @@ -0,0 +1,81 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Apda.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_apda; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +public class Test_Api_2_Bte_Apda extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_apda"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + + /** + * + */ + public Test_Api_2_Bte_Apda(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //install the test applet + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" // V Maximum number of services + ); + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/applet.opt new file mode 100644 index 0000000..3364043 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_apda.Api_2_Bte_Apda_1 +uicc.test.toolkit.api_2_bte_apda +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/javacard/api_2_bte_apda.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_apda/javacard/api_2_bte_apda.cap new file mode 100644 index 0000000000000000000000000000000000000000..e51d6545441c83f5ecadffac9e22a290916649b0 GIT binary patch literal 4484 zcmb7H3s6+o8UD}XKK6ZqWm!RllE)-r6dyFM$~q!Sbr7V%N1Tk(b=i#gVukfln}lVp z5#>=QY9q?2l9GHtDPlC(258EaG1@i`i76l^Tg|J+5^z4gH!=DX+q z=bZb0=l{;(oPWzp7>nL^<>bv*XQll3S39c@J$9*mXR$QT{7L=qj_;wX_BOpf{^NqH zUr)}eaBbfDbMuk9wk@6xc;OHE!~fWJjtsxLWy7xN1vlW@`2~E>@z+=Vx+L`#_!TD2HKc7=@?&W8$z4Q3@_FO+%D`!5*F0Op-d6#qC z`GcolE3&TW-AuazjU6MGHvj&E`9Hnfcl257&DnmdWzOl}E()wZ_tb?q<{fWqu1gBe zJT`OgyCpr=vJc(4OQ`uJX?oEUQ+tSI{#vuK#RN{jMiA)_1qm2d4fz9NFAA zHf#LfM%Dc__k)d3(Qm#W>ssojs7H79C{9PixJ3~8_>1lB{{8ck_T9|bcXRFj?`+83 zczKuU$l3Q@OL~hlkL^Bn?#bM0f9Cet|E!%;`OdbgQ#)L}U%s_);c`)?>&-M5+#Z@IlY_4D8CxczrmZ*NuF+K&3kKd~&oxUgv5^vWycf4L=>mniC2 zd7g#!1Ry8@l;a|r^`#Swc;`_6q)fB~@)4`6{rktg(3XZB0*OUg z7z{2Cgaju8ry)851P;f?cj{W>OW#Ejfy9Vrt_arD>O>sMB!iIM=#CPl9jnCzY2#E* z##Td9iry3*42zUxobw6A?pSf})z0bs^u%P&w`lp@@XqXHWo+kPv_%2#R1d zj0U#J0Bx*+5d>vnP-W2`F#-9Zf}jWtHev&LgJ?G+DBw7g+@LWMK}QV|!FK_}qJG_D z`N1$`5EzF@Aduz0x;hbo46dRuPLZ3%R4+A9h^WLIQ4CDyTTWgqz<(Wq#8$O55L!}G zC8!i>LJBc~nWTapu7vZ*aBz?*U?pXsk*CAYkhy3t1q)e=_Tq3lc?Iol*#8#VP2mi( z7wz}4{{-6aV*e*-UqJf?+GnxW`#2Z|Poriehf z)G2AICf{Y22KJL%vkxw-W=A1n6R@|y!zN%EoPd@j^v)4_j}v-N6MD}TdcUYoW34`o z#=&XWmBCpky7X>c&4JZOj+;dC!zW>ltw<8|VI$r7LU~C;XV?S&qIpq8)>p=-=F5l=bl!*s@cn-?QOyEifUWbH5_w3sw7z zs{_mRBU#0)VX(w={P}!N&von*NQ~pTz>BkL{K!+YQXKmx%uC+v;G*Q(xSgsFg;9me z)I_6il-l(c8gEMj?Gm$4%F@LUiKfu;l$s|XtkDMRXv$2~Of4+hkV~1FI_RK1Ms(X_ zHnpj$*@9y%R%&H7bON&#_5X@Ig4?ZJb#jwA&1FqXPD|0DB`d1SVd5sQ*{h^EimX;! z>J)2=Ep@sD9}bUANw%lP>sVoXJNzMPDBwX1{f?d%sPorW2QlLlGFsr6$hLstWz8CB zM8!K=F9qV_CNLRO4op7^7*-4lI95DN@wx^n%=#nH2E}@cD{|ArFaz?i2k&CI1U_B{ zB3;VB`AviZn2acZsr~) value.length + bte_handler.appendTLV((byte)0x0D,buffer,(short)6,(short)0); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x03; + try{ + //- valueOffset < 0 + bte_handler.appendTLV((byte)0x0D,buffer,(short)-1,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x04; + try{ + //- valueOffset < 0 + bte_handler.appendTLV((byte)0x0D,buffer,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x05; + try{ + //- valueOffset + valueLength > value.length + bte_handler.appendTLV((byte)0x0D,buffer,(short)3,(short)3 ); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x06; + try{ + //- valueLength < 0 + bte_handler.appendTLV((byte)0x0D,buffer,(short)0,(short)-1 ); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x07; + buffer = new byte[(short)(bte_handler.getCapacity()-1)]; + Util.arrayFillNonAtomic(buffer,(short)0,(short)(bte_handler.getCapacity()-1),(byte)0xFF); + bte_handler.appendArray(buffer,(short)0,(short)(bte_handler.getCapacity()-1)); + buffer = new byte[254]; + try{ + //- Handler overflow exception + bte_handler.appendTLV((byte)0x0D,buffer,(short)0,(short)254); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.HANDLER_OVERFLOW){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x08; + bte_handler.clear(); + + buffer = new byte[256]; + bte_handler.appendArray(buffer,(short)0,(short)256); + try{ + //- Bad parameter exception + bte_handler.appendTLV((byte)0x0D,buffer,(short)0,(short)256); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.BAD_INPUT_PARAMETER){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x09; + //- initialize the handler + buffer=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x00}; + bte_handler.clear(); + bte_handler.appendArray(buffer,(short)0,(short)9); + //- select Command Details TLV + bte_handler.findTLV((byte)0x81,(byte)0x01); + //- successful call + buffer= new byte[]{(byte)0xFF,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB,(byte)0xFA,(byte)0xF9,(byte)0xF8}; + bte_handler.appendTLV((byte)0x04,buffer,(short)0,(short)8); + //- verify current TLV + if(bte_handler.getValueLength()==(short)3){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0A; + //- clear the handler + bte_handler.clear(); + //- successful call + buffer= new byte[]{(byte)0xFF,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB,(byte)0xFA,(byte)0xF9,(byte)0xF8}; + compareBuffer=new byte[24]; + compareBuffer[0]=(byte)0x04; + compareBuffer[1]=(byte)0x08; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)2,(short)8); + bte_handler.appendTLV((byte)0x04,buffer,(short)0,(short)8); + buffer=new byte[10]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)10); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)10)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0B; + //- successful call + buffer= new byte[]{(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07}; + compareBuffer[10]=(byte)0x85; + compareBuffer[11]=(byte)0x06; + Util.arrayCopy(buffer,(short)2,compareBuffer,(short)12,(short)6); + bte_handler.appendTLV((byte)0x85,buffer,(short)2,(short)6); + buffer=new byte[18]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)18); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)18)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0C; + //- successful call + buffer= new byte[]{(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55,(byte)0x66,(byte)0x77,(byte)0x88}; + compareBuffer[18]=(byte)0x01; + compareBuffer[19]=(byte)0x04; + Util.arrayCopy(buffer,(short)2,compareBuffer,(short)20,(short)4); + bte_handler.appendTLV((byte)0x01,buffer,(short)2,(short)4); + buffer=new byte[24]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)24); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)24)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 13 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0D; + //- clear the handler + bte_handler.clear(); + //- successful call + buffer= new byte[128]; + for (short i=0; i<(short)128;i++){ + buffer[i]=(byte)i; + } + compareBuffer=new byte[131]; + compareBuffer[0]=(byte)0x04; + compareBuffer[1]=(byte)0x81; + compareBuffer[2]=(byte)0x80; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)3,(short)128); + bte_handler.appendTLV((byte)0x04,buffer,(short)0,(short)128); + buffer=new byte[131]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)131); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)131)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 14 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0E; + //- clear the handler + bte_handler.clear(); + //- successful call + buffer= new byte[250]; + for (short i=0; i<(short)250;i++){ + buffer[i]=(byte)i; + } + compareBuffer=new byte[253]; + compareBuffer[0]=(byte)0x04; + compareBuffer[1]=(byte)0x81; + compareBuffer[2]=(byte)0xFA; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)3,(short)250); + bte_handler.appendTLV((byte)0x04,buffer,(short)0,(short)250); + buffer=new byte[253]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)253); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)253)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + + + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/Test_Api_2_Bte_Aptlb_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/Test_Api_2_Bte_Aptlb_Bss.java new file mode 100644 index 0000000..e11a2b6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/Test_Api_2_Bte_Aptlb_Bss.java @@ -0,0 +1,87 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Aptlb_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlb_bss; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Aptlb_Bss extends UiccTestModel +{ + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_aptlb_bss"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** terminal profile for this test */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** the UiccAPITestCardService */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + + /** + * + */ + public Test_Api_2_Bte_Aptlb_Bss(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" // V Maximum number of services + + ); + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "0ECCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + + + + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/applet.opt new file mode 100644 index 0000000..75a68fc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_aptlb_bss.Api_2_Bte_Aptlb_Bss_1 +uicc.test.toolkit.api_2_bte_aptlb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/javacard/api_2_bte_aptlb_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss/javacard/api_2_bte_aptlb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..02f178c805da1f26ffeec698dfaf202e431ef873 GIT binary patch literal 4972 zcmbVQ4Nz3q6+ZXp{p|k(mgNb>kWA}nEuzNQ^#_rHs8JYHj3y+~1u-HZTiB**61%J# z2rBAmw8ojlYBg=+rdly(s?oHG9UJi{#-t`qt?hI&>iCm3#wH|4&wUFl`{K{6mpSj< zbKiOA`_4HJ?mZMwVcZQW{#eVNdIpm^Jjbv(=`r|F!i=-#?a8*XLtNQvc?Xt2@fmEC;{4 zyMN)^BX$PfR*x>$0vncwx1Sy{r{RNN_WR$S!zJynY;M_fbNa*YFWO#eed7B+x={Q3 z68G2#Q+Hi#$>r(SUVx`3)|Owp{PChuOTT!2PU7Wlle*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py#{;^kf(_mf z=VD;uEY(OuDjuPXFe1d0t z=!7z9C3sLtg^_r~8;zgJI2hm6h4%SqhgZ>dLM$}hD!4@wvyd= zT}w3HHcS~YKLglsO=`;+Rb_iLN(x+^z=}UaZ~U{H+?U zsF!1ykvMZ5ZNJPg<{m2wlY<$L6DFqPG9#HgswmQd_>rRhl^Mp|N=0D?;kOfKK+(p^ z3}fzuqA>5p4`c3&%wXnbB?`6$Kd(4r%Ij%e%qZp_C5mFje+R^g675*bFy?I{3Uk#K zH;if1Fk_i_iYV4Bd)!#2eZ!1p{&N_`I)^)Aoau}G<5)aJ!oCr}hCk(4@#{{Z{U7Ch B#)$v` literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/Api_2_Bte_Aptlb_Bss_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/Api_2_Bte_Aptlb_Bss_Bss_1.java new file mode 100644 index 0000000..3ee164a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/Api_2_Bte_Aptlb_Bss_Bss_1.java @@ -0,0 +1,449 @@ +//----------------------------------------------------------------------------- +//api_2_bte_aptlb_bss_bss_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlb_bss_bss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Aptlb_Bss_Bss_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + BERTLVEditHandler bte_handler = null; + byte compareBuffer[] = null; + byte buffer1[] = null; + byte buffer2[] = null; + + /** + */ + private Api_2_Bte_Aptlb_Bss_Bss_1 () {} + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Aptlb_Bss_Bss_1 applet = new Api_2_Bte_Aptlb_Bss_Bss_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) {applet.register();} + else {applet.register(bArray, (short) (bOffset + 1), aidLen);} + //initialise the inherited test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + buffer1 = new byte[5]; + buffer2 = new byte[5]; + try{ + //- null value1 + bte_handler.appendTLV((byte)0x0D,null,(short)0,(short)5,buffer2,(short)0,(short)5); + } + catch(NullPointerException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x02; + try{ + //- null value2 + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)5,null,(short)0,(short)5); + } + catch(NullPointerException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x03; + try{ + //-value1Offset >= value1.length + bte_handler.appendTLV((byte)0x0D,buffer1,(short)5,(short)1,buffer2,(short)0,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x04; + try{ + //-value1Offset < 0 + bte_handler.appendTLV((byte)0x0D,buffer1,(short)-1,(short)1,buffer2,(short)0,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x05; + try{ + //-value1Length > value1.length + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)6,buffer2,(short)0,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x06; + try{ + //-value1Offset + value1Length > value1.length + bte_handler.appendTLV((byte)0x0D,buffer1,(short)3,(short)3,buffer2,(short)0,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + // -------------- TESTCASE 7 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x07; + try{ + //-value1Length < 0 + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)-1,buffer2,(short)0,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + // -------------- TESTCASE 8 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x08; + try{ + //-value2Offset >= value2.length + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)1,buffer2,(short)5,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x09; + try{ + //-value2Ofsset < 0 + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)1,buffer2,(short)5,(short)-1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0A; + try{ + //-value2Length > value2.length + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)1,buffer2,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0B; + try{ + //-value2Offset + value2Length > value2.length + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)1,buffer2,(short)3,(short)3); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0C; + try{ + //-value2Length <0 + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)1,buffer2,(short)0,(short)-1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 13 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0D; + buffer1=new byte[(short)(bte_handler.getCapacity()-1)]; + bte_handler.appendArray(buffer1,(short)0,(short)(bte_handler.getCapacity()-1)); + buffer1= new byte[256]; + buffer2= new byte[256]; + + try{ + //-Handler overflow exeption + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)253,buffer2,(short)0,(short)1); + } + catch(ToolkitException ex){ + if (ex.getReason()==ToolkitException.HANDLER_OVERFLOW){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 14 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0E; + bte_handler.clear(); + buffer1= new byte[256]; + buffer2= new byte[256]; + try{ + //-Bad parameter exception + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)256,buffer2,(short)0,(short)1); + } + catch(ToolkitException ex){ + if (ex.getReason()==ToolkitException.BAD_INPUT_PARAMETER){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 15 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0F; + bte_handler.clear(); + buffer1= new byte[256]; + buffer2= new byte[256]; + try{ + //-Bad parameter exception + bte_handler.appendTLV((byte)0x0D,buffer1,(short)0,(short)1,buffer2,(short)0,(short)256); + } + catch(ToolkitException ex){ + if (ex.getReason()==ToolkitException.BAD_INPUT_PARAMETER){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 16 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x10; + bte_handler.clear(); + bte_handler.appendTLV((byte)0x81,new byte[]{(byte)0x11,(byte)0x22,(byte)0x33},(short)0,(short)3); + bte_handler.appendTLV((byte)0x82,new byte[]{(byte)0x99,(byte)0x77,},(short)0,(short)2); + //-select Command details TLV + bte_handler.findTLV((byte)0x81,(byte)0x01); + //-successful call + buffer1= new byte[]{(byte)0xFF,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB,(byte)0xFA,(byte)0x09,(byte)0x08}; + buffer2= new byte[]{(byte)0xF7,(byte)0xF6,(byte)0xF5,(byte)0xF4,(byte)0xF3,(byte)0xF2,(byte)0xF1,(byte)0xF0}; + bte_handler.appendTLV((byte)0x04,buffer1,(short)0,(short)8,buffer2,(short)0,(short)8); + if(bte_handler.getValueLength()==(short)3){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 17 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x11; + bte_handler.clear(); + //-successful call + buffer1= new byte[]{(byte)0xFF,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB,(byte)0xFA,(byte)0x09,(byte)0x08}; + buffer2= new byte[]{(byte)0xF7,(byte)0xF6,(byte)0xF5,(byte)0xF4,(byte)0xF3,(byte)0xF2,(byte)0xF1,(byte)0xF0}; + compareBuffer = new byte[42]; + compareBuffer[0]=(byte)0x04; + compareBuffer[1]=(byte)0x10; + Util.arrayCopy(buffer1,(short)0,compareBuffer,(short)2,(short)8); + Util.arrayCopy(buffer2,(short)0,compareBuffer,(short)10,(short)8); + bte_handler.appendTLV((byte)0x04,buffer1,(short)0,(short)8,buffer2,(short)0,(short)8); + buffer1= new byte[18]; + bte_handler.copy(buffer1,(short)0,(short)18); + //-compare buffer + if(Util.arrayCompare(buffer1,(short)0,compareBuffer,(short)0,(short)18)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 18 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x12; + + //-successful call + buffer1= new byte[]{(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07}; + buffer2= new byte[]{(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + compareBuffer[18]=(byte)0x85; + compareBuffer[19]=(byte)0x0C; + Util.arrayCopy(buffer1,(short)2,compareBuffer,(short)20,(short)6); + Util.arrayCopy(buffer2,(short)2,compareBuffer,(short)26,(short)6); + bte_handler.appendTLV((byte)0x85,buffer1,(short)2,(short)6,buffer2,(short)2,(short)6); + buffer1= new byte[32]; + bte_handler.copy(buffer1,(short)0,(short)32); + //-compare buffer + if(Util.arrayCompare(buffer1,(short)0,compareBuffer,(short)0,(short)32)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 19 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x13; + //-successful call + buffer1= new byte[]{(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55,(byte)0x66,(byte)0x77,(byte)0x88}; + buffer2= new byte[]{(byte)0x99,(byte)0xAA,(byte)0xBB,(byte)0xCC,(byte)0xDD,(byte)0xEE,(byte)0xFF,(byte)0x00}; + compareBuffer[32]=(byte)0x01; + compareBuffer[33]=(byte)0x08; + Util.arrayCopy(buffer1,(short)2,compareBuffer,(short)34,(short)4); + Util.arrayCopy(buffer2,(short)2,compareBuffer,(short)38,(short)4); + bte_handler.appendTLV((byte)0x01,buffer1,(short)2,(short)4,buffer2,(short)2,(short)4); + buffer1= new byte[42]; + bte_handler.copy(buffer1,(short)0,(short)42); + //-compare buffer + if(Util.arrayCompare(buffer1,(short)0,compareBuffer,(short)0,(short)42)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 20 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x14; + //-successful call + bte_handler.clear(); + buffer1 = new byte[128]; + buffer2 = new byte[125]; + compareBuffer= new byte[256]; + for (short i=0;i<128;i++){ + buffer1[i]=(byte)i; + } + for (short i=128;i<253;i++){ + buffer2[(short)(i-128)]=(byte)i; + } + compareBuffer[0]=(byte)0x04; + compareBuffer[1]=(byte)0x81; + compareBuffer[2]=(byte)0xFD; + Util.arrayCopy(buffer1,(short)0,compareBuffer,(short)3,(short)128); + Util.arrayCopy(buffer2,(short)0,compareBuffer,(short)131,(short)125); + //-successful call + bte_handler.appendTLV((byte)0x04,buffer1,(short)0,(short)128,buffer2,(short)0,(short)125); + buffer1= new byte[256]; + bte_handler.copy(buffer1,(short)0,(short)256); + //-compare buffer + if(Util.arrayCompare(buffer1,(short)0,compareBuffer,(short)0,(short)256)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + + + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/Test_Api_2_Bte_Aptlb_Bss_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/Test_Api_2_Bte_Aptlb_Bss_Bss.java new file mode 100644 index 0000000..9bce617 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/Test_Api_2_Bte_Aptlb_Bss_Bss.java @@ -0,0 +1,87 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Aptlb_Bss_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlb_bss_bss; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + + +public class Test_Api_2_Bte_Aptlb_Bss_Bss extends UiccTestModel +{ + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_aptlb_bss_bss"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** terminal profile for this test */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** the UiccAPITestCardService */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + + /** + * + */ + public Test_Api_2_Bte_Aptlb_Bss_Bss(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" // V Maximum number of services + + ); + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "14CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC " + + "CCCCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/applet.opt new file mode 100644 index 0000000..1b32ff0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_aptlb_bss_bss.Api_2_Bte_Aptlb_Bss_Bss_1 +uicc.test.toolkit.api_2_bte_aptlb_bss_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/javacard/api_2_bte_aptlb_bss_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlb_bss_bss/javacard/api_2_bte_aptlb_bss_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..3f4aabf97623abc65dca4dab1cca26b6b1694e67 GIT binary patch literal 5804 zcmcIod303O8UOC`mYK|QGnpilU?2qHw4@M%2m>@gOh^e!2wOpr6DA>)5VABG7O}`A zh)r1{ARadVK;dwd(~(6`S}0NltDvB4H)e$}2Cz}qB?0Wm`&RwsMu$@2uO4hoA zhpsOky1n1$U5`I{XJ*EQ!qL!o^z?eZb*)mnH*1N_c4gz(bG|jdn{jOMnwj5@-czOi z<;;N2^TwQ>$wrx7~Vxg;Q|CJN#o;fqE@beQB3o>h7D!+7M-+-ybUlzv? zTd=vut4B6XSdw?zmNEOlPQGFA99R8M`X4)f^LWObal7L3=2fiwVo&DWAv?DYDtxMs zl6mf_M-}IW^m7@%dGkl#JW{mqNKvVeecH+49+dFf)nD%Kr=ROjtAFsPslj(XI5~dk zzkhqEzW0=2hmSm4vT}3f|u` zol830sqvZ5c2o{69;N9MU6Z#o5r7p6KrxP{)fhuLn)lvn8JvblQV!C*in6jSe|fz> z%U@G7x3a>Y<*ThI>046jFE8=c`sbFGl-Acv%9`Vw?<@1w&CD86?weU&*SpMDOCa^L zV=Y$+mg zuco@*@2mC~V;RXDDL5>t6o4ZsNPt9;C=#Oq1jti?q_74?kSGg)u1bER1;}$65=FwO z8||Pjm3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(oo#c81grGgQ2#@#=?8N-Cm!!v#GGk?``sT7WlkD0$I~XV_y-Vh*emoSlo8`ObQDj3*~@1xC=7r447dEC!9oKk%$ib^0rmi z&&L5Fqn1_#gKhqhpfYgiEF?gnHr2)xUl0BK7Q_e{MOC*41D$achdN2;&NDb6CCVPG z8VQ0^e4UQHx~_TguEg^|QWtsprPyD*I4-mrWn?2N107uC{+fDBNOw~MwJC29&RA`yJfBu6wr>6ZT1DA|22 z&MGA0kfEiwdAqvAnq|nW41)yBEEafwghIbc%>9b)wfXe%?}xucQ-qA}rNevGx|+zA#Z8v+z@ zl0k}MDBjD9$3S-P1f{^aU~wMLkZy}oEsc#bNY{e4{H$S^ z$6IA5AA+EgAD?-WOu{fY;`b6#G}A7Nn`sf3o69b@#9eNgx!ej$)%sm-O_uPYh;dD2 zE`daTdRm;UndXoYjz~K#L%JEEv z?Qjw6#CD*AIAg9T=jgd8m$ZMoU*3)*o^~oj=tolgm(dvt;=u$0-Sgm@cv3CVe@Kk>P?L@ttU>tn1Xl4xCX9iSk)XHM z-{tFU3F6TyOtiqHIJAI?=og{=Dh9oHDG`y7fD1z%MsOFyiiPn^$Dkf&v3@9mo8mE7 zobRNvz;Vk6*}1nBPI9IWAwRA67#G value2.length + bte_handler.appendTLV((byte)0x0D,(byte)0x00,buffer,(short)6,(short)0); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 3 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x03; + try{ + //- value2Offset < 0 + bte_handler.appendTLV((byte)0x0D,(byte)0x00,buffer,(short)-1,(short)1); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x04; + try{ + //- value2Offset < 0 + bte_handler.appendTLV((byte)0x0D,(byte)0x00,buffer,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x05; + try{ + //- value2Offset + value2Length > value2.length + bte_handler.appendTLV((byte)0x0D,(byte)0x00,buffer,(short)3,(short)3 ); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x06; + try{ + //- value2Length < 0 + bte_handler.appendTLV((byte)0x0D,(byte)0x00,buffer,(short)0,(short)-1 ); + } + catch(ArrayIndexOutOfBoundsException ex){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x07; + buffer = new byte[(short)(bte_handler.getCapacity()-1)]; + Util.arrayFillNonAtomic(buffer,(short)0,(short)(bte_handler.getCapacity()-1),(byte)0xFF); + bte_handler.appendArray(buffer,(short)0,(short)(bte_handler.getCapacity()-1)); + buffer = new byte[254]; + try{ + //- Handler overflow exception + bte_handler.appendTLV((byte)0x0D,(byte)0x00,buffer,(short)0,(short)254); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.HANDLER_OVERFLOW){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x08; + bte_handler.clear(); + + buffer = new byte[256]; + bte_handler.appendArray(buffer,(short)0,(short)256); + try{ + //- Bad parameter exception + bte_handler.appendTLV((byte)0x0D,(byte)0x00,buffer,(short)0,(short)256); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.BAD_INPUT_PARAMETER){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 9 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x09; + //- initialize the handler + buffer=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x00}; + bte_handler.clear(); + bte_handler.appendArray(buffer,(short)0,(short)9); + //- select Command Details TLV + bte_handler.findTLV((byte)0x81,(byte)0x01); + //- successful call + buffer= new byte[]{(byte)0xFF,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB,(byte)0xFA,(byte)0xF9,(byte)0xF8}; + bte_handler.appendTLV((byte)0x04,(byte)0x05,buffer,(short)0,(short)8); + //- verify current TLV + if(bte_handler.getValueLength()==(short)3){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0A; + //- clear the handler + bte_handler.clear(); + //- successful call + buffer= new byte[]{(byte)0xFF,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB,(byte)0xFA,(byte)0xF9,(byte)0xF8}; + compareBuffer=new byte[27]; + compareBuffer[0]=(byte)0x04; + compareBuffer[1]=(byte)0x09; + compareBuffer[2]=(byte)0x05; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)3,(short)8); + bte_handler.appendTLV((byte)0x04,(byte)0x05,buffer,(short)0,(short)8); + buffer=new byte[11]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)11); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)11)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0B; + //- successful call + buffer= new byte[]{(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07}; + compareBuffer[11]=(byte)0x85; + compareBuffer[12]=(byte)0x07; + compareBuffer[13]=(byte)0x55; + Util.arrayCopy(buffer,(short)2,compareBuffer,(short)14,(short)6); + bte_handler.appendTLV((byte)0x85,(byte)0x55,buffer,(short)2,(short)6); + buffer=new byte[20]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)20); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)20)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0C; + //- successful call + buffer= new byte[]{(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55,(byte)0x66,(byte)0x77,(byte)0x88}; + compareBuffer[20]=(byte)0x01; + compareBuffer[21]=(byte)0x05; + compareBuffer[22]=(byte)0x44; + Util.arrayCopy(buffer,(short)2,compareBuffer,(short)23,(short)4); + bte_handler.appendTLV((byte)0x01,(byte)0x44,buffer,(short)2,(short)4); + buffer=new byte[27]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)27); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)27)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 13 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0D; + //- clear the handler + bte_handler.clear(); + //- successful call + buffer= new byte[127]; + for (short i=1; i<(short)128;i++){ + buffer[(short)(i-1)]=(byte)i; + } + compareBuffer=new byte[131]; + compareBuffer[0]=(byte)0x04; + compareBuffer[1]=(byte)0x81; + compareBuffer[2]=(byte)0x80; + compareBuffer[3]=(byte)0x00; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)4,(short)127); + bte_handler.appendTLV((byte)0x04,(byte)0x00,buffer,(short)0,(short)127); + buffer=new byte[131]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)131); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)131)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 14 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0E; + //- clear the handler + bte_handler.clear(); + //- successful call + buffer= new byte[249]; + for (short i=1; i<(short)250;i++){ + buffer[(short)(i-1)]=(byte)i; + } + compareBuffer=new byte[253]; + compareBuffer[0]=(byte)0x04; + compareBuffer[1]=(byte)0x81; + compareBuffer[2]=(byte)0xFA; + compareBuffer[3]=(byte)0x00; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)4,(short)249); + bte_handler.appendTLV((byte)0x04,(byte)0x00,buffer,(short)0,(short)249); + buffer=new byte[253]; + //- call copy() method + bte_handler.copy(buffer,(short)0,(short)253); + if (Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)253)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + + + + + } + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/Test_Api_2_Bte_Aptlbb_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/Test_Api_2_Bte_Aptlbb_Bss.java new file mode 100644 index 0000000..61aa276 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/Test_Api_2_Bte_Aptlbb_Bss.java @@ -0,0 +1,81 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Aptlbb_bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlbb_bss; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Aptlbb_Bss extends UiccTestModel{ + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_aptlbb_bss"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Aptlbb_Bss(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" // V Maximum number of services + + ); + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10"+APPLET_AID_1+ + "0ECCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/applet.opt new file mode 100644 index 0000000..c0d5faa --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_aptlbb_bss.Api_2_Bte_Aptlbb_Bss_1 +uicc.test.toolkit.api_2_bte_aptlbb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/javacard/api_2_bte_aptlbb_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbb_bss/javacard/api_2_bte_aptlbb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..2c1c4fdafb08df6eb428238b4271b91c78152844 GIT binary patch literal 5044 zcmbVQ3s6+o8UF9N=RWp*R+eRf!K!Jrjsi-wZi1);B(W5W57bmGvmhA|bT_au);zqs zL?!Z2$22uHt(YN{NoO6CQHz?yrm3Aak+f6C#L2_aNlcU0XiSK$Mx_6_3oLu~m>xU16{I(Yo^jmKVG6!QH2_&b(q zmtMd0&#LqV1V}sccK??Gp&+n! zbY%jmAFpS|U^|}FXim5=}~he{Dn1w>DUc z>xM^1!fd1w01-hEfDjObXxKno26#mbi2{O%8mKbw51T-ET0sy5PB&}=xsmsq5d?6Y zNe(el2&3bWBw(Avkm6-W&wiGQ3>^0&5}rz(uc3j@K?Zk$1`>#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!*s}o}a&uRERuLg`b;K&H z?Sib5B*hn81fE|Lwd~(G0+zmI9&IhKom<9teRKgw)*TSNaSBd^PhjMn;QQ@nVDV0N zY)kh+8wbuFv*EYL^*y8C@zSV28Vbx01?#o%OTka;R!YZwS>RpNiEUhlF-wB$7KH24~iM4@7kE1m@I@)dzMUz%!-Ii%odAPD-e0iSVGLyGE#C(CB#BUniPe| zqGY#Fvm(nfu~?jhSg8#=LcXlg*;)JxIS->a0s70g368-$urjHflx}PtJ2Y<<*2!&th!Pl zE(``nBh=f29v-2lr#r=~d=&G|WAwiQq|_*H;W`*v-&DAyhv;LX6yyP1WkZm(2uaV; zM?fjg5u=<`Jfw%{L!T660-hB^#-suvJwzY5q#&n^LiBNr9;FX7Qm8l{Dns^^kA@w3 zhCaSXF)kZrq@oQyMDJ-+kcEmtLv(&uPtrTv6zPyrlFs$&NqUEuB0X&~Xj8iTtF9Ee Ps{#xDe7FaDw43EWJl^T{ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/Api_2_Bte_Aptlbbs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/Api_2_Bte_Aptlbbs_1.java new file mode 100644 index 0000000..0063894 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/Api_2_Bte_Aptlbbs_1.java @@ -0,0 +1,173 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Aptlbbs_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlbbs; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Aptlbbs_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + BERTLVEditHandler bte_handler = null; + byte compareBuffer[] = null; + byte buffer[] = null; + + /** + */ + private Api_2_Bte_Aptlbbs_1 () { + } + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Aptlbbs_1 applet = new Api_2_Bte_Aptlbbs_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //register applet + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + buffer = new byte[(short)(bte_handler.getCapacity()-1)]; + //cause Handler Overflow + bte_handler.appendArray(buffer,(short)0,(short)(bte_handler.getCapacity()-1)); + try{ + bte_handler.appendTLV((byte)0x0D,(byte)0x00,(short)1); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.HANDLER_OVERFLOW){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x02; + buffer=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x00}; + bte_handler.clear(); + //initialize the handler + bte_handler.appendArray(buffer,(short)0,(short)9); + //-select Command Details TLV + bte_handler.findTLV((byte)0x81,(byte)0x01); + //-call appendTLV() + bte_handler.appendTLV((byte)0x0E,(byte)0x00,(short)1); + //-verify current TLV + if(bte_handler.getValueLength()==(short)3){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x03; + bte_handler.clear(); + bte_handler.appendTLV((byte)0x84,(byte)0x00,(short)Util.makeShort((byte)0x01,(byte)0x02)); + buffer= new byte[]{(byte)0x84,(byte)0x03,(byte)0x00,(byte)0x01,(byte)0x02}; + compareBuffer=new byte[10]; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)0,(short)5); + bte_handler.copy(buffer,(short)0,(short)5); + //compare the arrays + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)5)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x04; + bte_handler.appendTLV((byte)0x01,(byte)0xFE,(short)Util.makeShort((byte)0xFD,(byte)0xFC)); + Util.arrayCopy( new byte[]{(byte)0x01,(byte)0x03,(byte)0xFE,(byte)0xFD,(byte)0xFC },(short)0,compareBuffer,(short)5,(short)5); + buffer=new byte[10]; + bte_handler.copy(buffer,(short)0,(short)10); + //compare the arrays + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)10)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 5 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x05; + bte_handler.clear(); + buffer=new byte[248]; + buffer[0]=(byte)0x00; + buffer[1]=(byte)0x81; + buffer[2]=(byte)0xF5; + for (short i=3;i<248;i++){ + buffer[i]=(byte)i; + } + bte_handler.appendArray(buffer,(short)0,(short)248); + compareBuffer=new byte[253]; + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)0,(short)248); + compareBuffer[248]=(byte)0x84; + compareBuffer[249]=(byte)0x03; + compareBuffer[250]=(byte)0x00; + compareBuffer[251]=(byte)0x01; + compareBuffer[252]=(byte)0x02; + bte_handler.appendTLV((byte)0x84,(byte)0x00,Util.makeShort((byte)0x01,(byte)0x02)); + buffer=new byte[253]; + bte_handler.copy(buffer,(short)0,(short)253); + //compare the arrays + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)253)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/Test_Api_2_Bte_Aptlbbs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/Test_Api_2_Bte_Aptlbbs.java new file mode 100644 index 0000000..ccac233 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/Test_Api_2_Bte_Aptlbbs.java @@ -0,0 +1,82 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Aptlbbs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlbbs; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + + +public class Test_Api_2_Bte_Aptlbbs extends UiccTestModel{ + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_aptlbbs"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Aptlbbs(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + //); + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10"+APPLET_AID_1+ + "05CCCCCC CCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/applet.opt new file mode 100644 index 0000000..5097cdd --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_aptlbbs.Api_2_Bte_Aptlbbs_1 +uicc.test.toolkit.api_2_bte_aptlbbs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/javacard/api_2_bte_aptlbbs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbbs/javacard/api_2_bte_aptlbbs.cap new file mode 100644 index 0000000000000000000000000000000000000000..8db4280d9476fc34a78b4135d0bb8c2072f31cfe GIT binary patch literal 3875 zcmbW3dr(x@9mjv?aUZ*PcXNT=b;XEOlbNI`t`Hv^kQR#2P*^0!QA2BVS=O+M>=rh0 zWa6-(jhjL6fia1#4o=bpGqaXNCboHyglcV2nznf;Q_J{A#_42CW1EMm3iNj`$hvoG zXSQeOd(U&v=lssO_ji8P6^z?K#$U#|Cl%cOgNIMAAKbRL?#;^AyyAuP zOAbHoJ@-=Nck&;8`^AKD+B@@7d$g`}f+H zu5XWa3~qe(^2|HGj2+rMD853w(i@%CBaZ}w^1GYqg*C4|Q`36*K{Tr0#>P z)f)qA-yax#*V+4Z&%x{qmzugACtm&L>hdFFy#uu`2T#73zNPQaqrX_Z@}&{!!?(`- zy|ushSpQ$RvS3rd9|<*W)u0sSKqkr#RZt5~mH}qijWZrcVG@Xe{N|P=^JZX& zrj%_h4u=~85e>`0Zm^L6fy!hnhyM|K@*(7CN|{x@IUH)zSsbba!;W6T87Yx^Fsmg< zPTKBtY&A4x=uMO3fh4c;V`c9|0Q)r+qEb4Gl2BuF#Mc<9#ur7~7Xc5!MFAL!qX0!v zlt!_DbrB$!wK0OCEDExywYQs4Rv%jfR=KT>Lc2`N?UDi3a=LVZlL5YH|HqMf1Cjbroko*b zh6n?oz!|VYYjh2afDJB1!(K!A2{hzhMIAs%sZ0E*1k6agm)A z#ZbJ3=j{fua2H7PU9<1Lmpi#np490qRUwoOTgNv+$BV%1$1qan7b&x;UiU;#9RVt`#%Fww%lk$l#kq z7mq<$%F(AjMvg%T*!8l27}c~#DP(G!r;v-DLVDkmBj0>IM&{yt~^)>C7S`)5C#C1sm z;$5m4EoYkDjLDtgL?l*Z{9hU=m~NioyRFfZM&;_bI;P&Z3DkLr(6>MxN1i%{K=p

hy)HoN^uRUUJ7Itm6#(7rOPdtxM z68@)d6*lS{jDH+USdFc^-3$xr4o@8Oe~Wr{4X4H0b*^VO1P>lZ(!Ng4Gid~tZ?yue zw=<(9*)MGxK7YcB-=e0aseacFM|_c>zbqJN(7!hsZ-wcUjCrbJxNINxX-XNhBCw${ zSHxs93>N||kj#Hhq`sYK0+V$my9x<{f+re>y0*1u<^RAEz{ zRw{@#g{DzvmL*IMN-fNa10h$EwIpV8n}y4EZj#d_MRxwcVzx*#Yzog&EDk%Lmtl3- z9&ot1!{$h~wY&B5uU|(yH5H&za+S*h&Hkof7%yJUR0WP}Hy$v}XSUIH8C|8G7Hj^K zKt4KsbpHA1CxJyVB*6P1$|l+&7m9ROt%V1b@I!E851`ZC1~qiQc0GU#@?asl@_hU) zotVJ!MK}(hS}=k2(y9E%`2Xdw0#=c1vOuWM?je2n+(T5}pDQh_&jwP&@>F(zk=WnA z3{^slt1Ae#W2|s9fW0*)(gN7zbh~g?o5ei!M*X+=DKX1w+>DeqIT1}6A;yp?0eOI? z2uTW{j2vTtl;9jsm6HgUj1XgFlz_~^7bc}0OTA(!3}fh#VEijpMj{X~LX1u~0a+`jXo$fD8%ajLn;@M`m1OY3Mv~F%B}jdy Z6m3fOfz=g)=C3e}Q=kgZ;2r&v`46xD00#g7 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/Api_2_Bte_Aptlbs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/Api_2_Bte_Aptlbs_1.java new file mode 100644 index 0000000..54ecba9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/Api_2_Bte_Aptlbs_1.java @@ -0,0 +1,178 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Aptlbs_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlbs; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Aptlbs_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + BERTLVEditHandler bte_handler = null; + byte compareBuffer[] = null; + byte buffer[] = null; + + /** + */ + private Api_2_Bte_Aptlbs_1 () { + } + /** + * Create an instance of the BaService, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Aptlbs_1 applet = new Api_2_Bte_Aptlbs_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialise the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + buffer=new byte[(short)(bte_handler.getCapacity()-1)]; + bte_handler.appendArray(buffer,(short)0,(short)(bte_handler.getCapacity()-1)); + //cause Handler Overflow + try{ + bte_handler.appendTLV((byte)0x0D,(short)1); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.HANDLER_OVERFLOW){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x02; + buffer=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x00}; + bte_handler.clear(); + //initialize the handler + bte_handler.appendArray(buffer,(short)0,(short)9); + //-select Command Details TLV + bte_handler.findTLV((byte)0x81,(byte)0x01); + //-call appendTLV() + bte_handler.appendTLV((byte)0x0E,(short)0); + //-verify current TLV + if(bte_handler.getValueLength()==(short)3){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x03; + //- clear the handler + bte_handler.clear(); + bte_handler.appendTLV((byte)0x84,Util.makeShort((byte)0x00,(byte)0x01)); + buffer= new byte[4]; + compareBuffer=new byte[]{(byte)0x84,(byte)0x02,(byte)0x00,(byte)0x01}; + bte_handler.copy(buffer,(short)0,(short)4); + //compare the arrays + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)4)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x04; + //-succesful call + bte_handler.appendTLV((byte)0x01,Util.makeShort((byte)0xFE,(byte)0xFF)); + buffer= new byte[8]; + compareBuffer=new byte[]{(byte)0x84,(byte)0x02,(byte)0x00,(byte)01,(byte)01,(byte)0x02,(byte)0xFE,(byte)0xFF}; + //-call copy method + bte_handler.copy(buffer,(short)0,(short)8); + //compare the arrays + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)8)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x05; + buffer = new byte[249]; + compareBuffer=new byte[253]; + bte_handler.clear(); + buffer[0]=(byte)0x00; + buffer[1]=(byte)0x81; + buffer[2]=(byte)0xF6; + for(short i=3;i<249;i++){ + buffer[3]=(byte)i; + } + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)0,(short)249); + compareBuffer[249]=(byte)0x84; + compareBuffer[250]=(byte)0x02; + compareBuffer[251]=(byte)0x00; + compareBuffer[252]=(byte)0x01; + //-call appendArray + bte_handler.appendArray(buffer,(short)0,(short)249); + //-successful call + bte_handler.appendTLV((byte)0x84,Util.makeShort((byte)0x00,(byte)0x01)); + //-call getLength() + if(bte_handler.getLength()==(short)253){ + buffer= new byte[253]; + bte_handler.copy(buffer,(short)0,(short)253); + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)253)==(byte)0x00){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/Test_Api_2_Bte_Aptlbs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/Test_Api_2_Bte_Aptlbs.java new file mode 100644 index 0000000..fe06789 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/Test_Api_2_Bte_Aptlbs.java @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Aptlbbs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlbs; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Aptlbs extends UiccTestModel{ + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_aptlbs"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Aptlbs(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + //Install package + test.loadPackage(CAP_FILE_PATH); + test.terminalProfileSession("13"); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" // V Maximum number of services + ); + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10"+APPLET_AID_1+ + "05CCCCCC CCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/applet.opt new file mode 100644 index 0000000..1fb8b64 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_aptlbs.Api_2_Bte_Aptlbs_1 +uicc.test.toolkit.api_2_bte_aptlbs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/javacard/api_2_bte_aptlbs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbs/javacard/api_2_bte_aptlbs.cap new file mode 100644 index 0000000000000000000000000000000000000000..dee0b68f414aca216627936ab468eab7999b6821 GIT binary patch literal 3841 zcmb7`4Qx}_701uJ_r4E*#CvuU$4LlH+J?1Z#Bum?6HF44(1s9VC`#L~ju>MUlYp(n z0ZQB9n6%J_1h$T4Yk`C6(18TRe>fu_ocz{ z+nDsO^?&!>d!O&`o^$Uz@Aw-j%K`;|*(*29hDjw07&O%{ubI)XWTCsMW=X@s`p1`- zHZ2@I2asIW6iJl1PQP;fzRe@H`qtmA`&H3}zEIxGp$!jazZ|Y>dsF@T%jumZj;$v* zJwt~s%)fTSbHKFo$7Os!{nraGHGI+9{8sqX-`{<7=GEYqhxatk%yoA^{p=gXFO+5% z{d>++B_%)1&G;ntQDI{6%SG`MZ%*^Px2EINl+(BB)+xuA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3mU$f%V$JX{J; zfgv74eFcU^pmF^8WAu;Hu>^RaS_{lP5m*chz>On-G4^?AB`@=j0l1(XW??X`z~8*F zF?_xnpTjFp8?asfO}z;J-wey3MJN=?#P-7d!aI1~C8+GEN1oMQ2tqY2SLw`Z>FCi~ zR2`}DHwq*R(}Iaab#n5<6V>!`ue6oVV*chZ{jWqRHOsHj8Ag1ZN}KcyeQuOu%q7Mc zX_=B9qtAp=n0E|fQhAY{p-+KQjC?#TM%LsS7&Ai`b@d>9s7-->VGyJXyn2v6)}=suOvWrq Vk9__{kw+=8;I9t-|F-s3`43-R-G~4H literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/Api_2_Bte_Aptlbss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/Api_2_Bte_Aptlbss_1.java new file mode 100644 index 0000000..edd2d28 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/Api_2_Bte_Aptlbss_1.java @@ -0,0 +1,189 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Aptlbss_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlbss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Aptlbss_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + BERTLVEditHandler bte_handler = null; + byte compareBuffer[] = null; + byte buffer[] = null; + + /** + * If AID length is not zero register applet with specified AID + * @param bArray the array constaing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray + */ + private Api_2_Bte_Aptlbss_1 () { + } + /** + * Create an instance of the BaService, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Aptlbss_1 applet = new Api_2_Bte_Aptlbss_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //intialise the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + buffer=new byte[(short)(bte_handler.getCapacity()-1)]; + bte_handler.appendArray(buffer,(short)0,(short)(bte_handler.getCapacity()-1)); + //cause Handler Overflow + try{ + bte_handler.appendTLV((byte)0x0D,(short)0,(short)1); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.HANDLER_OVERFLOW){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x02; + buffer=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x00}; + bte_handler.clear(); + //initialize the handler + bte_handler.appendArray(buffer,(short)0,(short)9); + //-select Command Details TLV + bte_handler.findTLV((byte)0x81,(byte)0x01); + //-call appendTLV() + bte_handler.appendTLV((byte)0x0E,(short)0,(short)1); + //-verify current TLV + if(bte_handler.getValueLength()==(short)3){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x03; + //- clear the handler + bte_handler.clear(); + bte_handler.appendTLV((byte)0x84,Util.makeShort((byte)0x00,(byte)0x01),Util.makeShort((byte)0x02,(byte)0x03)); + buffer= new byte[6]; + compareBuffer=new byte[]{(byte)0x84,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03}; + bte_handler.copy(buffer,(short)0,(short)6); + //compare the arrays + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)6)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x04; + //-succesful call + bte_handler.appendTLV((byte)0x01,Util.makeShort((byte)0xFE,(byte)0xFD),Util.makeShort((byte)0xFC,(byte)0xFB)); + buffer= new byte[12]; + compareBuffer=new byte[]{(byte)0x84,(byte)0x04,(byte)0x00,(byte)01,(byte)0x02,(byte)0x03,(byte)0x01,(byte)0x04,(byte)0xFE,(byte)0xFD,(byte)0xFC,(byte)0xFB}; + //-call copy method + bte_handler.copy(buffer,(short)0,(short)12); + //compare the arrays + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)12)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 5 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x05; + buffer = new byte[247]; + compareBuffer=new byte[253]; + bte_handler.clear(); + buffer[0]=(byte)0x00; + buffer[1]=(byte)0x81; + buffer[2]=(byte)0xF4; + for(short i=3;i<247;i++){ + buffer[3]=(byte)i; + } + Util.arrayCopy(buffer,(short)0,compareBuffer,(short)0,(short)247); + compareBuffer[247]=(byte)0x84; + compareBuffer[248]=(byte)0x04; + compareBuffer[249]=(byte)0x00; + compareBuffer[250]=(byte)0x01; + compareBuffer[251]=(byte)0x02; + compareBuffer[252]=(byte)0x03; + //-call appendArray + bte_handler.appendArray(buffer,(short)0,(short)247); + //-successful call + bte_handler.appendTLV((byte)0x84,Util.makeShort((byte)0x00,(byte)0x01),Util.makeShort((byte)0x02,(byte)0x03)); + //-call getLength() + if(bte_handler.getLength()==(short)253){ + buffer= new byte[253]; + bte_handler.copy(buffer,(short)0,(short)253); + if(Util.arrayCompare(buffer,(short)0,compareBuffer,(short)0,(short)253)==(byte)0x00){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + + + + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/Test_Api_2_Bte_Aptlbss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/Test_Api_2_Bte_Aptlbss.java new file mode 100644 index 0000000..a178ebc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/Test_Api_2_Bte_Aptlbss.java @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Aptlbss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_aptlbss; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Aptlbss extends UiccTestModel{ + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_aptlbss"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Aptlbss(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + //Install package + test.loadPackage(CAP_FILE_PATH); + test.terminalProfileSession("13"); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10"+APPLET_AID_1+ + "05CCCCCC CCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/applet.opt new file mode 100644 index 0000000..4548b79 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_aptlbss.Api_2_Bte_Aptlbss_1 +uicc.test.toolkit.api_2_bte_aptlbss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/javacard/api_2_bte_aptlbss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_aptlbss/javacard/api_2_bte_aptlbss.cap new file mode 100644 index 0000000000000000000000000000000000000000..cf3d838a8b4c744bde557ee24fc9a57dfc9e7a96 GIT binary patch literal 3936 zcmb7G3vg7`8UD}XKK9w0WRomOfuIwo1xZX0SQAq7AV?$$fhfgP37gGgHV<|uSrK9x zcSDf0At8uXgh9a$j?;ECj6tn9YBCOGBqhR7r?xVE%+%U}K~QO|0!jaK11x)|>C8Pl z-}&!3_w4!p$GQLcYgRDs0u_Jh^_v#LZOsK7s>&ZKnO{-8EVrtpx?)**?L#?L%O*|& z#8y`YyY6wnx99Tg&U4Q4y4`K>&N#t|8tl|5Au=@VkmyaHLW&Ga-zutdWcI{DG zU0(OqfQ61(TOMtHHS~Mmrq?Z*uQ@%-e_L1F_W0q$+3=+0a`K12Xukf)?uREvR*u(( zMoQ`L#;&&hVck>dhwEmHZF&C8V%x|Ab#x~wZCsx+Du2=BJQDcx=lsC43xCzv_kLsF zSmVlBe{BBv{ei7R(V3?w4m5X#UKnj#bMAQarI$+IS@rbs4`1I~k-aha%b^8ruT^%8 zzxwUxXC|9g)dpha|LS=l{mRF5_(08tb>vDR^$a}rSntSZk-;M)$F^U7=H#M7$Hr|n zD-@NyX!S-3z!nLh2E%C8gD1i`@#bXVOdJU;Mm!Pl`EtYlj&N=`7;J3`gmb;2Kz)9F zL)c&M4TW19Iy!Qjy_>u~Z+m0za=*9H-=5?1h6rT*<>cf=LOBraAns!UX%gGdvhX>P zaliKInmce-pa5ZtacQ94?+XXpw+K=SvmpcFf@)}hG*%5(*o`|5A+Slr!2HgWi|wzR{`E~O68-9E*P=qiQi?ZOxj<9!QxCRf3@QZ{&a8m$=;0Qnv z1f>ytz_ARF$D)iND2sq9i}@}K!U3e4g1k+Ptq370u&6|Eokfmn5&{qg{ZI6h-7|1! zfkg;&`nP&JI)vgfq?JWL0%jFjZjDmtQi-)oF&rPq=wJI*F$^ifbV#fG;ih1tU{hGN z4DW#rM!^A3N7llhzzP41gveTO5`W}zGKTWg$adNQP8y7S#EMaB?ww$BvmQVYH`zfE z48c2j{w|PEOg?I)0A=Vb%79Xv*3oZXt~=aB4-QO&`)cyxuF^D}xOg}2CV z-UA_JzP|M!8H8SN>CY0cps!nGIqN5ZcP>@>H_uaM*S4j z5A~8!M+LP~WzP<@9$lcx_?IM7D7?XN)CXzaX^mC{E7vBp>qwre#Ej zAibubE}E)MU~kc`V{g^2VQZD>IlHePiJ_)X)oC+)YnKR~zagG6q zaY?)4k@IHZ$~Jr<&-#hy5lTW|PMM9feUM%lWB7pX67oNaF22PbaP%G5#Z^fc*JO|G zJ6wG;h{h01MG#P-mbs{&P;2VQ;q&dr;czf=c(oN3Z5lOYcqnT%O4&UDdY(x${5ShGSB`3h@58&qQquIbmze*r8T0|Ed5 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/Api_2_Bte_Cler_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/Api_2_Bte_Cler_1.java new file mode 100644 index 0000000..4ba0f56 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/Api_2_Bte_Cler_1.java @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Cler_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_cler; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Cler_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + BERTLVEditHandler bte_handler = null; + byte buffer[] = null; + + /** + * If AID length is not zero register applet with specified AID + * @param bArray the array constaing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray + */ + private Api_2_Bte_Cler_1 () { + } + /** + * Create an instance of the BaService, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Cler_1 applet = new Api_2_Bte_Cler_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialise the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + buffer=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x00}; + bte_handler.appendArray(buffer,(short)0,(short)9); + //-select Command Details TLV + bte_handler.findTLV((byte)0x81,(byte)0x01); + //-getLength() + if(bte_handler.getLength()>(short)0){ + bte_handler.clear(); + if(bte_handler.getLength()==(short)0){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x02; + try{ + bte_handler.getValueLength(); + } + catch(ToolkitException ex){ + if (ex.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + + + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/Test_Api_2_Bte_Cler.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/Test_Api_2_Bte_Cler.java new file mode 100644 index 0000000..2dc5a3b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/Test_Api_2_Bte_Cler.java @@ -0,0 +1,78 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Cler.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_cler; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Cler extends UiccTestModel{ + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_cler"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Cler(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10"+APPLET_AID_1+ + "02CCCC"); + // delete applet and package + test.reset(); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/applet.opt new file mode 100644 index 0000000..2c1bc0a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_cler.Api_2_Bte_Cler_1 +uicc.test.toolkit.api_2_bte_cler +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/javacard/api_2_bte_cler.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cler/javacard/api_2_bte_cler.cap new file mode 100644 index 0000000000000000000000000000000000000000..98faffa474615f35d0cd07908331a6c83692b9b9 GIT binary patch literal 3185 zcmb7`e{54#6vxkf@3npH*3q%9c561aAw$?twvm+|70Q0-Ec@XYe?SJKbk&uWwR8pJ z=CZDvZlf>|FtQ-Aie}1I;&eC=14v?2!T>cO1keBpK?Otw8JaQAEnw*jChcv$@4b89 z&H0>r&wb~#!oYG$;PI!fSvM0NX-eRrw5Up-QBqc%RjMy5DK1)6m04PR?%4i(>ReHO}{TG>$I_@hAH1TlB+y@Dc&#o+)35$yp1m&ymIDp&XIf5OKbHru3U7VATiheE{{B` zX~=Ch{ZRbd%~Qsvc|*M;x5`(~Rei8ztf}{u;nK{yrQKiUEb;J97EE2dICH;guF{}w zD$J-9Uz<{$?j8E%bY;x^9o*=kd;jv*Eq$-Hj>-=@l9N}~T|Kx^e0%RpvwnHw_bMf6 zncuN|>&$nR(MM)4yK-xD{`Qnr=PoRA_Y5vA8aQnmIQ`RLqC7KpcT4K%syp%C>zcJ4 zCsRGY4h(hgJcTYL*jFKa3c624hKyrh)?*hK&p7(|&rbTo+f zJ{_NvfIX@_)LM(ll;t!xII~0vDzyMn>H-wlU!5iOek# z9Fc8zK35Ari)bClZjuZC4_Rg-AxB-T*Q++XX11 zCY=n5ZQ^n^fk?Lj#F^@ZDbqL=XXG^=kk}(N>I6=&;ygh6QcXL@^e_+sO`>GK4GwLH zq6ut-sBHifIvF3s;e-isYK3%jgpO6TX?2`fs}pfrotV|?Bq(0t*6I{u5nd$py@F@8 zove@Xv8+Pc!+|2o$0*vk9u}gRIX=E`73|K_r_Ng6LRYA$OQ9d?LUW_ZVX(8Rk_+1#`890n~05j@zNQX?wfxPi? zoUO%Kc%|ta`??4B1yDqiNVcdh$xA-M>t>?hhGt0e>XLxXQIPqJzQRBlC0cvPfY}`uMv(J_7-9AbU}j dstBuffer.length + bRes=false; + testCaseNb=(byte)0x04; + try{ + bte_handler.copy(dstBuffer,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException exp){bRes=true;} + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + + //-------------- TESTCASE 5-------------- + //- dstOffset + dstLength > dstBuffer.length + bRes=false; + testCaseNb=(byte)0x05; + try{ + bte_handler.copy(dstBuffer,(short)3,(short)3); + } + catch(ArrayIndexOutOfBoundsException exp){bRes=true;} + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6-------------- + //- dstLength < 0 + bRes=false; + testCaseNb=(byte)0x06; + try{ + bte_handler.copy(dstBuffer,(short)0,(short)-1); + } + catch(ArrayIndexOutOfBoundsException exp){bRes=true;} + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7-------------- + //- dstLength > length of the comprehension TLV list + bRes=false; + testCaseNb=(byte)0x07; + try{ + dstBuffer = new byte[10]; + bte_handler.copy(dstBuffer,(short)0,(short)10); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) bRes=true; + } + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8-------------- + //- successfull call, dstBuffer is the whole bufffer + bRes=false; + testCaseNb=(byte)0x08; + + try{ + dstBuffer = new byte[9]; + if(bte_handler.copy(dstBuffer,(short)0,(short)9)==(short)9){ + bRes=true; + } + } + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9-------------- + //- compare the buffer + bRes=false; + testCaseNb=(byte)0x09; + + if(Util.arrayCompare(dstBuffer,(short)0,bArray,(short)0,(short)9)==(byte)0x00){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10-------------- + //- successfull call, dstBuffer is a part of a buffer + bRes=false; + testCaseNb=(byte)0x0A; + try{ + dstBuffer = new byte[15]; + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)15,(byte)0xFF); + if(bte_handler.copy(dstBuffer,(short)3,(short)9)==(short)12){ + bRes=true; + } + } + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11-------------- + //- compare the whole buffer + bRes=false; + testCaseNb=(byte)0x0B; + byte compareBuffer[]=new byte[15]; + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)15,(byte)0xFF); + //compare the copied value + if(Util.arrayCompare(dstBuffer,(short)3,bArray,(short)0,(short)9)==(byte)0x00){ + //compare the first part of dstBuffer + if(Util.arrayCompare(dstBuffer,(short)0,compareBuffer,(short)0,(short)3)==(byte)0x00){ + //compare the last part of dstBuffer + if(Util.arrayCompare(dstBuffer,(short)13,compareBuffer,(short)13,(short)2)==(byte)0x00){ + bRes=true; + } + } + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12-------------- + //- successfull call, dstBuffer is a part of a buffer + bRes=false; + testCaseNb=(byte)0x0C; + try{ + dstBuffer = new byte[15]; + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)15,(byte)0xFF); + if(bte_handler.copy(dstBuffer,(short)3,(short)6)==(short)9){ + bRes=true; + } + } + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 13-------------- + //- compare the whole buffer + bRes=false; + testCaseNb=(byte)0x0D; + compareBuffer=new byte[15]; + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)15,(byte)0xFF); + //compare the copied value + if(Util.arrayCompare(dstBuffer,(short)3,bArray,(short)0,(short)6)==(byte)0x00){ + //compare the first part of dstBuffer + if(Util.arrayCompare(dstBuffer,(short)0,compareBuffer,(short)0,(short)3)==(byte)0x00){ + //compare the last part of dstBuffer + if(Util.arrayCompare(dstBuffer,(short)9,compareBuffer,(short)9,(short)6)==(byte)0x00){ + bRes=true; + } + } + } + this.reportTestOutcome(testCaseNb,bRes); + + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/Test_Api_2_Bte_Copy.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/Test_Api_2_Bte_Copy.java new file mode 100644 index 0000000..b594ee9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/Test_Api_2_Bte_Copy.java @@ -0,0 +1,82 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Copy.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_copy; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +public class Test_Api_2_Bte_Copy extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_copy"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Copy(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 13 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "0DCCCCCC CCCCCCCC CCCCCCCC CCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/applet.opt new file mode 100644 index 0000000..7bc6650 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_copy.Api_2_Bte_Copy_1 +uicc.test.toolkit.api_2_bte_copy +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/javacard/api_2_bte_copy.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_copy/javacard/api_2_bte_copy.cap new file mode 100644 index 0000000000000000000000000000000000000000..1df8c0d9d8ef1cee9d6510f3841926fa211bd7a6 GIT binary patch literal 3815 zcmb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271vgyNz63Slio}?*FaSoYNR6VFS6zsA){ob$kdk4g#)WtjT!q*1nvqvQUWF!> zt{L2yn%_F7J~?5;6v6P*v{FSX3t>H_|*#J^a^kM~+jI&Ylyh12mR$RPXs1%m+`J7tC>(!#!7u4uvO_P2uWT=8k$rKb- zZ?Rf3ESU-97_xHARBu(y7FErdduQrXPv72?oBt%9oWY4$d@^0@5BqupA-sm!;SI2d zU4g)3R^|J-n2gDkT?bH3*o^??Gcg#%BIpGG1J?>B9ArZ|K9w^w zC|QjX)#%Y`RzA!&aLv8%fLd5bj)@&bdkGcBs>Cr*jjp<*2zUo2HPYCahjTYK5YB>C z!F-8&eci)K)YP_6!OFDg=YoHu8Y!tIj@B>Ud&!DP%b+cbk_^@8$;C6I6iHeVZ4s0t zIg%DhvLwFl9RL6T literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/Api_2_Bte_Cprv_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/Api_2_Bte_Cprv_1.java new file mode 100644 index 0000000..ac868b7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/Api_2_Bte_Cprv_1.java @@ -0,0 +1,390 @@ +//----------------------------------------------------------------------------- +//Ape_2_Bte_Cprv_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_cprv; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Cprv_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + byte bArray[] = null; + BERTLVEditHandler bte_handler = null; + byte compareBuffer[] = null; + + /** + */ + private Api_2_Bte_Cprv_1 () { + } + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Cprv_1 applet = new Api_2_Bte_Cprv_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialise the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + bArray= new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x02}; + bte_handler.appendArray(bArray,(short)0,(short)9); + bte_handler.findTLV((byte)0x81,(byte)0x01);//select TLV structure 0x81 + + //- compareValue() with a null compareBuffer + try{ + bte_handler.compareValue((short)0,null,(short)0,(short)1); + } + catch(NullPointerException exp){ + bRes=true; + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + //- initialize the handler + try{ + bRes=false; + testCaseNb=(byte)0x02; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray= new byte[]{ (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x0F,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0C, + (byte)0x0D,(byte)0x0E}; + + bte_handler.appendArray(bArray,(short)0,(short)bArray.length); + bte_handler.findTLV((byte)0x0D,(byte)0x01); + compareBuffer = new byte[]{(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF}; + //- compareOffset>compareBuffer.length + try{ + bte_handler.compareValue((short)0,compareBuffer,(short)6,(short)0); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + //- compareOffset < 0 + try{ + bRes=false; + testCaseNb=0x03; + bte_handler.compareValue((short)0,compareBuffer,(short)-1,(short)1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + //- compareLength>compareBuffer.length + try{ + bRes=false; + testCaseNb=0x04; + bte_handler.compareValue((short)0,compareBuffer,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + //- compareOffset+compareLength>compareBuffer.length + try{ + bRes=false; + testCaseNb=0x05; + bte_handler.compareValue((short)0,compareBuffer,(short)3,(short)3); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6-------------- + //- compareLength<0 + try{ + bRes=false; + testCaseNb=0x06; + bte_handler.compareValue((short)0,compareBuffer,(short)0,(short)-1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7-------------- + //- initialize the handler + try{ + bRes=false; + testCaseNb=(byte)0x07; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray= new byte[]{ (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x06,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x04}; + bte_handler.appendArray(bArray,(short)0, (short)17); + bte_handler.findTLV((byte)0x0D,(byte)0x01); + compareBuffer = new byte[15]; + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)15,(byte)0xFF); + //- valueOffset>Text String Length + try{ + bte_handler.compareValue((short)7,compareBuffer,(short)0,(short)0); + } + catch(ToolkitException exp){ + if(exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8-------------- + //- valueOffset < 0 + try { + bRes = false; + testCaseNb = (byte) 0x08; + bte_handler.findTLV((byte) 0x0D, (byte) 0x01); + try { + bte_handler.compareValue((short) -1, compareBuffer, (short) 0, (short) 1); + } + catch (ToolkitException exp) { + if (exp.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) { + bRes = true; + } + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 9-------------- + //- compareLength > Text String Length + try { + bRes = false; + testCaseNb = (byte) 0x09; + bte_handler.findTLV((byte) 0x0D, (byte) 0x01); + try { + bte_handler.compareValue((short) 0, compareBuffer, (short) 0, (short) 7); + } + catch (ToolkitException exp) { + if (exp.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) { + bRes = true; + } + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 10-------------- + //- valueOffset + compareLength > Text String Length + try { + bRes = false; + testCaseNb = (byte) 0x0A; + bte_handler.findTLV((byte) 0x0D, (byte) 0x01); + try { + bte_handler.compareValue((short) 2, compareBuffer, (short) 0, (short) 5); + } + catch (ToolkitException exp) { + if (exp.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) { + bRes = true; + } + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 11-------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x0B; + bte_handler.clear(); + bte_handler.setTag((byte) 0x01); + bArray = new byte[]{(byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, (byte) 0x82}; + bte_handler.appendArray(bArray,(short)0, (short)9); + try { + bte_handler.compareValue((short) 0, compareBuffer, (short) 0, (short) 0); + } + catch (ToolkitException exp) { + if (exp.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true; + } + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 12-------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x0C; + bte_handler.clear(); + bte_handler.setTag((byte) 0x01); + bArray = new byte[]{(byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, (byte) 0x02, + (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F}; + bte_handler.appendArray(bArray,(short)0, (short)28); + bte_handler.findTLV((byte) 0x0D, (byte) 0x01); + //- initialize compareBuffer + compareBuffer = new byte[]{(byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, + (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F}; + //- compare buffers + if (bte_handler.compareValue((short) 0, compareBuffer, (short) 0, (short) 17)==(byte)0x00){ + bRes=true; + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 13-------------- + //- initialize compare Buffer + try{ + bRes=false; + testCaseNb=(byte)0x0D; + compareBuffer= new byte[]{ (byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06, + (byte)0x07,(byte)0x08,(byte)0x0F,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x10}; + //compare the buffer + if ((short)bte_handler.compareValue((short) 0, compareBuffer, (short) 0, (short) 17)==(short)-1){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); +// -------------- TESTCASE 14-------------- + //- initialize compare Buffer + try{ + bRes=false; + testCaseNb=(byte)0x0E; + compareBuffer= new byte[]{ (byte)0x03,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06, + (byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x0F}; + //compare the buffer + if ((short)bte_handler.compareValue((short) 0, compareBuffer, (short) 0, (short) 17)==(short)1){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); + + + //-------------- TESTCASE 15-------------- + //- initialize compare Buffer + try{ + bRes=false; + testCaseNb=(byte)0x0F; + compareBuffer= new byte[]{ (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05, + (byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x55, + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55}; + //compare the buffer + if (bte_handler.compareValue((short) 2, compareBuffer, (short) 3, (short) 12)==(byte)0x00){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 16-------------- + //- initialize compare Buffer + try{ + bRes=false; + testCaseNb=(byte)0x10; + compareBuffer= new byte[]{ (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x02,(byte)0x01,(byte)0x03,(byte)0x04,(byte)0x05, + (byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x55, + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55}; + //compare the buffer + if ((short)bte_handler.compareValue((short) 2, compareBuffer, (short) 3, (short) 12)==(short)-1){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 17-------------- + //- initialize compare Buffer + try{ + bRes=false; + testCaseNb=(byte)0x11; + compareBuffer= new byte[]{ (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05, + (byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0A,(byte)0x0D,(byte)0x55, + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55}; + //compare the buffer + if ((short)bte_handler.compareValue((short) 2, compareBuffer, (short) 3, (short) 12)==(short)1){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 18-------------- + //- initialize compare Buffer + try{ + bRes=false; + testCaseNb=(byte)0x12; + compareBuffer= new byte[]{ (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x99,(byte)0x03,(byte)0x03,(byte)0x04,(byte)0x05, + (byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x55, + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55}; + //compare the buffer + if ((short)bte_handler.compareValue((short) 2, compareBuffer, (short) 3, (short) 12)==(short)1){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); + } +}//end of class \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/Test_Api_2_Bte_Cprv.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/Test_Api_2_Bte_Cprv.java new file mode 100644 index 0000000..9263eb5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/Test_Api_2_Bte_Cprv.java @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Cprv.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_cprv; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Cprv extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_cprv"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Cprv(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "12CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC " + + "CCCCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + return testresult; + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/applet.opt new file mode 100644 index 0000000..6ed4a0e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_cprv.Api_2_Bte_Cprv_1 +uicc.test.toolkit.api_2_bte_cprv +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/javacard/api_2_bte_cprv.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cprv/javacard/api_2_bte_cprv.cap new file mode 100644 index 0000000000000000000000000000000000000000..e783f54188a1c22342d741b9e8ea335853268b17 GIT binary patch literal 5755 zcmcgwdvKK16+hqop8LL=Y<8Cax2hQI9c+OcrU;{pjviyxmdV*1Q!xusKPPM=mh=kbxH({3CC zXnm}-Dw^j#xarEkx=wrXkBj%6X$l?A_l!PKJG8&+)Y~s@o_h6*ogZzVoc+&pU)#pa zx_+ST$aD8kT(~8AdB(!0hDtfd$Ju7(?|4#b_}jP5Kl}2~0Db?Dw(2Iw@Bh4aOT|U& zchf6B|J@6r11HB0$+_U~n0;+eV_L3^;ps&aRvpL4Ri3?&kKE{OFAd86Uj) z%E|C_k9F|hug#J=vKFO36Bz%euf9A!sBY5xYXbi}<#pUQeChn1AJh#V_R6-+;o-#} z54qpu+rFdr=xc{ZmG5f#VaL=b4$VLO2^n6nc!W*(s8oObfxYb)+rHg>)p2mw&R0v^ z&b-?4g)QHFwm^H0E?J{Q0JgeY^g4ZksqEM7&+83`rPnKU(Kz&JonP_d7WQu`bnqh!iou=j`sa8Tv>bY(>J#L z+g4VhYAgRJ?OY`Qgk^v-RHB)yjw$iR-mZfF*kUvWX;~-`$c+SRBDs;OswIm zaNUCgj8Z%0lyG=SFv2iJa2ZY~fB@$c&v)X|>J_sQgi&fh)1MAkRdXN-X37RZUcv2% zpf+PwAs}pml+&=+(3Q@+y61zC$l~fZ+p~i>&S(Ns@+v5*T3QqFFO8I;WiW}zD0?pf z5RoJ#KoXD$(eVY_3cyjZUKEgssDq}k{-_Cr=Tszuga?h4rwhogl7FR*@*93^$fBH9OSU>CZAz_ z0oymgAzE~|I0WmzfL-haD(2~b5HEsVvVu*@!uEH1o-`cWB}nstO5^oW(jt6chvUD+ z_HrEG4tCiFHaQ#Hd-ZA==gZ^kCn>)GyYjrgQkB52IFs~tFv%_XwXAiZ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7V5r74Mc_{a>JiqmSXaMV~ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/Api_2_Bte_Cpyv_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/Api_2_Bte_Cpyv_1.java new file mode 100644 index 0000000..f71e188 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/Api_2_Bte_Cpyv_1.java @@ -0,0 +1,328 @@ +//----------------------------------------------------------------------------- +//Ape_2_Bte_Cpyv_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_cpyv; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Cpyv_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + byte bArray[] = null; + byte dstBuffer[] = null; + + /** + */ + private Api_2_Bte_Cpyv_1 () { + } + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Cpyv_1 applet = new Api_2_Bte_Cpyv_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + // + + boolean bRes = false; + + BERTLVEditHandler bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + try { + bte_handler.setTag((byte) 0x01); + //-------------- TESTCASE 1 -------------- + //- initialize the handler & select a TLV + byte testCaseNb = (byte) 0x01; + bArray = new byte[]{(byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82,(byte) 0x02, (byte) 0x81,(byte)0x82}; + bte_handler.appendArray(bArray, (short) 0, (short) 9); + bte_handler.findTLV((byte) 0x81, (byte) 0x01); + //copyValue() with null dstBuffer + try { + bte_handler.copyValue((short)0,null,(short)0,(short)1); + } + catch (NullPointerException exp) { + bRes = true; + } + this.reportTestOutcome(testCaseNb, bRes); + } + catch (Exception exp) { + bRes = false; + this.reportTestOutcome(testCaseNb, bRes); + } + //-------------- TESTCASE 2 -------------- + //- dstOffset > dstBuffer.length + try{ + bRes=false; + testCaseNb=(byte)0x02; + bArray = new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x0D,(byte)0x10,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02, + (byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A, + (byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E}; + bte_handler.clear(); + // - initialize the handler + bte_handler.appendArray(bArray,(short)0,(short)24); + bte_handler.setTag((byte)0x01); + bte_handler.findTLV((byte)0x0D,(byte)0x01); + dstBuffer = new byte[]{(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04}; + //- dstOffset > dstBuffer.length + try{ + bte_handler.copyValue((short)0,dstBuffer,(short)6,(short)0); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 3 -------------- + //-dstOffset < 0 + try{ + bRes=false; + testCaseNb=(byte)0x03; + bte_handler.copyValue((short)0,dstBuffer,(short)-1,(short)1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 4 -------------- + //-dstLength>dstBuffer.length + try{ + bRes=false; + testCaseNb=(byte)0x04; + bte_handler.copyValue((short)0,dstBuffer,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 5 -------------- + //-dstOffset + dstLength>dstBuffer.length + try{ + bRes=false; + testCaseNb=(byte)0x05; + bte_handler.copyValue((short)0,dstBuffer,(short)3,(short)3); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 6 -------------- + //-dstLength < 0 + try{ + bRes=false; + testCaseNb=(byte)0x06; + bte_handler.copyValue((short)0,dstBuffer,(short)0,(short)-1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 7 -------------- + //-valueOffset > Text String Length + try{ + bRes=false; + testCaseNb=(byte)0x07; + bArray = new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x06,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x04}; + bte_handler.clear(); + // - initialize the handler + bte_handler.appendArray(bArray,(short)0,(short)17); + bte_handler.setTag((byte)0x01); + bte_handler.findTLV((byte)0x0D,(byte)0x01); + dstBuffer = new byte[15]; + for (short i=0; i<(short)15; i++){dstBuffer[i]=(byte)i;} + try{ + bte_handler.copyValue((short)7,dstBuffer,(short)0,(short)0); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 8 -------------- + //- valueOffset < 0 + try{ + bRes=false; + testCaseNb=(byte)0x08; + bte_handler.findTLV((byte)0x0D,(byte)0x01); + bte_handler.copyValue((short)-1,dstBuffer,(short)0,(short)1); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 9 -------------- + //- dstLength> Text String length + try{ + bRes=false; + testCaseNb=(byte)0x09; + bte_handler.findTLV((byte)0x0D,(byte)0x01); + bte_handler.copyValue((short)-1,dstBuffer,(short)0,(short)7); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 10 -------------- + //- valueOffset + dstLength > Text String + try{ + bRes=false; + testCaseNb=(byte)0x0A; + bte_handler.findTLV((byte)0x0D,(byte)0x01); + bte_handler.copyValue((short)2,dstBuffer,(short)0,(short)5); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 11 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0B; + bArray = new byte[]{(byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, + (byte) 0x02, (byte) 0x81, (byte) 0x82}; + bte_handler.clear(); + // - initialize the handler + bte_handler.appendArray(bArray, (short) 0, (short) 9); + bte_handler.setTag((byte) 0x01); + try{ + bte_handler.copyValue((short)2,dstBuffer,(short)0,(short)5); + } + catch(ToolkitException exp){ + if (exp.getReason()== ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 12 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0C; + + bArray = new byte[]{(byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F}; + bte_handler.clear(); + // - initialize the handler + bte_handler.appendArray(bArray, (short) 0, (short) 28); + bte_handler.setTag((byte) 0x01); + + + + bte_handler.findTLV((byte) 0x0D, (byte) 0x01); + dstBuffer = new byte[17]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 17, (byte) 0x55); + if (bte_handler.copyValue((short) 0, dstBuffer, (short) 0, (short) 17) == (short) 17) { + bRes = true; + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 13 -------------- + //- Compare Buffer + try { + bRes = false; + testCaseNb = (byte) 0x0D; + if (Util.arrayCompare(bArray,(short)11,dstBuffer,(short)0,(short)17)==(byte)0x00){ + bRes=true; + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 14 -------------- + try{ + bRes=false; + testCaseNb=(byte)0x0E; + dstBuffer= new byte[20]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 20, (byte) 0x55); + if(bte_handler.copyValue((short)2,dstBuffer,(short)3,(short)12)==(short) 15){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb, bRes); + //-------------- TESTCASE 15 -------------- + //- compare buffer + try { + bRes = false; + testCaseNb = (byte) 0x0F; + byte compareBuff[] = new byte[]{(byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x01, + (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, + (byte) 0x09, (byte) 0x0A, (byte) 0x0B, (byte) 0x0C, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, + (byte) 0x55, (byte) 0x55}; + + if(Util.arrayCompare(compareBuff,(short)0,dstBuffer,(short)0,(short)20)==(byte)0x00){ + bRes=true; + } + + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb, bRes); + + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/Test_Api_2_Bte_Cpyv.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/Test_Api_2_Bte_Cpyv.java new file mode 100644 index 0000000..4e51734 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/Test_Api_2_Bte_Cpyv.java @@ -0,0 +1,82 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Cpyv.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_cpyv; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Cpyv extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_cpyv"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Cpyv(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" // V Maximum number of services + + ); + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "0FCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/applet.opt new file mode 100644 index 0000000..17c6356 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_cpyv.Api_2_Bte_Cpyv_1 +uicc.test.toolkit.api_2_bte_cpyv +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/javacard/api_2_bte_cpyv.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_cpyv/javacard/api_2_bte_cpyv.cap new file mode 100644 index 0000000000000000000000000000000000000000..9ddde9414861613728df20a9e0a674f4286e8eec GIT binary patch literal 4741 zcmbtX3vd(H6}`Lf?XINNN>3ll!ot|lGIdI8V`GT;sMr_`#(Yfpq-kl0FbW6^*4W|` zhXz?B*onc=Nk0Kfpqat^#@G#%FqASh)MTKO5K3lB7;pk@(he;J(lpb78uz}nL1<%I zt6k~deZRfu-SghveYc{VP&b(Hm%U)sNO$$ z?<_#;6Vt2X!@Vb7y_HpW+17F7`sKQk7V~clpWSw2%9xy%S@l1f@cBn=?fZ%bUcdH< zRygzS@pJFIIBCcq_r-6{ZyC~@bJA0wO|EHK0}a2twrjD&uARIxuIc2&e-_MGz3xRy082a{CI`>?Aedk|mF02WTUT=F!>5*oP1(!E%TsReetO;OLtk2VYty>W zgwJB}pLdPP8u|O&+7E`EdMQV|^Re*S>CxHrnQ3>)D=bo~7O^`2&_8<*%>B*MuG34q zGXHY^;kNuxeLIQaM*Z7cVN z*OH2I#k6z6_|A0#Ktuwlz(us^OUD=S-jVLHnONgeh_W(VS(z6N)kgE8)zwwY!qL27 zB)p(t!NO>0L1pB*Re4K;tAdrmnnih2Lcv9$n%v4@M1YLWv)wlYk%GW>p%F7k-FUs6 zjpbyx`l93i8iK7{9!Kdv+{AEAs4`kz^BhMMAqz54+%N+cf=50C7TAI2cB9}W2?p4W zXU6>`9Xq(B=4EjtQWc7FOag9$cLE5|p6uVde`{Pj3qiP~22{2@QeC41QJ5hah`fd7 zL_yhww}k@2Cb8_qRzs6ZZ|WHjLh=+(4GMIGu%F8ql>RS4N%e}_XmCZe0(S;yL_+Sp zBF+qjpa6;>#!z8d2G~mKiGU)K7?@<<9yf#VqJko#pp$V8E!uLQEC!@>*o3JGInK&QIi(^jld9aBaVlHtz z-dnJK4DTISzXUeY02=u**u_s`C&+Frx5qNcIk1yI#0F6UcA6f`q@(cuQ?Szgc%K@p zqDMiar()NoHqfMFv2^JI-aBK%WEC{o6Wc8BL0snD2o^7C1Qfw5G>9mqjuvbNDXoE4^Y`3kf=W(v%&s=Li_;}i~9pimQX2t0OJh}qOVmX%-l@DY4fpq+DyPD zj`iUtqRkSxz$;jg&)1xSu=W*TaXu2sgcY*kQc zI7eo~88bT{#c=-2!8@ELR4%>lX1pPd@fHs=qfTcQ)Ly2d9>A=qGjzi~X5-E^3*gjr z7ri|$_E6ygl}4AUv6(D9xQ#={}dG>H+@WLCFDMT_8gjqI~kX5Ssz3)PQ`;Y@rn50eNK}f zOpwRSUwVWoy+l3o8B5YL62h4N+aoF`IrXSYY`oss>fLw`W7>K-k^7{?`v1h10~hf> ztuBTZk0GZXRW3cM+LdZJ=oW7v2kkL_iej-Z6mcZv-a4w_i5YSD6lj= zUgl!JGgJ~+GH!ka_r8g5eVNCE!pSk|EzhC6~=Upo?_Xl zYnQHZety2vy6^73e5y-6E-ZWZ;#(SiD7lPI>5Dr%8jOZ3OT(cm{bOjtGuneI8RO+W z(z#vO$0aq4CqmCotFAJ|KhYsORHgf}Rq!{(3?mL291)N7#*3w5Ga@ju_3t+H&@ zmZ92wT#qojveX^sY*9;BMe0%&UU68;MNCh+s@D5(sal zgkVfGj5x+DAb}IbUDSV1O77 compareBuffer.length + try { + bRes = false; + testCaseNb = (byte) 0x04; + compareBuffer = new byte[15]; + Util.arrayFillNonAtomic(compareBuffer, (short)0, (short)15,(byte)0xFF); + try{ + bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)0); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + //- compareOffset + length > compareBuffer + try { + bRes = false; + testCaseNb = (byte) 0x05; + compareBuffer = new byte[20]; + Util.arrayFillNonAtomic(compareBuffer, (short)0, (short)20,(byte)0xFF); + try{ + bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)5); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x06; + //- initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F }; + bte_handler.appendArray(bArray,(short)0,(short)28); + //select a tlv tag 0x02 + bte_handler.findTLV((byte)0x02,(byte)0x01); + //find and compare value with tlv tag 0x03 + try{ + bte_handler.findAndCompareValue((byte)0x03,compareBuffer,(short)5); + } + catch(ToolkitException ex){ + if (ex.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + try{ + //call the getValueLength() method + bte_handler.getValueLength(); + } + catch(ToolkitException e){ + if (ex.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7 -------------- + //- initialize the handler + try{ + bRes = false; + testCaseNb = (byte) 0x07; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F }; + bte_handler.appendArray(bArray,(short)0,(short)28); + //- initialize the compareBuffer + compareBuffer = new byte[]{ + (byte)0x04, (byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06, + (byte)0x07, (byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x0F}; + //- compare buffers + if(bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)0)==(byte)0x00){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8 -------------- + //- verify current TLV + try{ + bRes = false; + testCaseNb = (byte) 0x08; + if (bte_handler.getValueLength()==(short)17){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x09; + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06, + (byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x10}; + //-compare the buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)0)==(short)-1){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x0A; + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x03,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06, + (byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x0F}; + //-compare the buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)0)==(short)1){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x0B; + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x55,(byte)0x55,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04, + (byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C, + (byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x55}; + //-compare the buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)2)==(short)0){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x0C; + //append a Text String TLV + buffer = new byte[]{(byte)0x00,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55}; + bte_handler.appendTLV((byte)0x0D,buffer,(short)0,(short)6); + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x55,(byte)0x55,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04, + (byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C, + (byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x55}; + //-compare the buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)2)==(short)0){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 13 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x0D; + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x55,(byte)0x55,(byte)0x04,(byte)0x10,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04, + (byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C, + (byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x55}; + //-compare the buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)2)==(short)-1){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 14 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x0E; + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x55,(byte)0x55,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04, + (byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C, + (byte)0x0D,(byte)0x0D,(byte)0x10,(byte)0x55}; + //-compare the buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,compareBuffer,(short)2)==(short)1){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 15 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x0F; + //-initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F }; + bte_handler.appendArray(bArray,(short)0,(short)28); + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06, + (byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x0F}; + //-successful call (tag 0x8D) + if((short)bte_handler.findAndCompareValue((byte)0x8D,compareBuffer,(short)0)==(short)0){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 16 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x10; + buffer=new byte[]{ + (byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07, + (byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + //-append tag 0x0F + bte_handler.appendTLV((byte)0x0F,buffer,(short)0,(short)16); + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07, + (byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + //-successful call (tag 0x8F) + if((short)bte_handler.findAndCompareValue((byte)0x8F,compareBuffer,(short)0)==(short)0){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 17 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x11; + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x00,(byte)0x99,(byte)0x01,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07, + (byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + //-successful call (tag 0x8F) + if((short)bte_handler.findAndCompareValue((byte)0x8F,compareBuffer,(short)0)==(short)1){ + bRes=true; + } + } + catch (Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + } + + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/Test_Api_2_Bte_Facrb_Bs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/Test_Api_2_Bte_Facrb_Bs.java new file mode 100644 index 0000000..b7b28da --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/Test_Api_2_Bte_Facrb_Bs.java @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Facrb_Bs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_facrb_bs; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +public class Test_Api_2_Bte_Facrb_Bs extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_facrb_bs"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Facrb_Bs(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "11CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC " + + "CCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/applet.opt new file mode 100644 index 0000000..15273b0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_facrb_bs.Api_2_Bte_Facrb_Bs_1 +uicc.test.toolkit.api_2_bte_facrb_bs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/javacard/api_2_bte_facrb_bs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrb_bs/javacard/api_2_bte_facrb_bs.cap new file mode 100644 index 0000000000000000000000000000000000000000..c697477af5c86349589ea48735535cb3e18e9747 GIT binary patch literal 6338 zcmeHL3vg7`8UF9R=f3uJ&n7p!n+Fh59#fq>3MgwrC=duB1QH%fc_o`=kr*IrvLL3Q zn?QLCkOUDdR9h4VW$J>%U~EeTq1aIn#Mfek*#h0>d(2}Y5ncF`l7x1sbLFuUY&5C`TnbKKivQC*BF-oFi! z=4Z@m-Wy0uZoO#!K1<7g_~@_8CLWxxpAGD5+iT=T3<@6D{Cn}$an3}DF z4({1;u;QKV8I_k;958of7nw`Sf^jbnY7>icTPFcKXYdG z)iZrd_NV;t+xl zot-~7N++q>VaKIQs|A3SGC(OB(#Fll40*G)y`T?{82OQwRRx2&kx*SEH&RoxxVkEm z8wgjG4=JyVgvu8Ng0+?9m36s~2bKqdf!YPR6GDLnq1v2aAS^)I`IGHe1(AS2ci~1l z$n97*WMaQN8i|ycIf`nQ)hO z(ZH|0G|AxrV3fFJOG1%FH47M=>d<{c9XNyra0#AhSXd8+SOG3E3{=<_y&yh`<4xcc zzXw!Y6U`7`#__v2{t(9pqS@kkFeCy_DH+FCqS;a!j<17*0JsSr)g%er(%|T)Bohph z-7r+H1VgTg`s5ARZjY{1OfZ!G*!}?9*P@%%0x;AG(W9CUhUSSjYp-B?DB7ft1w$`u z7;0M!hHY!~H}(h^_J-&R`#+GMQNB&!@JZ_dN$?5lL?j7`Aj$RekY-Q|eSP|F0xiea zXW-X~hXl0rji84e>ApT>w1;d28;P-YpR}6nC zNZ3uW6@=AnA6XBqVG`^Y_QOW-@V>lWh)GQXn9ewEdIGqN1)Vyvwo!_;UB$|QEK(;j zOkM1|f$UStKDafkk|-M|^9hr(nG~vH?V&cTz0{7ik2jVVKTU3Vv@U2Z4?J>b+x_S{N34Va0Zf71Y(e*B$AF6?G@N-$PclCudNHhn@un~rLv9Gg7?)`lyB&rib95}b9&k6AyNN7OrAY?U;OEhQ zqcqMQG|jG)|BR}8b4gbZ+0Eetmw?4|;P_Y3Yv6%jqi;w;LCCcH8>ykFx61AHC_scMPM#gx@pMBY{X&u(&F;m_IW# z=y>nrK45vtcn2%f`r%uLQQ|n$LJKF?1QDxdDSOW7`1U?>lCYBFBrfqGQM9>LNmPlb zz9@=@Xd_0)khplO;*6yyi|TItnN3PI*^-XoB9S;cMo!*Th{V#V?OHKFB=ueWx~^sT zwPQWs{MK%BL=x;;JGWyA%vQBK7p1T2auCfV`Zw)9m$uvO^d@j>1Z^XOSlmE15op-I5&pq*&C+zKR;Rl{SEB*-W!Ds|hVlURQp}JsgRT%RiO!0Pj zgXJGU!l$d$AU10FV&%n;llUPYAK&;8_eGIO9kwVFq#;y3R5VH$C5|qgB#0&^Z@RLIx2LICR1%| zRupTlDUNa~VH9iT$%a^j&<-<9Hu@Lg+&stt literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/Api_2_Bte_Facrbbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/Api_2_Bte_Facrbbs_Bss_1.java new file mode 100644 index 0000000..b54c5a1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/Api_2_Bte_Facrbbs_Bss_1.java @@ -0,0 +1,568 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Facrbbs_Bss_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_facrbbs_bss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Facrbbs_Bss_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + byte bArray[] = null; + BERTLVEditHandler bte_handler = null; + byte compareBuffer[] = null; + byte buffer[] = null; + + /** + */ + private Api_2_Bte_Facrbbs_Bss_1 () { + } + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Facrbbs_Bss_1 applet = new Api_2_Bte_Facrbbs_Bss_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + bArray= new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x82}; + bte_handler.appendArray(bArray,(short)0,(short)9); + compareBuffer = new byte[5]; + //- FindAndCopyValue() with a null compareBuffer + try{ + bte_handler.findAndCompareValue((byte)0x01,(byte)0x01,(short)0,null,(short)0,(short)3); + } + catch(NullPointerException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x02; + //- initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x10, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E }; + bte_handler.appendArray(bArray,(short)0,(short)27); + compareBuffer = new byte[5]; + Util.arrayFillNonAtomic(compareBuffer, (short) 0, (short) 5,(byte) 0xFF); + //- compareOffset > compareBufffer.length + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)6,(short)0); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x03; + //-compareOffset < 0 + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)-1,(short)1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x04; + //- compareLength > compareBuffer.length + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x05; + //- compareOffset+compareLength > compareBuffer.length + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)3,(short)3); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x06; + //- compareLength < 0 + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)-1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x07; + //- initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x06, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04 }; + bte_handler.appendArray(bArray,(short)0,(short)17); + compareBuffer = new byte[15]; + Util.arrayFillNonAtomic(compareBuffer, (short) 0, (short) 15,(byte) 0xFF); + // valueOffset > Text String Length + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)7,compareBuffer,(short)0,(short)0); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x08; + // valueOffst < 0 + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)-1,compareBuffer,(short)0,(short)1); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x09; + // compareLength > Text Strign length + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)7); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0A; + //valueOffset+compareLength > Text String length + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)2,compareBuffer,(short)0,(short)5); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0B; + //- invalid Parameter + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x00,(short)0,compareBuffer,(short)0,(short)5); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.BAD_INPUT_PARAMETER){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0C; + //- initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F }; + bte_handler.appendArray(bArray,(short)0,(short)28); + //- select a TLV (tag 0x02) + bte_handler.findTLV((byte)0x02,(byte)0x01); + //- findAndCompareValue + try{ + bte_handler.findAndCompareValue((byte)0x0D,(byte)0x02,(short)0,compareBuffer,(short)0,(short)0); + } + catch(ToolkitException ex){ + if (ex.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + try{ + //- Call the getValueLength() method + bte_handler.getValueLength(); + } + catch (ToolkitException e){ + if (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 13 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0D; + //- initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F }; + bte_handler.appendArray(bArray,(short)0,(short)28); + //-initialize compareBuffer + compareBuffer = new byte[]{ + (byte) 0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte) 0x05, (byte)0x06, + (byte) 0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte) 0x0D,(byte)0x0E, + (byte) 0x0F}; + //- findAndCompareValue + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)17)==(short)0){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 14 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0E; + //-verify current TLV + if(bte_handler.getValueLength()==(short)17){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 15 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x0F; + //- initialize compareBuffer + compareBuffer = new byte[]{ + (byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte) 0x05, (byte)0x06, + (byte) 0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte) 0x0D,(byte)0x0E, + (byte)0x10}; + //- findAndCompareValue + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)17)==(short)-1){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 16 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x10; + //- initialize compareBuffer + compareBuffer = new byte[]{ + (byte)0x03,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte) 0x05, (byte)0x06, + (byte) 0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte) 0x0D,(byte)0x0E, + (byte) 0x0F}; + //- findAndCompareValue + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)17)==(short)1){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 17 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x11; + //- initialize compareBuffer + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05, + (byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x55, + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55 }; + //- compare buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)2,compareBuffer,(short)3,(short)12)==(short)0){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 18 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x12; + //- initialize compareBuffer + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x02,(byte)0x01,(byte)0x03,(byte)0x04,(byte)0x05, + (byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x55, + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55 }; + //- compare buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)2,compareBuffer,(short)3,(short)12)==(short)-1){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 19 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x13; + //-initialize the compareBuffer + compareBuffer=new byte[]{ + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05, + (byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0A,(byte)0x0D,(byte)0x55, + (byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55 }; + //- compare buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)2,compareBuffer,(short)3,(short)12)==(short)1){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 20 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x14; + buffer = new byte[]{(byte)0x00,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55}; + //- append a Text String TLV + bte_handler.appendTLV((byte)0x0D,buffer,(short)0,(short)6); + //- initialize compareBuffer + compareBuffer=new byte[]{ + (byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06, + (byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x0F}; + //- compare buffers + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)17)==(short)0){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 21 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x15; + //- initialize compareBuffer + compareBuffer = new byte[]{(byte)0x00,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55}; + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x02,(short)0,compareBuffer,(short)0,(short)6)==(short)0){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 22 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x16; + //- initialize compareBuffer + compareBuffer = new byte[]{(byte)0x00,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x66}; + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x02,(short)0,compareBuffer,(short)0,(short)6)==(short)-1){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 23 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x17; + //- initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F }; + bte_handler.appendArray(bArray,(short)0,(short)28); + //-initialize compareBuffer + compareBuffer = new byte[]{ + (byte) 0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte) 0x05,(byte)0x06, + (byte) 0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte) 0x0D,(byte)0x0E, + (byte) 0x0F}; + //- successful call (with tag 0x8D) + if((short)bte_handler.findAndCompareValue((byte)0x8D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)17)==(short)0){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 24 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x18; + buffer = new byte[]{ + (byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07, + (byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + //- append a TLV (tag 0x0F) + bte_handler.appendTLV((byte)0x0F,buffer,(short)0,(short)16); + //- initialize compareBuffer + compareBuffer=new byte[]{ + (byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07, + (byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + //- successful call (with tag 0x8F) + if((short)bte_handler.findAndCompareValue((byte)0x8F,(byte)0x01,(short)0,compareBuffer,(short)0,(short)16)==(short)0){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 25 -------------- + try { + bRes = false; + testCaseNb = (byte) 0x19; + //- initialize compareBuffer + compareBuffer=new byte[]{ + (byte)0x04,(byte)0x00,(byte)0x99,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06, + (byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E, + (byte)0x0F}; + if((short)bte_handler.findAndCompareValue((byte)0x0D,(byte)0x01,(short)0,compareBuffer,(short)0,(short)17)==(short)1){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/Test_Api_2_Bte_Facrbbs_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/Test_Api_2_Bte_Facrbbs_Bss.java new file mode 100644 index 0000000..5b35021 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/Test_Api_2_Bte_Facrbbs_Bss.java @@ -0,0 +1,85 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Facrbbs_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_facrbbs_bss; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Facrbbs_Bss extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_facrbbs_bss"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Facrbbs_Bss(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "19CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC " + + "CCCCCCCC CCCCCCCC CCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/applet.opt new file mode 100644 index 0000000..ec237f9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_facrbbs_bss.Api_2_Bte_Facrbbs_Bss_1 +uicc.test.toolkit.api_2_bte_facrbbs_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/javacard/api_2_bte_facrbbs_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facrbbs_bss/javacard/api_2_bte_facrbbs_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..5aec8db3646f32565560e675edc5fc34f78de292 GIT binary patch literal 7266 zcmeHM3s6+o8UF9N&wbvruH4gqgFF9HL1l%q8M!_Q=MkgNuxD&npo3jLegqFX>1ysPFf%IKWAB2?nIEyn3>M> zGXFXEJpbqU&fcGr>7wKY4gUt0u1PMTCS|0iQE)U@oMI%cc&XKe+YH=n*ner2S*`lIan zbN@c~SmM$7d5fyPcOVOIVxx1^QsxOQOo_zU`m z&-QL@o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zqFu1LLe$DZQA`+r>T0oS*(AE5Vu>ptcf8VOZALNcCo z1#w747}6LDDIA4VjzStoAqz(#D@P$4M@of#5)Mmi)X`4%Bg z60eFxm592BH7p7ZHx<3B?$(w`xL+pfQbKfMRlRH)c1LQTsomADK1Ybvs<_?ZVb-i9 ziZk4D@M=k9@7piI$P9ep;>fpO1{3M_`oWQD_!6E*y6wM^NM(^J{_qs|zN+2JqYRXs zc1d$fmaKT6Q+rOQK9A4KN!Kb})Z+D8ygpvyi>|$hht6X0;7h=x`__2Zc$+*;-X`y) zfM>F2GMf&Y`rUjiZyn+s9logAk^UCYX>Z$^meq?^O!EwyGVKxf0L}G|E zXqX)0Pdawuz$Ahdfpifo5z-~BB!gfg7Gy*0Y!Jr4RGxjse5p_Zd60@Dn7|Z5FxRmb zhGHWT#=`_i$4pi_{!QuZ#1&IYa- zG8x3NR6drQEo76NlIa3*W6m^^*S|AI%<}r(pSxxG*)GVd}Q_<|Q znUOh#9A%V;2JbVYZV6>GFLS~;%Ii!lyrSu2Gb3}RILc@&hEJcBisp^YjLeDND5F2d z!pNNVHM2A4W25Z$W1#g}uiQv>*38G8hK=$`zysH3KGCGCnUVQkiZWW^j)9TsmNIiQ sUrkYN7h~aOx~RdstBuffer.length + try{ + bte_handler.findAndCopyValue((byte)0x0D,dstBuffer,(short)21); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + //- dstOffst<0 + try{ + bRes = false; + testCaseNb = (byte) 0x03; + + //-dstOffset>dstBuffer.length + try{ + bte_handler.findAndCopyValue((byte)0x0D,dstBuffer,(short)-1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + //- length > dstBuffer.length + try{ + bRes = false; + testCaseNb = (byte) 0x04; + dstBuffer = new byte[15]; + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)15,(byte)0xFF); + //-dstOffset>dstBuffer.length + try{ + bte_handler.findAndCopyValue((byte)0x0D,dstBuffer,(short)0); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + //- DstOffset + length > dstBuffer.length + try{ + bRes=false; + testCaseNb=(byte)0x05; + dstBuffer = new byte[20]; + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)20,(byte)0xFF); + try{ + bte_handler.findAndCopyValue((byte)0x0D,dstBuffer,(short)5); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x06; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x11,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B, + (byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + + bte_handler.appendArray(bArray,(short)0,(short)28); + bte_handler.setTag((byte)0x01); + bte_handler.findTLV((byte)0x02,(byte)0x01); + + try{ + bte_handler.findAndCopyValue((byte)0x03,dstBuffer,(short)0); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + try{ + //call the getValueLength Method + bte_handler.getValueLength(); + } + catch(ToolkitException ex){ + if (ex.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7 -------------- + //- initialize the handler + try{ + bRes = false; + testCaseNb = (byte) 0x07; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x11,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B, + (byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + + bte_handler.appendArray(bArray,(short)0,(short)28); + dstBuffer = new byte[17]; + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)17,(byte)0xFF); + if(bte_handler.findAndCopyValue((byte)0x0D,dstBuffer,(short)0)==(short)17){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8 -------------- + //-compare buffer + try{ + bRes = true; + testCaseNb =(byte)0x08; + for (short i=0;i<17; i++){ + if (bArray[(short)(11+i)]!=dstBuffer[i]){bRes=false;} + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x09; + dstBuffer = new byte[20]; + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)20,(byte)0x55); + //-successful call + if (bte_handler.findAndCopyValue((byte)0x0D,dstBuffer,(short)2)==(short)19){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 10 -------------- +// - compare the buffer + try { + bRes = true; + testCaseNb = (byte) 0x0A; + for (short i = 0; i < 17; i++) { + if (bArray[(short)(11 + i)] != dstBuffer[(short)(i + 2)]) { + bRes = false; + } + } + if (dstBuffer[0] != (byte) 0x55 || dstBuffer[1] != (byte) 0x55 || dstBuffer[19] != (byte) 0x55) { + bRes = false; + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x0B; + bte_handler.clear(); + bArray = new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F}; + bte_handler.appendArray(bArray, (short) 0, (short) 28); + bte_handler.setTag((byte) 0x01); + //-append a 2nd Text String TLV + bte_handler.appendTLV((byte) 0x0D, (byte) 0xFF); + dstBuffer = new byte[17]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 17, (byte) 0x55); + // -successfull call + if(bte_handler.findAndCopyValue((byte)0x0D,dstBuffer,(short)0)==(short)17){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12 -------------- + //-compare the buffer + try { + bRes = true; + testCaseNb = (byte) 0x0C; + for (short i=0;i<17; i++){ + if (bArray[(short)(11+i)]!=dstBuffer[i]){bRes=false;} + } + } + catch (Exception exp) { + bRes = false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 13 -------------- + //- initialize the handler + try{ + bRes = false; + testCaseNb = (byte) 0x0D; + bte_handler.clear(); + bArray = new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F}; + bte_handler.appendArray(bArray, (short) 0, (short) 28); + bte_handler.setTag((byte) 0x01); + dstBuffer = new byte[17]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 17, (byte) 0x55); + //- successful call (tag 0x8D) + if(bte_handler.findAndCopyValue((byte)0x8D,dstBuffer,(short)0)==(short)17){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 14 -------------- + //- compare the buffer + try{ + bRes = true; + testCaseNb = (byte) 0x0E; + for (short i=0;i<17; i++){ + if (bArray[(short)(11+i)]!=dstBuffer[i]){bRes=false;} + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 15 -------------- + //- append tag (0x0F) + try{ + bRes = false; + testCaseNb = (byte) 0x0F; + dstBuffer = new byte[16]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 16, (byte) 0x55); + byte buffer[]={ + (byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07, + (byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + bte_handler.appendTLV((byte)0x0F,buffer,(short)0,(short)16); + if(bte_handler.findAndCopyValue((byte)0x8F,dstBuffer,(short)0)==(short)16){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 16 -------------- + //- compare the buffer + try{ + bRes = true; + testCaseNb = (byte) 0x10; + for (short i=0;i<16; i++){ + if (bArray[(short)(12+i)]!=dstBuffer[i]){bRes=false;} + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + } + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/Test_Api_2_Bte_Facyb_Bs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/Test_Api_2_Bte_Facyb_Bs.java new file mode 100644 index 0000000..1c11647 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/Test_Api_2_Bte_Facyb_Bs.java @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Facyb_Bs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_facyb_bs; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Facyb_Bs extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_facyb_bs"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Facyb_Bs(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "10CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC " + + "CC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/applet.opt new file mode 100644 index 0000000..9cc5639 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_facyb_bs.Api_2_Bte_Facyb_Bs_1 +uicc.test.toolkit.api_2_bte_facyb_bs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/javacard/api_2_bte_facyb_bs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facyb_bs/javacard/api_2_bte_facyb_bs.cap new file mode 100644 index 0000000000000000000000000000000000000000..0673369cc3b55decf4ff0aa06cccacc103024d3b GIT binary patch literal 5573 zcmdT|dvH|M8UOCN?|q)lF3DvBF;K`1I7tvOYz>PEF(8kGKq8b;8aK-_gd}81Rw)tm zCNL)DZHro&)-oU#rM48PpfZfkpq4?(fRtisDPrr0I*@+nF3V;w5#~DMADrYn zkMEv)e&>6f`<-vACh~$06#UDpee53SQG6gkMR`qW{`ktVg%zch8=$1v?rzx@1;wiB+mcb-4dR<>C^JYx2`3l9wS9ewG~69#;9ar&{ET_lf9gj+t{$ZySUmrO*Sb2TQ=u2i9~ro)@0M?CE;ZRs zyt6B(;=qW_jfaQ4v-IMEwNJ!1e)_Z5GJkg<+Y=KPwxHSvs>%m`ophFJKu#j zJ{k0^cx1)b4Ld)jWuGkG1Q)aob2|NJ&R+g#OWU|t>}6MuYVV6f8-Kd})qCf!ZLPTT z^rVA(l-)0$+V<-4!H-La>JCgE?XgeiWOcgzrGIbRF+x~V#Lav0@`Ua8z5k2-_g&t% z_wE4;OZFXm;cV569;1b^d=E&F)rh8^QzL`252|rhPT$@|UiiC2uY`ujVxsjhrz)`(M>x`wGT=*{67X(Zlug_l`cksiEw` z@!heeU$vb(-Tm2=nR7RdyWDjsOPH3C8~@C8S?7R?&AJ9ViZ7nv_2dzj73^wg|X)5#)kS> zVJKQ(JG{0o7O9;b3NNgyt!piu8+t4h4z|5<6=^95hoT(#PrlcEfg=KNbUiMl zg4m7a=egKVhm8DX>au~zWmJr04f6i_mPk0(+_I3N61W5WNIs~9I>=Q0VB@lJ$!$nj zM9u_#r18w(vhV>T>(Z7+qm7Xm!{xzel9B@sK1`SM$bY&PO+g?=*1^U%MVng;Faat> zlTts&B?%|5$EJ=$=roOIAlJn58mz>8;L^8g`+fa|2tH>t8p)bD%9`i3#zOOARp>2D zGa}kSBLF;-fCNY!5+OQva4Z4r;oEr*iSRlo661HMz%7-L2oeh0;RI<3UZNl)?AO%-|T%h$IJVeM8LQ3{>P@;}(t-ny3DJ%yS z$F}SxB3VVi0d3+yV;uq45j`BN1kYN4j7~nz3pgR8uSV51_8?E&13^Iw1Vtebl<0s! zQ04X0c+UCU*=wh<S8-`<8CQs4?GH18I+B^2E#`grw>)J&ZIW1 zv#1?wjXJRIYb@-iE<=`89C)1xk+PE_T~my2jlENd3q19am5^B+=czL;&_1^mSL)&t zbIC2I%1krvB#yfW&aJhouy=diqjF1JYV7fv>`6!H_dPA-L8bmc77EgA>b~xC{n88+ z=S5)^Mhb$KkNx|Da`I+e{l8^(5WL zbA$U(PwztGIn^lo4}Vt<^)zX5LhU)FgX2QZ;JFezu`>u4J=fbwrfRy=(Fao}Lo^IP zy*GihB_aJONU^jB=vlPmVESN#H!cXQwc~;FVkfb!UUy`_ZaaW^~@ZO6yfsE0gE{rmAv%A62=T$J68)qY3LUMv%vVBw#!eF&s%4 zePj$q3X43F5sPFa7AZz7QjJ(-Gh&h5h(!(~7CDVrl-ts8s0~Ms?Q-J9j#1F^1+O|5iq(h5)<+tRdzS)<`BdG#A=?$?sqCCB5&;%u-xesTqHnKb@n&LOcnFv3tw?^sPU>2JRa9?b+>U4o0Jptli-6kFZ6zwGQHbj8_UIjXIJ@l z(xKoD-Y7-L#0LRPMldNU;<4d%Ojj{a(fRHU*aIa-3c*s>4`B=x;uB0KIT5NAuaPlo zFdRle5nlU?U{rTE&M(1vShGYoQK0-ffUq7mZ3~R!3<^o f@TH(Csa2`cKZ8{hMf{}&z>a@EK|4(Mu+jekO)2a) literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/Api_2_Bte_Facybbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/Api_2_Bte_Facybbs_Bss_1.java new file mode 100644 index 0000000..5f7f605 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/Api_2_Bte_Facybbs_Bss_1.java @@ -0,0 +1,504 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Facybbs_Bss_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_facybbs_bss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Facybbs_Bss_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + byte bArray[] = null; + BERTLVEditHandler bte_handler = null; + byte dstBuffer[] = null; + + /** + */ + private Api_2_Bte_Facybbs_Bss_1 () { + } + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Facybbs_Bss_1 applet = new Api_2_Bte_Facybbs_Bss_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + bArray= new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x02}; + bte_handler.appendArray(bArray,(short)0,(short)9); + //- FindAndCopyValue() with a null dstBuffer + try{ + bte_handler.findAndCopyValue((byte)0x01,null,(byte)0x00); + } + catch(NullPointerException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + //-dstOffset > dstBuffer.length + try{ + bRes = false; + testCaseNb = (byte) 0x02; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x10,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B, + (byte)0x0C,(byte)0x0D,(byte)0x0E}; + bte_handler.appendArray(bArray,(short)0,(short)27); + dstBuffer = new byte[5]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 5, (byte) 0xFF); + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)0,dstBuffer,(short)6,(short)0); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + //-dstOffset > 0 + try{ + bRes = false; + testCaseNb = (byte) 0x03; + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)0,dstBuffer,(short)-1,(short)1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + //dstLength>dstBuffer.length + try{ + bRes = false; + testCaseNb = (byte) 0x04; + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)0,dstBuffer,(short)0,(short)6); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + //dstOffset+dstBuffer.length + try{ + bRes = false; + testCaseNb = (byte) 0x05; + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)0,dstBuffer,(short)3,(short)3); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + //dstLength<0 + try{ + bRes = false; + testCaseNb = (byte) 0x06; + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)0,dstBuffer,(short)0,(short)-1); + } + catch(ArrayIndexOutOfBoundsException exp){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x07; + //-initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x06,(byte)0x04,(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03, + (byte)0x04}; + bte_handler.appendArray(bArray,(short)0,(short)17); + dstBuffer = new byte[15]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 15, (byte) 0xFF); + //- valueOffset > Text String Length + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)7,dstBuffer,(short)0,(short)0); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8 -------------- + //- valueOffset < 0 + try{ + bRes = false; + testCaseNb = (byte) 0x08; + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)-1,dstBuffer,(short)0,(short)1); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9 -------------- + //- dstLength> Text String Length + try{ + bRes = false; + testCaseNb = (byte) 0x09; + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)0,dstBuffer,(short)0,(short)7); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10 -------------- + //- valueOffset + dstLength > Text String length + try{ + bRes = false; + testCaseNb = (byte) 0x0A; + try{ + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)2,dstBuffer,(short)0,(short)5); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11 -------------- + //- valueOffset + dstLength > Text String length + try{ + bRes = false; + testCaseNb = (byte) 0x0B; + //-initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F}; + bte_handler.appendArray(bArray,(short)0,(short)28); + + //- findAndCopyValue() + try{ + bte_handler.findTLV((byte)0x02,(byte)0x01); + bte_handler.findAndCopyValue((byte)0x0D,(byte)0x02,(short)2,dstBuffer,(short)0,(short)0); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + //- call the getValueLength() method + try{ + bte_handler.getValueLength(); + } + catch(ToolkitException tlkexp){ + if(ex.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x0C; + //-initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F}; + bte_handler.appendArray(bArray,(short)0,(short)28); + dstBuffer = new byte[17]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 17, (byte) 0xFF); + if( bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)0,dstBuffer,(short)0,(short)17)==(short)17){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 13 -------------- + //- compare buffer + try{ + bRes = true; + testCaseNb = (byte) 0x0D; + for (short i=0;i<17; i++){ + if (bArray[(short)(11+i)]!=dstBuffer[i]){bRes=false;} + } + } + catch(Exception exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 14 -------------- + try{ + bRes=false; + testCaseNb=(byte)0x0E; + //-initialize dstBuffer + dstBuffer = new byte[20]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 20, (byte) 0x55); + //-successful call + if(bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)2,dstBuffer,(short)3,(short)12)==(short)15){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 15 -------------- + //-compare the buffer + try{ + bRes=true; + testCaseNb=(byte)0x0F; + for (short i = 0; i < 12; i++) { + if (bArray[(short)(13 + i)] != dstBuffer[(short)(i + 3)]) { + bRes = false; + } + } + for (short i=0; i<3; i++){ + if(dstBuffer[i]!=(byte)0x55){bRes=false;} + } + for (short i=19; i>14; i--){ + if(dstBuffer[i]!=(byte)0x55){bRes=false;} + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 16 -------------- + try{ + bRes=false; + testCaseNb=(byte)0x10; + byte[] buffer={(byte)0x00,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55}; + dstBuffer = new byte[17]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 17, (byte) 0xFF); + //-append a text string TLV + bte_handler.appendTLV((byte)0x0D,buffer,(short)0,(short)6); + + //-successful call + if(bte_handler.findAndCopyValue((byte)0x0D,(byte)0x01,(short)0,dstBuffer,(short)0,(short)17)==(short)17){ + bRes=true; + } + + } + catch(Exception exp){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 17 -------------- + //-compare the buffer + try{ + bRes=true; + testCaseNb=(byte)0x11; + for (short i = 0; i < 17; i++) { + if (bArray[(short)(11 + i)] != dstBuffer[(short)(i)]) { + bRes = false; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 18 -------------- + try{ + bRes=false; + testCaseNb=(byte)0x12; + dstBuffer = new byte[6]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 6, (byte) 0xFF); + //-successful call + if(bte_handler.findAndCopyValue((byte)0x0D,(byte)0x02,(short)0,dstBuffer,(short)0,(short)6)==(short)6){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 19 -------------- + //-compare the buffer + try{ + byte[] buffer={(byte)0x00,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55}; + bRes=true; + testCaseNb=(byte)0x13; + for (short i = 0; i < 6; i++) { + if (buffer[(short)i] != dstBuffer[(short)(i)]) { + bRes = false; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 20 -------------- + try{ + bRes=false; + testCaseNb=(byte)0x14; + //- initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ + (byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x82, (byte) 0x02, (byte) 0x81, + (byte) 0x02, (byte) 0x0D, (byte) 0x11, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, + (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, + (byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F}; + bte_handler.appendArray(bArray,(short)0,(short)28); + dstBuffer = new byte[17]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 17, (byte) 0xFF); + if( bte_handler.findAndCopyValue((byte)0x8D,(byte)0x01,(short)0,dstBuffer,(short)0,(short)17)==(short)17){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 21 -------------- + //-compare the buffer + try{ + bRes=true; + testCaseNb=(byte)0x15; + for (short i = 0; i < 17; i++) { + if (bArray[(short)(11 + i)] != dstBuffer[(short)(i)]) { + bRes = false; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 22 -------------- + try{ + bRes=false; + testCaseNb=(byte)0x16; + byte buffer[] = {(byte)0x00,(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07, + (byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F}; + //-append tag 0x0F + bte_handler.appendTLV((byte)0x0F,buffer,(short)0,(short)16); + dstBuffer = new byte[16]; + Util.arrayFillNonAtomic(dstBuffer, (short) 0, (short) 16, (byte) 0xFF); + //-successful call(with tag 0x8F); + if( bte_handler.findAndCopyValue((byte)0x8F,(byte)0x01,(short)0,dstBuffer,(short)0,(short)16)==(short)16){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 23 -------------- + //-compare the buffer + try{ + bRes=true; + testCaseNb=(byte)0x17; + for (short i = 0; i < 16; i++) { + if (bArray[(short)(12 + i)] != dstBuffer[(short)(i)]) { + bRes = false; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + } + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/Test_Api_2_Bte_Facybbs_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/Test_Api_2_Bte_Facybbs_Bss.java new file mode 100644 index 0000000..4fc013b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/Test_Api_2_Bte_Facybbs_Bss.java @@ -0,0 +1,81 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Facybbs_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_facybbs_bss; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Facybbs_Bss extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_facybbs_bss"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Facybbs_Bss(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "17CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + return testresult; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/applet.opt new file mode 100644 index 0000000..7b1a73d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_facybbs_bss.Api_2_Bte_Facybbs_Bss_1 +uicc.test.toolkit.api_2_bte_facybbs_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/javacard/api_2_bte_facybbs_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_facybbs_bss/javacard/api_2_bte_facybbs_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..8423b7c9028f191b47b6d2e5023c82efc1f2491a GIT binary patch literal 6232 zcmds5e^6A%9sj<4zu$3pdvL-7RH#OxQACk2X9>m=WmE!#8YgwEAqO0RC~yMRiW%pD zQAtHK){beKR8nhFXT+#uvC&o?jcwv+O07R*>Wnp(shYGJlFXP?`rUUN2XBbV<*)X= z`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W)?kkn&Kijc!?mKJ4SHTVp}33{#~OeM_ovJt GN4 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/Api_2_Bte_Find_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/Api_2_Bte_Find_1.java new file mode 100644 index 0000000..974e638 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/Api_2_Bte_Find_1.java @@ -0,0 +1,207 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Find_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_find; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +// + +import javacard.framework.ISOException; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +/** + * @author ghartbrod + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class Api_2_Bte_Find_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + /** + */ + private Api_2_Bte_Find_1 () { + } + + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Find_1 applet = new Api_2_Bte_Find_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short arg0) throws ToolkitException { + byte bArray[]= {(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x83}; + // Result of test + + + BERTLVEditHandler bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + //-------------- TESTCASE 1-------------- + //- initialize the handler & bad invalid input parameter + testCaseNb= (byte)0x01; + + try{ + bte_handler.appendArray(bArray,(short)0,(short)9); + bte_handler.findTLV((byte)0x81,(byte)0x00); + } + catch(ToolkitException exp){ + if(exp.getReason()==ToolkitException.BAD_INPUT_PARAMETER){ + bRes=true; + } + } + + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2-------------- + //- Search 1st TLV + bRes=false; + testCaseNb=(byte)0x02; + + if(bte_handler.findTLV((byte)0x01,(byte)0x01)==TLV_FOUND_CR_SET){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3-------------- + //- call the getValueLength()method + bRes=false; + testCaseNb=(byte)0x03; + if(bte_handler.getValueLength()==(short)3){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4-------------- + //- Search 2st TLV + bRes=false; + testCaseNb=(byte)0x04; + if(bte_handler.findTLV((byte)0x02,(byte)0x01)==TLV_FOUND_CR_SET){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5-------------- + //- call the getValueLength()method + bRes=false; + testCaseNb=(byte)0x05; + if(bte_handler.getValueLength()==(short)2){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6-------------- + //- Search a wrong tag + bRes=false; + testCaseNb=(byte)0x06; + //select a TLV (tag 02h) + if (bte_handler.findTLV((byte) 0x02, (byte) 0x01) == TLV_FOUND_CR_SET) { + if (bte_handler.findTLV((byte) 0x03, (byte) 0x01) == TLV_NOT_FOUND) { + bRes = true; + } + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7-------------- + //- call the getValueLength() method + bRes=false; + testCaseNb=(byte)0x07; + try{ + bte_handler.getValueLength(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8-------------- + //- Search a tag with wrong occurrence + bRes=false; + testCaseNb=(byte)0x08; + if(bte_handler.findTLV((byte)0x01,(byte)0x02)==TLV_NOT_FOUND){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 9-------------- + //- call the getValueLength() method + bRes=false; + testCaseNb=(byte)0x09; + try{ + bte_handler.getValueLength(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 10-------------- + //- append a TLV with tag 02h & search it + bRes=false; + testCaseNb=(byte)0x0A; + bte_handler.appendTLV((byte)0x02,(byte)0x00); + if(bte_handler.findTLV((byte)0x02,(byte)0x02)==TLV_FOUND_CR_NOT_SET){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 11-------------- + //- append a TLV with tag 04h & search it + bRes=false; + testCaseNb=(byte)0x0B; + bte_handler.appendTLV((byte)0x04,(byte)0x00); + if(bte_handler.findTLV((byte)0x04,(byte)0x01)==TLV_FOUND_CR_NOT_SET){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 12-------------- + //- Search tag 0x81h + bRes=false; + testCaseNb=(byte)0x0C; + if(bte_handler.findTLV((byte)0x81,(byte)0x01)==TLV_FOUND_CR_SET){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 13-------------- + //- Search tag 0x84h + bRes=false; + testCaseNb=(byte)0x0D; + if(bte_handler.findTLV((byte)0x84,(byte)0x01)==TLV_FOUND_CR_NOT_SET){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + + + + } + + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/Test_Api_2_Bte_Find.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/Test_Api_2_Bte_Find.java new file mode 100644 index 0000000..1d34a41 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/Test_Api_2_Bte_Find.java @@ -0,0 +1,82 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Find.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_find; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Find extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_find"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Find(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "0DCCCCCC CCCCCCCC CCCCCC CCCCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/applet.opt new file mode 100644 index 0000000..5ec3714 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_find.Api_2_Bte_Find_1 +uicc.test.toolkit.api_2_bte_find +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/javacard/api_2_bte_find.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_find/javacard/api_2_bte_find.cap new file mode 100644 index 0000000000000000000000000000000000000000..af3735f5764353973e04a949f1c4a7f5ecd0e9eb GIT binary patch literal 3530 zc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X?t%3|Q z5roGv-?n(J!-_nPYI0&^7@#xb*(vi97@A|%q*4aFNn)@m8AB@7<2PT^R|%vKE6{U1 zFIBOs2$rA8aw?fZPzy>Q1ch3qPz%0_7w}|6;xEvhJw2yi#t;MqMnvdQCd*c9t+6{X z0}*c&u$DxBU@!_Y4YY^HC_{>yCZUINGhPoyvZ=nUA^9*7^k5(Y7@A5TosPko0Ff{W zo`poO7bT~n1lA;P!ZcFj^Eoh5Ix0m{q1#LeZ2L4WtwIOXEGAW;GtBuEt-%EN=oa>5 ziYK?Q!1A;^8POttxckAb1AZ+h(6P{0%YQi#Gl*{heuk+Sk3(k&xDSX)#QEM&vO6pi zfA$wMh!ee^Ap&O#%_!WijN#>(8EG7`=TR*{( zun7FwSIi&|gnovVcq~JAK@=9nG~!t3r|AoeMid#vG~yWLr#Zxj<4s`1GUrS1k_Mo_ MUka{!lZ>?f15hZEDgXcg literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/Api_2_Bte_Gcap_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/Api_2_Bte_Gcap_1.java new file mode 100644 index 0000000..79f1f54 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/Api_2_Bte_Gcap_1.java @@ -0,0 +1,92 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Gcap +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gcap; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Gcap_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + BERTLVEditHandler bte_handler = null; + byte buffer[] = null; + + /** + */ + private Api_2_Bte_Gcap_1 () { + } + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Gcap_1 applet = new Api_2_Bte_Gcap_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x10); + bte_handler.setTag((byte)0x01); + //- 1.call get Cappacity() + if (bte_handler.getCapacity() == (short) 0x10) { + //- 2.fill the handler + buffer = new byte[0x0E]; + Util.arrayFillNonAtomic(buffer, (short) 0, (short) 0x0E, (byte) 0xFF); + bte_handler.appendTLV((byte) 0x0D, buffer, (short) 0, (short) 0x0E); + //- 3.clear() + bte_handler.clear(); + //- 4. fill the handler with the maximim capacity plus one + try { + buffer = new byte[0x0F]; + Util.arrayFillNonAtomic(buffer, (short) 0, (short) 0x0F, (byte) 0xFF); + bte_handler.appendTLV((byte) 0x0D, buffer, (short) 0, (short) 0x0F); + } + catch (ToolkitException ex) { + if (ex.getReason() == ToolkitException.HANDLER_OVERFLOW) { + bRes = true; + } + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/Test_Api_2_Bte_Gcap.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/Test_Api_2_Bte_Gcap.java new file mode 100644 index 0000000..4c859dd --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/Test_Api_2_Bte_Gcap.java @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Gcap.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gcap; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Gcap extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_gcap"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Gcap(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession("13"); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + "01CC"); + // delete applet and package + test.reset(); + test.terminalProfileSession("13"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/applet.opt new file mode 100644 index 0000000..b6a9bbe --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_gcap.Api_2_Bte_Gcap_1 +uicc.test.toolkit.api_2_bte_gcap +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/javacard/api_2_bte_gcap.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gcap/javacard/api_2_bte_gcap.cap new file mode 100644 index 0000000000000000000000000000000000000000..d481981990da0cdc97028e38c1d04a9632792bf5 GIT binary patch literal 3128 zcmb7`3rtg27{|YJ?(GxW-b$$zWP-2AREo%^hz}}?52Qh0BF==>+Ck;f0+mG^%0sOL zMdo9Ra|U$AM<(JDl+Da%!ZLAY@wJdmn8U=W=zJ`jj%={+ba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)hZNrEXDt*}`k5@pBIMP0g%u zAG>g4Luu^2hlkR;A9h*{*WUf^SW5A{{<sO zYfdXs+(=lI+VR1MJtdJdwv*bmzT+=8oH(oT-%43=u%)HF^R+*w#PwWGuep@cw>6oq zTP>XIa+=4EZdvwl{h#f*Z$DYpdvd-{e`I0){+^=!J-;0p8FtX{-pa)LeK&Jv^gef8 z)oF>o{DLFWd1%GD%{w2g+hjK;r`_z$+atO<;_5H8{k5ml|I5WA=bvdfGqUKbHSZrQ zitT*IdHhPXr(xFerAd<;_FXhy%030fg}kck^Onq72Eb1M>m1Px?it;^fsg&Uaag00 zjk3&Pvt@|(8Zkq3yIoF)m|^ue%CgGJMSIy2m%Tcp%DUWYvwABsp0-;n?A~;n)x*Gu z@6Y;wWmp1?(1DYvLE*<|Z9M)D#+l~U?j4P-R3@Md9cOlU?KaWveU%bf7zHCx3}A+7 z5Y1G81~PFv5d|N@$gmYv*G*4g2bIuPY4Uhnc9AkUFvwQN00Tns`sS3M-#QB+R6+yI ze%a&p4uS}n<&M0C)3FTSfkiok*dQ+t!&X^SB(?+_27QtDP1s6hGRn{$pXaWw5v|o? zF`ftN2L*aOoW&{FM#N&N#DZ($sIXiksFY0tr=)#8H7J{DsX<{;0I**jY}ml_(_4n) zEL6s$gkYGPXf`V5hDJE`iOSP3!4j2hVrdd{fG ziXsPq6Vz=4!t{?61hq3j<C_E@`a(mXx(dyO#$bJH z2poXbz!8E{zCuLcl7ogYAPuPtJ|fNw-+rRQoux7g0SY*LaZRjGg%^Te zTZs4juqkoSoitVpkPNxB1Fw$-CNNR-KZHX(jQ0CcFA@6_Aq5h#mOmf6fmzsIR)?Qil(M-u=5 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/Api_2_Bte_Gtsz_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/Api_2_Bte_Gtsz_1.java new file mode 100644 index 0000000..b40d104 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/Api_2_Bte_Gtsz_1.java @@ -0,0 +1,135 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Gtsz_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gtsz; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +// +import javacard.framework.*; +import uicc.toolkit.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.ToolkitException; + +/** +* Test Area : uicc.toolkit.BERTLVViewHandler.getSize() method +* +* @version 1.0.0 - XX/07/04 +*/ +public class Api_2_Bte_Gtsz_1 extends TestToolkitApplet { + + private byte ba[] = new byte[(short)272]; + + + + /** + */ + private Api_2_Bte_Gtsz_1 () { + } + + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Gtsz_1 applet = new Api_2_Bte_Gtsz_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //initialze byte array with fill value + Util.arrayFillNonAtomic(applet.ba,(short)0,(short)272,(byte)0xFF); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + /** + * + * @param event - the type of event to be processed. + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //allocate a BERTLVEditHandler + BERTLVEditHandler bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x114); + //set BERTag of handler to 0x01 + bte_handler.setTag((byte)0x01); + //-------------- TESTCASE 1-------------- + //- tag 0x01, data length 0x22 + bte_handler.appendArray(ba, (short)0, (short)0x22); + if(bte_handler.getSize()==(short)0x24){ + this.reportTestOutcome((byte)0x01,true); + } + else{ + this.reportTestOutcome((byte)0x01,false); + } + bte_handler.clear(); + //-------------- TESTCASE 2 -------------- + //- tag 0x01, data length 0x7F + bte_handler.appendArray(ba, (short)0, (short)0x7F); + if(bte_handler.getSize()==(short)0x81){ + this.reportTestOutcome((byte)0x02,true); + } + else{ + this.reportTestOutcome((byte)0x02,false); + } + bte_handler.clear(); + //-------------- TESTCASE 3 -------------- + //- tag 0x01, data length 0x80 + bte_handler.appendArray(ba, (short)0, (short)0x80); + if(bte_handler.getSize()==(short)0x83){ + this.reportTestOutcome((byte)0x03,true); + } + else{ + this.reportTestOutcome((byte)0x03,false); + } + bte_handler.clear(); + //-------------- TESTCASE 4 -------------- + //- tag 0x01, data length 0xFF + bte_handler.appendArray(ba, (short)0, (short)0xFF); + if(bte_handler.getSize()==(short)0x102){ + this.reportTestOutcome((byte)0x04,true); + } + else{ + this.reportTestOutcome((byte)0x04,false); + } + bte_handler.clear(); + //-------------- TESTCASE 5 -------------- + //- tag 0x01, data length 0x100 + bte_handler.appendArray(ba,(short)0,(short)0x100); + if(bte_handler.getSize()==(short)0x104){ + this.reportTestOutcome((byte)0x05,true); + } + else{ + this.reportTestOutcome((byte)0x05,false); + } + bte_handler.clear(); + //-------------- TESTCASE 6 -------------- + //- tag 0x01, data length 0x110 + bte_handler.appendArray(ba,(short)0,(short)0x110); + if(bte_handler.getSize()==(short)0x114){ + this.reportTestOutcome((byte)0x06,true); + } + else{ + this.reportTestOutcome((byte)0x06,false); + } + bte_handler.clear(); + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/Test_Api_2_Bte_Gtsz.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/Test_Api_2_Bte_Gtsz.java new file mode 100644 index 0000000..1fdd440 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/Test_Api_2_Bte_Gtsz.java @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Gtsz.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gtsz; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccToolkitService; + +public class Test_Api_2_Bte_Gtsz extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_gtsz"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Gtsz(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "06CCCCCC CCCCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + return testresult; + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/applet.opt new file mode 100644 index 0000000..60397ac --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_gtsz.Api_2_Bte_Gtsz_1 +uicc.test.toolkit.api_2_bte_gtsz +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/javacard/api_2_bte_gtsz.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gtsz/javacard/api_2_bte_gtsz.cap new file mode 100644 index 0000000000000000000000000000000000000000..c672f5ae2d42474820e216f5ab9b7413c43ed931 GIT binary patch literal 3177 zcmb7G3rtg282<00Zwf`*T0rC}DhNejQ#2Dh5M)s7z|29mbfr|NJX+w+N2imA+p-{F z_V6`KSf);$CUZk)Fg`|D5wj#}%|M)z>;Zm!oE!}kL z-TN`VUqa6vyWMj#?&2G+$jl3C5~KAO_n&z#uHSxoU|)RWO{3YKQHl{F{A^u5|# zeZ8&z;i&!PgQMIB=|AQiZM63e{56vN$<%`E%Y9QyTs<8vMe34+3;U~<4=p=1_GLol zQ1UCYhANr&cOTuh3w}sE)2X-L9H}lZ9aGrH3X&4TW}ANg?sLb+I~fHhGkQAWd*{z+ zDeU2%g~7gSAMFY28Je!!e78ik@a$^Ck&2un6{o-Qr5`Wd|L4wMyH8w(di#Nd9a-fs zRnN2@T02~JeELr-|41xv+oy#vJkJj zoldjhY8K3b$5U797R(N>+n!;s6kPUdq1k6%?O5Y*I-07?%Uq5sS5unP;bkE5`g#8y zhUJ0L^`a3K$o$yej>UVa+^DSI7LTI@^AUl|<++<&PQlZ(o+z>q1CaXCAetQLsns#SfKIx;;>vG#7N7`0a6*OkUQg4w z5D$5DAn&6&mQnO#SIMBPB+658lp30fBT~oqrZ3O5;3&aDMBstX^)xgKjt0So=YhmQ zh7k{A(FEIqve?V9<61camTLi}yj91^$y}QXtteci*=$RG%AZ>%n%##2S46nNBFooNdw zP2r4gtL826@fqE~KC=b5G*k4iq zKSAKfu++7x*yBVUPXjq2DojMG(3FsvImsz0DKJMC%7=#V8kL4uXyh8DOd}6b%0lRi zRwa}Ab7~}N$6EALP3%@i$M?;X_2n*6 zWYxq1m!V@VwjzerV|sq_kubRck&gsv`@c^HVnsc%Xa7~KL@TFoiGhbmEM2q$U7tjS zRE%2S3X*C?i_q0b6xkD$h*+Cw1-cB03R*6hWr#(IR-o&NsIV_61-iP>I&^sub#m|& z1->D!4ldH?_b literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/Api_2_Bte_Gvby_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/Api_2_Bte_Gvby_1.java new file mode 100644 index 0000000..df067bd --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/Api_2_Bte_Gvby_1.java @@ -0,0 +1,198 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Gvby_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gvby; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +// +import javacard.framework.*; +import uicc.toolkit.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.ToolkitException; + + + +/** +* Test Area : uicc.toolkit.BERTLVViewHandler.getSize() method +* +* @version 1.0.0 - XX/09/04 +*/ +public class Api_2_Bte_Gvby_1 extends TestToolkitApplet { + + byte bArray[]= {(byte)0x81,(byte)0x03,(byte)0x01,(byte)0xFF,(byte)0xFE,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0xFD}; + + byte baFillValue[]= new byte[240]; + + /** + */ + private Api_2_Bte_Gvby_1 () { + } + + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Gvby_1 applet = new Api_2_Bte_Gvby_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /** + * + * @param event - the type of event to be processed. + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //Result of test + boolean bRes = false; + //test case number + byte testCaseNb= (byte)0x01; + + for (short i=0; i<(short)240; i++ ){ + baFillValue[i]=(byte)i; + } + + //allocate a BERTLVEditHandler + BERTLVEditHandler bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + //set BER Tag 0x01 + bte_handler.setTag((byte)0x01); + + //-------------- TESTCASE 1-------------- + //- initialize the handler + //getValueByte(0) + try{ + bte_handler.appendArray(bArray,(short)0,(short)9); + bte_handler.getValueByte((short)0); + } + catch(ToolkitException exp){ + if(exp.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2-------------- + //- TLV 1, getValuebyte(3) + bRes=false; + testCaseNb=(byte)0x02; + bte_handler.findTLV((byte)0x01,(byte)0x01); + try{ + bte_handler.getValueByte((short)3); + } + catch (ToolkitException exp){ + if (exp.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3-------------- + //- TLV 1, getValueByte(2) + bRes=false; + testCaseNb=(byte)0x03; + bte_handler.findTLV((byte)0x01,(byte)0x01); + if (bte_handler.getValueByte((short)2)==(byte)0xFE){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4-------------- + //- TLV 2, getValueByte(0) + bRes=false; + testCaseNb=(byte)0x04; + bte_handler.findTLV((byte)0x02,(byte)0x01); + if (bte_handler.getValueByte((short)0)==(byte)0x81){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //--------------------------------------- + //prepare the byte array for test case 5 + bArray= new byte[138]; + Util.arrayCopy(new byte[]{(byte)0x81,(byte)0x03,(byte)0x01, + (byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x7F,(byte)0x04},(short)0,bArray,(short)0,(short)12); + Util.arrayCopy(baFillValue,(short)0,bArray,(short)12,(short)126); + //-------------- TESTCASE 5-------------- + //- initialize the handler + bRes=false; + testCaseNb=(byte)0x05; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bte_handler.appendArray(bArray,(short)0,(short)138); + //- TLV 0D, getValueByte(7E) + bte_handler.findTLV((byte)0x0D,(byte)0x01); + if(bte_handler.getValueByte((short)0x7E)==(byte)0x7D){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //--------------------------------------- + //prepare the byte array for test case 6 + bArray= new byte[140]; + Util.arrayCopy(new byte[]{(byte)0x81,(byte)0x03,(byte)0x01, + (byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x81,(byte)0x80,(byte)0x04},(short)0,bArray,(short)0,(short)13); + Util.arrayCopy(baFillValue,(short)0,bArray,(short)13,(short)127); + //-------------- TESTCASE 6-------------- + bRes=false; + testCaseNb=(byte)0x06; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bte_handler.appendArray(bArray,(short)0,(short)140); + //- TLV 0D, getValueByte(7E) + bte_handler.findTLV((byte)0x0D,(byte)0x01); + if (bte_handler.getValueByte((short)0x7E)==(byte)0x7D){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 7-------------- + //getValueByte(0x7F) + bRes=false; + testCaseNb=(byte)0x07; + if (bte_handler.getValueByte((short)0x7F)==(byte)0x7E){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + //--------------------------------------- + //prepare the byte array for test case 8 + bArray= new byte[253]; + Util.arrayCopy(new byte[]{(byte)0x81,(byte)0x03,(byte)0x01, + (byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x81,(byte)0xF1,(byte)0x04},(short)0,bArray,(short)0,(short)13); + Util.arrayCopy(baFillValue,(short)0,bArray,(short)13,(short)240); + //-------------- TESTCASE 8-------------- + //- initialize the handler + bRes=false; + testCaseNb=(byte)0x08; + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bte_handler.appendArray(bArray,(short)0,(short)253); +// - TLV 0D, getValueByte(7E) + bte_handler.findTLV((byte)0x0D,(byte)0x01); + if (bte_handler.getValueByte((short)0xF0)==(byte)0xEF){ + bRes=true; + } + this.reportTestOutcome(testCaseNb,bRes); + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/Test_Api_2_Bte_Gvby.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/Test_Api_2_Bte_Gvby.java new file mode 100644 index 0000000..d68e470 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/Test_Api_2_Bte_Gvby.java @@ -0,0 +1,81 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Gvby.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gvby; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Gvby extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_gvby"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Gvby(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + //Install package + test.loadPackage(CAP_FILE_PATH ); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH , + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope to trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "08CCCCCC CCCCCCCC CC"); + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH ); + + return testresult; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/applet.opt new file mode 100644 index 0000000..a27dd55 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_gvby.Api_2_Bte_Gvby_1 +uicc.test.toolkit.api_2_bte_gvby +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/javacard/api_2_bte_gvby.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvby/javacard/api_2_bte_gvby.cap new file mode 100644 index 0000000000000000000000000000000000000000..e6f72d4dc7b33255f2dad2796115dc5fdc6d1c58 GIT binary patch literal 3725 zcmb_e3rrMO6umR^W_NaHXBiX_L6Qi}Ax1s!+Pgl+m}&zqUIciuVo zzM1=OW*SHQK)_=}&XSSvT=N408RMrX4o{t&5}A=WIW=W`*7S&slqcr_>ZfJcT_XaI zzyBz-^tN&Q?0>G8ChZb0#4OnQVB!$JtFns1_m?>4tw>$foefSB~>)j%J9Na5W52gfen6g_@uWBREvJ|BcN*6q1DV43FZ zyWdalZQ*7xT3xnSd%vzBhBS_1iu&J}R3CqN<9G2bXI_hrn3-_$`tt4Tw-#&}vuE?q zt{zO;0Z6~wYo0;wdyM&FSYvenY+KO&(T=RT6yLqg-S;*xs~cE3^u2=-B&TVv_`{K@ z6Xc>V51(6mYi8@ctlD1JvhVl5F=F?rvSoQ&YNXB9%jZo^;~s~$?Y>a=SR2y(tLyOE z*2Dfck8N&!y{c7vaBu9DwzRU}GT&%rGt;y}xzDH8cNl9mzNBb|18VL`q#(&EU^iOR`!+H&4plDjl=p=F81YAK!{InidBZ!3=1hDPK16CbFtV}! zMAK>N(`hOT&)aG|Y{N#BHEn4u;X6qo9D-;V1!deUh$c7ifC-=elaW4xWjigSN zu-D5guotyvj{0X<2fnfO3|`9yc{#n|Oacn1VL*~RLV>KEv5=)_>g44e4wQMwt9Hwi z{-Zp)+@f5Ly`fX2q==N{6&)gF8pxNatnQLZ&Lq<~%PTtcFZa;j_CM%veuaK~`#K$X zRhZjebO0af(AlKuEcMI^1(&XWE#b#ZF~+N`kma;E^Q|fQwnFy@E8utfta)-6T6TRh z1^=V)j$@i_LAu?FJoX}*6m+-``K1a&gZghz(s7}tR2>(VhFu?s(F&SGVl)sToahXK zC>nI4!Jw1yH&qe^Nw1f(C4>7cN!dnvB}$$uXTd4^DpW{eMsz(tCfiD^#rY20KdDF& zD(T(@941Pxf^`X)AKfjSCQSyy+g;!b!yv&usDmtsfJl0cNp&T}vsY;Dhi(v#$DsCh zv>b*O*wbAfOti=IDAX9s9N_c9HZU@2Fll4*!hlKOqGU}&Lo%C~nZ~ewxP?D0B%d!* zXd&s@UR74oS@fL?`?7*YndLY-*Y$`g<&By_UBf60!!ayfXYiLpsqO-hFxAUs4EaPkGgD7c+&7K>bfUMPm2gOfx22y2)^=) zK&c(n4C)-GFjxd{Tu@~^HH|vWDKw|OqERJ1HH|t?DKrH-Z@lr$TA67)mYDz|9wRXB I6WrPSU-7A|q5uE@ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/Api_2_Bte_Gvle_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/Api_2_Bte_Gvle_1.java new file mode 100644 index 0000000..fdc74cc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/Api_2_Bte_Gvle_1.java @@ -0,0 +1,190 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Gvle_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gvle; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +// +import javacard.framework.*; +import uicc.toolkit.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.ToolkitException; + +/** +* Test Area : uicc.toolkit.BERTLVViewHandler.getSize() method +* +* @version 1.0.0 - XX/07/04 +*/ + +public class Api_2_Bte_Gvle_1 extends TestToolkitApplet { + + + /** + */ + private Api_2_Bte_Gvle_1 () {} + + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Gvle_1 applet = new Api_2_Bte_Gvle_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + applet.init(); + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + // TODO Auto-generated method stub + byte bArray[]=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x82}; + // Result of test + boolean bRes = false; + byte testCaseNb= (byte)0x01; + + BERTLVEditHandler bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + //-------------- TESTCASE 1 -------------- + //- initialize the handler & getValueLength + try{ + bte_handler.appendArray(bArray,(short)0,(short)9); + bte_handler.getValueLength(); + } + catch(ToolkitException exp){ + if(exp.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + //- Call the appendTLV() method & search 0x0D tag + testCaseNb=(byte)0x02; + bRes=false; + bte_handler.appendTLV((byte)0x0D,bArray,(short)0,(short)0); + try { + bte_handler.findTLV((byte)0x0D,(byte)0x01); + if(bte_handler.getValueLength()==(short)0){ + bRes=true; + } + } + catch (Exception ex) { + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + //- Call the appendTLV() method & search 0x0D tag + testCaseNb=(byte)0x03; + bRes=false; + bArray=new byte[]{(byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x82, + (byte)0x0D,(byte)0x02,(byte)0x04,(byte)0x00}; + bte_handler.clear(); + bte_handler.appendArray(bArray,(short)0,(short)13); + + try { + bte_handler.findTLV((byte)0x0D,(byte)0x01); + if(bte_handler.getValueLength()==(short)0x02){ + bRes=true; + } + } + catch (Exception ex) { + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + //- Call the appendTLV() with tag 0x0D ,length 7F + testCaseNb=(byte)0x04; + bRes=false; + bArray=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x82,(byte)0x0D,(byte)0x7F,(byte)0x04}; + byte bFillArray[]=new byte[126]; + Util.arrayFillNonAtomic(bFillArray,(short)0,(short)126,(byte)0x00); + bte_handler.clear(); + bte_handler.appendArray(bArray,(short)0,(short)12); + bte_handler.appendArray(bFillArray,(short)0,(short)126); + try{ + bte_handler.findTLV((byte)0x0D,(byte)0x01); + if(bte_handler.getValueLength()==(short)127){ + bRes=true; + } + } + catch (Exception ex){ + bRes=false; + } + + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + //- Call the appendTLV() with tag 0x0D ,length 0x80 + testCaseNb=(byte)0x05; + bRes=false; + bArray=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x82,(byte)0x0D,(byte)0x81,(byte)0x80,(byte)0x04}; + bFillArray=new byte[127]; + Util.arrayFillNonAtomic(bFillArray,(short)0,(short)127,(byte)0x00); + bte_handler.clear(); + bte_handler.appendArray(bArray,(short)0,(short)13); + bte_handler.appendArray(bFillArray,(short)0,(short)127); + try{ + bte_handler.findTLV((byte)0x0D,(byte)0x01); + if(bte_handler.getValueLength()==(short)128){ + bRes=true; + } + } + catch(Exception ex){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 6 -------------- + //- Call the appendTLV() with tag 0x0D ,length F1 + testCaseNb=(byte)0x06; + bRes=false; + bArray=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0x82, + (byte)0x0D,(byte)0x81,(byte)0xF1,(byte)0x04}; + bFillArray=new byte[240]; + Util.arrayFillNonAtomic(bFillArray,(short)0,(short)240,(byte)0x00); + bte_handler.clear(); + bte_handler.appendArray(bArray,(short)0,(short)13); + bte_handler.appendArray(bFillArray,(short)0,(short)240); + try{ + bte_handler.findTLV((byte)0x0D,(byte)0x01); + if(bte_handler.getValueLength()==(short)241){ + bRes=true; + } + } + catch(Exception ex){ + bRes=false; + } + + this.reportTestOutcome(testCaseNb,bRes); + + + + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/Test_Api_2_Bte_Gvle.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/Test_Api_2_Bte_Gvle.java new file mode 100644 index 0000000..2955e20 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/Test_Api_2_Bte_Gvle.java @@ -0,0 +1,79 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Gvle.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gvle; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Gvle extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_gvle"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Gvle(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "06CCCCCC CCCCCC"); + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + return testresult; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/applet.opt new file mode 100644 index 0000000..20d8a0e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_gvle.Api_2_Bte_Gvle_1 +uicc.test.toolkit.api_2_bte_gvle +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/javacard/api_2_bte_gvle.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvle/javacard/api_2_bte_gvle.cap new file mode 100644 index 0000000000000000000000000000000000000000..890b8adf94ae0f0a58b022fe392c7174a82f69ea GIT binary patch literal 3729 zcmbtWX;4#F6h3c%+3-aYWEn=ms-Oc%6p2ErDT^`)qBy8bEyfT_l#&3EPTdI6;sS!5 zv16?RI%B6ptvXs!yZ&%*wXUt&cC1yWRqIl;Q`=evdTtEHJZp!vH}k#a-uuq?opW!_ zJq5W8s{;{#hLV~Tc%tcmg}kh(=7gO5?4&$%eol5);nc*u?5?8#+osHPc!uj154k+{ zx5|ZaXa3rKPqRKT@vFD&d&ZyHcW7knjwvg<9_Ul`D>G&;`l#+|`?c0)ZF82met*Y+ z5pNt+Ymbf6OrxhsmoC0*ESvH5u1~I4e7x%Pgg*^mj9Txp)z|NIe7~XI-gv)nc(LLK zM_gxd#-N;bY0JLC%ac0_>rzh+9KO0=YxS+Fh)b6Zd8Ov$%Uzz6ROl`B#_$i$Uzqdz zciS6}bWYpwbLXis>U)!H>AJQZ3qJeu#^B13w~MZTX%qz^$!0S3Hz1YjIn)&f0!{7z#l%ZV-9W?@=H$KrN$zUrOGU z2pR#v)NvHfQ}A^XZqX;Vq;~WR)e&fsU<4uvf#sI!YNCvXungqy1|^YZucN^uQc8~? z+ZM@={+X{b00hCUR-VmO<|rjp0^{Ogk2@5OVP5QThfxA3D2KZrwE`5h=nki2@!sZ+ zpbvn8$#X|AWjHQ{Hv+$aH8cZdY6LnlJbF+(8^&71s0Lu1>ZtH&)*Qw*0E_Qj)KZ|E zXb@llH&{}vQJEO2&S+wJqlsgUCSHm$ngqsZ5+#q(B=H%6Swnaj+rI(&aPcf-&~uU| zl3|)SQ1>CvY!d?-I?eZ?1!p_?IG*YGh9}=hn&7mWB!#3w-AdwuO2CVnF(!B^)Eci^ zjZdwdpCfVu1PERM>i;M}s(qv&L0Ym#MMAh9esu{sn(}VcpMt> ze}%@ouqw$-f+H9cq}m>RwNL5m2^P^;`wV?ra6ctb`hSb(Q+U^>Pz!f_67lKZG~)0x zMc#c%{do}n^Cm4B#ae&nVHU(NA z3Q6P<)2SWO7zN4ppoQnUyKz<=j^dS^`1qdSyBjd0rgCKi)=(1Lo-B+k8vxWeObT3k z#yHwskW0}zJidF1$tMdGQcMQ6XO))3iqf}Y|5VKQtsF-GdLJKuX(MNl*DrpC6gn7& zfNDlgBCl5bBwK?b@z*YL26>s{XVBv==zXC4MT?w4US;?hJ`9RMUUSHKewsT$(a5ryoJO9N{4{ln YV7v*;Q3bgiNjadx-*Ak3t~X8p4aIGzOaK4? literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/Api_2_Bte_Gvsh_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/Api_2_Bte_Gvsh_1.java new file mode 100644 index 0000000..1cee10a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/Api_2_Bte_Gvsh_1.java @@ -0,0 +1,229 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Gvsh_1 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gvsh; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.system.HandlerBuilder; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.BERTLVEditHandler; +import uicc.toolkit.ToolkitException; + +public class Api_2_Bte_Gvsh_1 extends TestToolkitApplet { + + boolean bRes = false; + byte testCaseNb = (byte) 0x00; + BERTLVEditHandler bte_handler = null; + byte bArray[] = null; + + /** + */ + private Api_2_Bte_Gvsh_1 () { + } + /** + * Create an instance of the applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Api_2_Bte_Gvsh_1 applet = new Api_2_Bte_Gvsh_1(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + //initialize the test applet values + applet.init(); + //register applet to event + applet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + //-------------- TESTCASE 1 -------------- + //- initialize the handler + try { + bRes = false; + testCaseNb = (byte) 0x01; + bte_handler = (BERTLVEditHandler) HandlerBuilder.buildTLVHandler(HandlerBuilder.BER_EDIT_HANDLER, (short) 0x100); + bte_handler.setTag((byte)0x01); + bArray=new byte[]{ (byte)0x81,(byte)0x03,(byte)0x01,(byte)0xFF,(byte)0xFE,(byte)0x82,(byte)0x02,(byte)0x81,(byte)0xFD}; + //-initialize the handler. + bte_handler.appendArray(bArray,(short)0,(short)9); + try{ + bte_handler.getValueShort((short)0); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.UNAVAILABLE_ELEMENT){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 2 -------------- + //- search TLV 0x01 (command details TLV) + try{ + bRes = false; + testCaseNb = (byte) 0x02; + bte_handler.findTLV((byte)0x01,(byte)0x1); + try{ + bte_handler.getValueShort((short)3); + } + catch(ToolkitException ex){ + if(ex.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES){ + bRes=true; + } + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 3 -------------- + //- search TLV 0x01 (command details TLV) + try{ + bRes = false; + testCaseNb = (byte) 0x03; + bte_handler.findTLV((byte)0x01,(byte)0x1); + if(bte_handler.getValueShort((short)1)==(short)0xFFFE){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 4 -------------- + //- search TLV 0x02 (Device Identities TLV) + try{ + bRes = false; + testCaseNb = (byte) 0x04; + bte_handler.findTLV((byte)0x02,(byte)0x1); + if(bte_handler.getValueShort((short)0)==(short)0x81FD){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 5 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x05; + bArray =new byte[138]; + byte temp[]=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x7F,(byte)0x04}; + for (short i=0; i<12;i++){ + bArray[i]=temp[i]; + } + for (short i=0; i<126;i++){ + bArray[(short)(i+12)]=(byte)i; + } + //-initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bte_handler.appendArray(bArray,(short)0,(short)138); + //-search TLV 0x0D (Text String TLV) + bte_handler.findTLV((byte)0x0D,(byte)0x1); + if(bte_handler.getValueShort((short)0x7D)==(short)0x7C7D){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 6 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x06; + bArray =new byte[140]; + byte temp[]=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x81,(byte)0x80,(byte)0x04}; + for (short i=0; i<13;i++){ + bArray[i]=temp[i]; + } + for (short i=0; i<127;i++){ + bArray[(short)(i+13)]=(byte)i; + } + //-initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bte_handler.appendArray(bArray,(short)0,(short)140); + //-search TLV 0x0D (Text String TLV) + bte_handler.findTLV((byte)0x0D,(byte)0x1); + if(bte_handler.getValueShort((short)0x7D)==(short)0x7C7D){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); +// -------------- TESTCASE 7 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x07; + if(bte_handler.getValueShort((short)0x7E)==(short)0x7D7E){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + //-------------- TESTCASE 8 -------------- + try{ + bRes = false; + testCaseNb = (byte) 0x08; + bArray =new byte[253]; + byte temp[]=new byte[]{ + (byte)0x81,(byte)0x03,(byte)0x01,(byte)0x21,(byte)0x00,(byte)0x82,(byte)0x02,(byte)0x81, + (byte)0x02,(byte)0x0D,(byte)0x81,(byte)0xF1,(byte)0x04}; + for (short i=0; i<13;i++){ + bArray[i]=temp[i]; + } + for (short i=0; i<240;i++){ + bArray[(short)(i+13)]=(byte)i; + } + //-initialize the handler + bte_handler.clear(); + bte_handler.setTag((byte)0x01); + bte_handler.appendArray(bArray,(short)0,(short)253); + //-search TLV 0x0D (Text String TLV) + bte_handler.findTLV((byte)0x0D,(byte)0x1); + if(bte_handler.getValueShort((short)0xEF)==(short)0xEEEF){ + bRes=true; + } + } + catch(Exception exp){ + bRes=false; + } + this.reportTestOutcome(testCaseNb,bRes); + + + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/Test_Api_2_Bte_Gvsh.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/Test_Api_2_Bte_Gvsh.java new file mode 100644 index 0000000..645c30a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/Test_Api_2_Bte_Gvsh.java @@ -0,0 +1,82 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Gvsh.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_bte_gvsh; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Api_2_Bte_Gvsh extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/toolkit/api_2_bte_gvsh"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 FF"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Api_2_Bte_Gvsh(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + //Install package + test.loadPackage(CAP_FILE_PATH); + //install applet 1 + response = test.installApplet( + CAP_FILE_PATH, + CLASS_AID_1, + APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" // V Maximum number of services + ); + test.reset(); + test.terminalProfileSession(TERMINAL_PROFILE); + + // unrecognizeEnvelope trigger test case 1 to 12 of applet 1 + test.unrecognizedEnvelope(); + // check test results + response = test.selectApplication(APPLET_AID_1); + testresult = response.checkData("10" +APPLET_AID_1 + + "08CCCCCC CCCCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/applet.opt new file mode 100644 index 0000000..849f5b1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_bte_gvsh.Api_2_Bte_Gvsh_1 +uicc.test.toolkit.api_2_bte_gvsh +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/javacard/api_2_bte_gvsh.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_bte_gvsh/javacard/api_2_bte_gvsh.cap new file mode 100644 index 0000000000000000000000000000000000000000..2644e4383d5176a577c6b63205f69877b1ac25b7 GIT binary patch literal 4073 zcmb_e4{%h)8UJ?QzPtDCU*5?jUJ@}7%~)tI7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R`a7!}zFiS3zampBuS8#Hff~S^& z{%gxu)i@HOr%>TXRN(O0yiN~V0)a(?jciAdU>}lZHoynu!2lYO7NpohEJ=l?qa#&Z zEqchrMMqXmEX)lC@hvSr#WS%jNSQgOOE+uxGAi!aBKeZdT9D+ZSiRZEuxbqJ!LRRO zUnRf3(DHvjLeh)kp9%Oc4;FhF#36>C5z&!p0&Tk@;Yl_ULWl{|5ZYu#$dQO3qUF*A z+FeCL49J8D7k&toGtn5@jzrA)h%l5n(HPo?M9fP3$AuqFs4JO`Qv4bq8jozu`)@OMe*sw| BDP8~o literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/Api_2_Ehs_Gthd_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/Api_2_Ehs_Gthd_1.java new file mode 100644 index 0000000..d439d3c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/Api_2_Ehs_Gthd_1.java @@ -0,0 +1,126 @@ +//----------------------------------------------------------------------------- +//Api_2_Ehs_Gthd_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_ehs_gthd; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.EnvelopeHandler; +import uicc.toolkit.EnvelopeHandlerSystem; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_ehs_gthd + * + * @version 0.0.1 - 2 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Api_2_Ehs_Gthd_1 extends TestToolkitApplet +{ + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + + /** + * Constructor of the applet + */ + public Api_2_Ehs_Gthd_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Ehs_Gthd_1 thisApplet = new Api_2_Ehs_Gthd_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : use th methode getTheHandler() Twice + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + EnvelopeHandler EnvHdlr1 = EnvelopeHandlerSystem.getTheHandler(); + EnvelopeHandler EnvHdlr2 = EnvelopeHandlerSystem.getTheHandler(); + + if (EnvHdlr1==EnvHdlr2 ) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : verify that the methode getTheHandler return EnvelopeHandler reference + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + EnvelopeHandler EnvHdlr1 = EnvelopeHandlerSystem.getTheHandler(); + + if (EnvHdlr1 instanceof EnvelopeHandler) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : verify that the methode getTheHandler does not return NULL + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + EnvelopeHandler EnvHdlr1 = EnvelopeHandlerSystem.getTheHandler(); + + if (EnvHdlr1!=null) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + } + } +} + + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/Test_Api_2_Ehs_Gthd.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/Test_Api_2_Ehs_Gthd.java new file mode 100644 index 0000000..c3495e2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/Test_Api_2_Ehs_Gthd.java @@ -0,0 +1,109 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Ehs_Gthd.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_ehs_gthd; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_ehs_gthd + * + * @version 0.0.1 - 2 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Ehs_Gthd extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_ehs_gthd"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Ehs_Gthd() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Applet installation */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 to 3 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test cases 1,2,3 + for (byte i = 0; i< 3; i++) + { + response = test.unrecognizedEnvelope(); + } + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "03CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/applet.opt new file mode 100644 index 0000000..7906963 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_ehs_gthd.Api_2_Ehs_Gthd_1 +uicc.test.toolkit.api_2_ehs_gthd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/javacard/api_2_ehs_gthd.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ehs_gthd/javacard/api_2_ehs_gthd.cap new file mode 100644 index 0000000000000000000000000000000000000000..bfb864f1a8f9bb5e7f6ad8721938a5172163fd94 GIT binary patch literal 2954 zcmb7_3rtg27{|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api_2_Enh_Copy_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/Api_2_Enh_Copy_1.java new file mode 100644 index 0000000..d6e55da --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/Api_2_Enh_Copy_1.java @@ -0,0 +1,468 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Copy_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_copy; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_enh_copy + * + * @version 0.0.1 - 2 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Copy_1 extends TestToolkitApplet +{ + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + private byte[] CmpBuffer = {(byte)0x82,(byte)0x02,(byte)0x83,(byte)0x81, + (byte)0x02,(byte)0x29, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09}; + + private byte[] CmpBuffer2 = {(byte)0x00 ,(byte)0x00 ,(byte)0x00 , + (byte)0x82,(byte)0x02,(byte)0x83,(byte)0x81, + (byte)0x02,(byte)0x29, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09}; + + private byte[] CmpBuffer3 = {(byte)0x00 ,(byte)0x00 ,(byte)0x00 , + (byte)0x82,(byte)0x02,(byte)0x83,(byte)0x81, + (byte)0x02,(byte)0x81,(byte)0xF5, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05}; + + private byte[] CmpBuffer4 = {(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x82,(byte)0x02,(byte)0x83}; + + private byte[] dstBuffer; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Copy_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Copy_1 thisApplet = new Api_2_Enh_Copy_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : the destination buffer is null + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + envHdlr.copy(null,(short)0,envHdlr.getLength()); + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (NullPointerException e) { + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : the destination offset is > to the buffer length + testCaseNb = (byte) 2 ; + + dstBuffer = new byte[5]; + bRes = false ; + try { + envHdlr.copy(dstBuffer,(short)5,(short)1); + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : the destination offset is <0 + testCaseNb = (byte) 3 ; + + dstBuffer = new byte[5]; + bRes = false ; + try { + envHdlr.copy(dstBuffer,(short)(-1),(short)1); + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : the destination length is bigger to the buffer length + testCaseNb = (byte) 4 ; + + dstBuffer = new byte[5]; + bRes = false ; + try { + envHdlr.copy(dstBuffer,(short)0,(short)6); + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : the destination offset + length is bigger than the buffer length + testCaseNb = (byte) 5 ; + + dstBuffer = new byte[5]; + bRes = false ; + try { + envHdlr.copy(dstBuffer,(short)3,(short)3); + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : the destination length is <0 + testCaseNb = (byte) 6 ; + + dstBuffer = new byte[5]; + bRes = false ; + try { + envHdlr.copy(dstBuffer,(short)0,(short)(-1)); + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : the destination length is > TLV length + testCaseNb = (byte) 7 ; + + dstBuffer = new byte[48]; + bRes = false ; + try { + envHdlr.copy(dstBuffer,(short)0,(short)dstBuffer.length); + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : + testCaseNb = (byte) 8 ; + + dstBuffer = new byte[47]; + bRes = false ; + try { + if(envHdlr.copy(dstBuffer,(short)0,(short)47)==0x002F) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 8 : + // -------------------------------------------- + // Test Case 9 : compare the buffer + testCaseNb = (byte) 9 ; + + dstBuffer = new byte[47]; + bRes = false ; + try { + if((envHdlr.copy(dstBuffer,(short)0,(short)47)==0x002F) + &&(Util.arrayCompare(dstBuffer,(short)0,CmpBuffer,(short)0,(short)CmpBuffer.length))==0) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 9 : + // -------------------------------------------- + // Test Case 10 : copy in a part of the buffer + testCaseNb = (byte) 10 ; + + dstBuffer = new byte[50]; + bRes = false ; + try { + if(envHdlr.copy(dstBuffer,(short)3,(short)47)==0x0032) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 10 : + // -------------------------------------------- + // Test Case 11 : compare the whole buffer + testCaseNb = (byte) 11 ; + + dstBuffer = new byte[50]; + bRes = false ; + try { + if((envHdlr.copy(dstBuffer,(short)3,(short)47)==0x0032) + &&(Util.arrayCompare(dstBuffer,(short)0,CmpBuffer2,(short)0,(short)CmpBuffer2.length))==0) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + case (byte) 11 : + // -------------------------------------------- + // Test Case 12 : copy in a part of the buffer + testCaseNb = (byte) 12 ; + + dstBuffer = new byte[252]; + bRes = false ; + try { + if(envHdlr.copy(dstBuffer,(short)0,(short)dstBuffer.length)==0x00FC) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 12 : + // -------------------------------------------- + // Test Case 13 : compare the whole buffer + testCaseNb = (byte) 13 ; + + dstBuffer = new byte[255]; + bRes = false ; + try { + if((envHdlr.copy(dstBuffer,(short)3,(short)252)==0x00FF) + &&(Util.arrayCompare(dstBuffer,(short)0,CmpBuffer3,(short)0,(short)CmpBuffer3.length))==0) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 13 : + // -------------------------------------------- + // Test Case 14 : copy in a part of the buffer + testCaseNb = (byte) 14 ; + + dstBuffer = new byte[260]; + bRes = false ; + try { + if(envHdlr.copy(dstBuffer,(short)257,(short)3)==0x0104) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 14 : + // -------------------------------------------- + // Test Case 15 : compare the whole buffer + testCaseNb = (byte) 15 ; + + dstBuffer = new byte[260]; + bRes = false ; + try { + if((envHdlr.copy(dstBuffer,(short)257,(short)3)==0x0104) + &&(Util.arrayCompare(dstBuffer,(short)0,CmpBuffer4,(short)0,(short)CmpBuffer4.length))==0) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 15 : + // -------------------------------------------- + // Test Case 16 : successful call with the length=0 and the offset = length of the destination buffer + testCaseNb = (byte) 16 ; + + bRes = false ; + try { + if(envHdlr.copy(dstBuffer,(short)dstBuffer.length,(short)0)==dstBuffer.length) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + default : + break; + } + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/Test_Api_2_Enh_Copy.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/Test_Api_2_Enh_Copy.java new file mode 100644 index 0000000..bb7fd34 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/Test_Api_2_Enh_Copy.java @@ -0,0 +1,273 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Copy_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_copy; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_enh_copy + * + * @version 0.0.1 - 2 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Copy extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_copy"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Copy() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test cases 1 + response = test.unrecognizedEnvelope(); + result = response.checkSw("90 00"); + + // Test cases 1 to 7 + for(byte i = 1; i < 7; i++) + { + // 1: Send Unrecognized Envelope + response = test.unrecognizedEnvelope(); + result &= response.checkSw("90 00"); + } + + // Test case 8 + // Send Unrecognized Envelope with BER TLV length set to 47 + response = test.sendApdu( "80 C2 00 00 31" + + "01 2F" + + "82 02 83 81" + + "02 29" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 09"); + + // Test case 9 + // Send Unrecognized Envelope with BER TLV length set to 47 and compare the buffer + response = test.sendApdu( "80 C2 00 00 31" + + "01 2F" + + "82 02 83 81" + + "02 29" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 09"); + + // Test case 10 + // Send Unrecognized Envelope with BER TLV set to 0x47 and compare the buffer + response = test.sendApdu( "80 C2 00 00 31" + + "01 2F" + + "82 02 83 81" + + "02 29" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 09"); + + // Test case 11 + // Send Unrecognized Envelope with BER TLV set to 0x47 and compare the buffer + response = test.sendApdu( "80 C2 00 00 31" + + "01 2F" + + "82 02 83 81" + + "02 29" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 09"); + + // Test case 12 + // Send Unrecognized Envelope with BER TLV set to 0x47 and compare the buffer + response = test.sendApdu( "80 C2 00 00 FF" + + "01 81 FC" + + "82 02 83 81" + + "02 81 F5" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05"); + + // Test case 13 + // Send Unrecognized Envelope with BER TLV set to 0x47 and compare the buffer + response = test.sendApdu( "80 C2 00 00 FF" + + "01 81 FC" + + "82 02 83 81" + + "02 81 F5" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05"); + + // Test case 14 + // Send Unrecognized Envelope with BER TLV set to 0x47 and compare the buffer + response = test.sendApdu( "80 C2 00 00 FF" + + "01 81 FC" + + "82 02 83 81" + + "02 81 F5" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05"); + + // Test case 15 + // Send Unrecognized Envelope with BER TLV set to 0x47 and compare the buffer + response = test.sendApdu( "80 C2 00 00 FF" + + "01 81 FC" + + "82 02 83 81" + + "02 81 F5" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05"); + + // Test case 16 + // Send Unrecognized Envelope with BER TLV set to 0x47 and compare the buffer + response = test.sendApdu( "80 C2 00 00 FF" + + "01 81 FC" + + "82 02 83 81" + + "02 81 F5" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "10CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/applet.opt new file mode 100644 index 0000000..45a7bd9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_copy.Api_2_Enh_Copy_1 +uicc.test.toolkit.api_2_enh_copy +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/javacard/api_2_enh_copy.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_copy/javacard/api_2_enh_copy.cap new file mode 100644 index 0000000000000000000000000000000000000000..ea6058d506bd96c68ca3085fa85b40add00dbde0 GIT binary patch literal 7937 zcmb7}2|yHOABW$W*^6^$xLhs~yzt_(5D!wk5)q}mN-IOez>5{|K*~&Aq-mxAVWZ#Q zic)VEH~a($lSuC|Af-)e-=4AQDScCW_UJz#CcWoBJA|mXduU#9oa2$^$2$Kperoi_ z^NB@Sef$@`wIuV;-XYQJ?rPEM!yn%nHom_SyeZow*R^c@$&QO!q)*eSvO)prR~VsnGwle)*Rco%bk?|4SUc3IpM=EgU^-i-E_OpzR4>`kDR`&B=gQw zhdT70vA=AMZ+cM|b>S9kd9O(;f9=&SVAFt}dxx&-8Whkr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z@OSVJ@I3e@cmcc!{smqF{{}CESHOS3YNjGUg}=2Jipn3;il$FbDlttl$Ili1$+Lwu zCe#sbN^yiYoh59cvxGOMAs(njy6KP(=$ZRfHi*O~Oz*YVpp1XcN&l+H8t<+M+FVUv;b# z4QC0z)mpK`OkX%{^SnxEeQ1TnW~$R>X%0)R&D6SW7T~bf+Dy|eb;+rR9kyEAS?adg zOAfvEZfa_sa$_Aj@24JjeOj~%OWE~J8$_D|O|wLRZX0dFl$vjxQZ?40^WO58_^Xqu z>9N>YkHrSQcs*>g(7j1wh|AaG*QbqE-aId^ICLLuN#AL&?KW+JIioMSqp=5? zR-xT`55(&Z-IqQ5zn-feLs8^=g;w5T52iYF`>nRb9+k ztuY~jhOedt-+0$%)*5=-%sQ{O(NpDJFSF_qBp$Td>hfbj{TeQtyiGQ1k~zXbzrh$` zK7pZOp++ze9vTd$wCepJKMdGz7sIC?rX>_L1RdiS4lvm9;jpix3 zsVbiC#Ayk-(#29$)lE&wNK@1Rx^i&s;?<4UM)=}Y?Vp=n%3_P>)%V@MT}P?0Y^G_c z`?S_vRdFx4UplENw4~Xrd!g2a6!(bxg_4>`dA%YvmrdLY?pH`^3Z7bh4x{FJiF?8Q znnz7xX}t>WS3ul5?w2WQI{oNfRQDI8+qH`p?g96!6E%Ui>J_NDR^eW7{|K%rBs%JI z2yP$9?iu$_;hN0SdS%=`lif4!A7(X~O>`-#?k`B~kG707vxQAw^czR>zBz=K{tK07 B#=rmo literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/Api_2_Enh_Cprv_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/Api_2_Enh_Cprv_1.java new file mode 100644 index 0000000..fdf515a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/Api_2_Enh_Cprv_1.java @@ -0,0 +1,519 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Cprv_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_cprv; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Cprv + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Cprv_1 extends TestToolkitApplet +{ + + + private byte[] compBuffer; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Cprv_1 () + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Cprv_1 thisApplet = new Api_2_Enh_Cprv_1 (); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + switch ( testCaseNb ) + { + + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : try to use the compareValue method with a null compare Buffer + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + if((envHdlr.findTLV((byte)2,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.compareValue((short)0,null,(short)0,(short)1)==0)) + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (NullPointerException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : use the compareValue method with an offset > buffer length + testCaseNb = (byte) 2 ; + + bRes = false ; + compBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x0B,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)5,(short)1)==0)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : use the compareValue method with an offset = -1 + testCaseNb = (byte) 3 ; + + bRes = false ; + compBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x0B,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)-1,(short)1)==0)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : use the compareValue method with an length > buffer length + testCaseNb = (byte) 4 ; + + bRes = false ; + compBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x0B,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)0,(short)6)==0)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : use the compareValue method with an Offset + length > buffer length + testCaseNb = (byte) 5 ; + + bRes = false ; + compBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x0B,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)3,(short)3)==0)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : use the compareValue method with an compare length < 0 + testCaseNb = (byte) 6 ; + + bRes = false ; + compBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x0B,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)0,(short)-1)==0)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : use the compareValue method with ValueOffset > TLV length + testCaseNb = (byte) 7 ; + + bRes = false ; + compBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)6,compBuffer,(short)0,(short)1)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : use the compareValue method with ValueOffset <0 + testCaseNb = (byte) 8 ; + + bRes = false ; + compBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)-1,compBuffer,(short)0,(short)1)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 8 : + // -------------------------------------------- + // Test Case 9 : use the compareValue method with dstlength > TLV length + testCaseNb = (byte) 9 ; + + bRes = false ; + compBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)0,(short)7)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 9 : + // -------------------------------------------- + // Test Case 10 : use the compareValue method with ValueOffset+dstlength > TLV length + testCaseNb = (byte) 10 ; + + bRes = false ; + compBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)2,compBuffer,(short)0,(short)5)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 10 : + // -------------------------------------------- + // Test Case 11 : use the compareValue method without current TVL + testCaseNb = (byte) 11 ; + + bRes = false ; + compBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x01,(byte)1)==TLV_NOT_FOUND) + &&(envHdlr.compareValue((short)2,compBuffer,(short)0,(short)5)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 11 : + // -------------------------------------------- + // Test Case 12 : use the compareValue method (normal execution comparaison buffer = TLV) + testCaseNb = (byte) 12 ; + + bRes = false ; + compBuffer =new byte[6]; + + //intialize the array + compBuffer [0]= (byte)0x81; + compBuffer [1]= (byte)0x11; + compBuffer [2]= (byte)0x22; + compBuffer [3]= (byte)0x33; + compBuffer [4]= (byte)0x44; + compBuffer [5]= (byte)0xF5; + + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)0,(short)6)==0)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 12 : + // -------------------------------------------- + // Test Case 13 : use the compareValue method (normal execution comparaison buffer > TLV) + testCaseNb = (byte) 13 ; + + bRes = false ; + compBuffer =new byte[6]; + + //intialize the array + compBuffer [0]= (byte)0x80; + compBuffer [1]= (byte)0x11; + compBuffer [2]= (byte)0x22; + compBuffer [3]= (byte)0x33; + compBuffer [4]= (byte)0x44; + compBuffer [5]= (byte)0xF5; + + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)0,(short)6)==1)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 13 : + // -------------------------------------------- + // Test Case 14 : use the compareValue method (normal execution comparaison buffer < TLV) + testCaseNb = (byte) 14 ; + + bRes = false ; + + //intialize the array + compBuffer [0]= (byte)0x83; + compBuffer [1]= (byte)0x11; + compBuffer [2]= (byte)0x22; + compBuffer [3]= (byte)0x33; + compBuffer [4]= (byte)0x44; + compBuffer [5]= (byte)0xF5; + + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)0,compBuffer,(short)0,(short)6)==-1)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 14 : + // -------------------------------------------- + // Test Case 15 : use the compareValue method with differents parameters(normal execution comparaison buffer = TLV) + testCaseNb = (byte) 15 ; + + bRes = false ; + compBuffer =new byte[13]; + + //intialize the array + for(byte i=0;i<13;i++) + compBuffer[i]=(byte)0x55; + + compBuffer [3]= (byte)0x81; + compBuffer [4]= (byte)0x11; + compBuffer [5]= (byte)0x22; + compBuffer [6]= (byte)0x33; + compBuffer [7]= (byte)0x44; + compBuffer [8]= (byte)0xF5; + + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)1,compBuffer,(short)4,(short)5)==0)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 15 : + // -------------------------------------------- + // Test Case 16 : use the compareValue method with differents parameters(normal execution comparaison buffer > TLV) + testCaseNb = (byte) 16 ; + + bRes = false ; + compBuffer =new byte[13]; + + //intialize the array + for(byte i=0;i<13;i++) + compBuffer[i]=(byte)0x55; + + compBuffer [3]= (byte)0x81; + compBuffer [4]= (byte)0x10; + compBuffer [5]= (byte)0x23; + compBuffer [6]= (byte)0x33; + compBuffer [7]= (byte)0x44; + compBuffer [8]= (byte)0xF5; + + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)1,compBuffer,(short)4,(short)5)==+1)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 16 : + // -------------------------------------------- + // Test Case 17 : use the compareValue method with differents parameters(normal execution comparaison buffer < TLV) + testCaseNb = (byte) 17 ; + + bRes = false ; + compBuffer =new byte[13]; + + //intialize the array + for(byte i=0;i<13;i++) + compBuffer[i]=(byte)0x55; + + compBuffer [3]= (byte)0x81; + compBuffer [4]= (byte)0x12; + compBuffer [5]= (byte)0x21; + compBuffer [6]= (byte)0x33; + compBuffer [7]= (byte)0x44; + compBuffer [8]= (byte)0xF5; + + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)1,compBuffer,(short)4,(short)5)==-1)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 17 : + // -------------------------------------------- + // Test Case 18 : use successfully the compareValue method with the length of the copy =0 + testCaseNb = (byte) 18 ; + + bRes = false ; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.compareValue((short)1,compBuffer,(short)compBuffer.length,(short)0)==0)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/Test_Api_2_Enh_Cprv.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/Test_Api_2_Enh_Cprv.java new file mode 100644 index 0000000..ea43f35 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/Test_Api_2_Enh_Cprv.java @@ -0,0 +1,120 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Cprv.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_cprv; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +/** + * Test Area : uicc.test.toolkit.api_2_enh_cprv + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Cprv extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_cprv"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Cprv() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + for(byte i = 0; i <= (byte)18; i++ ) + { + /* Case 1 to 18: Send Unrecognized Envelope with Tag 82, length 02 + Tag 06, length 06 + Tag 8B, length 24. + */ + response = test.sendApdu( "80 C2 00 00 34" + + "01 32" + + "82 02 83 81" + + "06 06" + + "81112233 44F5" + + "8B 24" + + "40088155 6677887F F6001129 12000004" + + "13027000 000E0D08 00000028 83850000" + + "00000100"); + if(i == 0) + result = response.checkSw("90 00"); + else + result &= response.checkSw("90 00"); + } + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "12CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/applet.opt new file mode 100644 index 0000000..a84b845 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_cprv.Api_2_Enh_Cprv_1 +uicc.test.toolkit.api_2_enh_cprv +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/javacard/api_2_enh_cprv.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cprv/javacard/api_2_enh_cprv.cap new file mode 100644 index 0000000000000000000000000000000000000000..e6c6dccc9f8fdc98338e10d265dfb3b97a5e6474 GIT binary patch literal 4881 zcmbVP4Rln+6~6P{yr2DlyDZ@)Z`Q>%PIBkX zeKT{vd%u~TH@CQur%sUZ@A`_#BcW4q0)?VUPv#GsJhdRJD1YkYf=N$2nORiu?WX{Z zC9?vx!`0P;&W^va^hch9%eUR!m|ZmE{QMWb98zB2RIu}X=X-5yju#2@E^bNRK`M{F zeRcM(+_TvyoU42}=lb`9S-;7h-LmHy`{BR#9KSNfdeYtWuj_Qm3eTj2C!DhuG#7sF z(y81j=eF%jB@f$vRriNO%U)F)(xD`ybYt(KjzN7nGgcaq-oL(!VcUePQ99 zw=T7uEqU*ky*BUPvS0Yio!y(~ezbGIg7>SnOU>gxDb0BPC%cC1I?$A5+kV97yS%l* zZF=LKXFbKG^L;g~!qW6xm%m?j^+Vf*=hmHV7;)v!E^FzY@>N`Mp(I!DA9cH$0Gy-% z#kh9H$cnMGYdJG^lp8fBxhTuZeZH)azbcd!3Ir+^m4~vt!SXpdbNoxn=Jsa$eSBe(yYgWv0&?B#`#?r)`%BM}a8yXv6?Q818g zxQXSJeqSh1xq=~b&Lx$=JR;XP%J>! zN+=wP0Aj5f-|>KB47eA7ueInL{Gs)=)>Q0aG6E$D2P?c)Rm?LHQYN4uK#T}Mrq^&# zD-&a_q}v0>|9NYwPXb_)+|m^JLuG+^3`&ybrjt#ON*X|pJb#99Z3?H7LtrFdfJR!u zM7{`Xk&b~>Ivr#> zCY(zBsN;Bw<0+1(C%`CJz%2{~S+IoNLJsPSQQv_2V$?UI-U^y%LA^Dsi9Nt5E(MqP zGOqQ~uuFUm_3Pl0?5JN4yQE%Vl!k#@ngX&kEbNv_FdjwS0HVsj2rGr`m%%o61Mr!e z>ZbXsJAFM+Z9NFuTEf+FAmNZf8^N5p52{4m1Yn0DPzJl>EsER$#12N)( z$UG342V#mC?|~!YLBFIt=vV}XEqmln9t20Lii0`OX&3fjzBh84`Su@Agubp*SH|C8 z7X9wehb;I(VDd0Z;@5*GLf%lhub|vt5&3eAu_QZKlyzz0C&6 ziA_oBiE}%eIPh-MGCCGmxs=&$lsmIv`F&p0!|8obZq%@8ke zd<|DCwgGQHHYQ zBU&K4tqn$^H|M1ESCa+1MP;=P2Y6F2A^ta867lI+EGWsS-MJahA;&AOB^9CuhN6)^QIWcyGen>vM4=*K4FR>nD}JE zh^0?@1bqq=LwGYO1bsrJ$I)jpF`O~DixOXu2_1Qj9zdVK!~k|B1rSST^a%RXHij_E zoJ buffer length + testCaseNb = (byte) 2 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)5,(short)1)==0)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : use the copyValue method with an offset = -1 + testCaseNb = (byte) 3 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)-1,(short)1)==0)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : use the copyValue method with an length > buffer length + testCaseNb = (byte) 4 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x33,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)0,(short)6)==6)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : use the copyValue method with an Offset + length > buffer length + testCaseNb = (byte) 5 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x33,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)3,(short)3)==6)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : use the copyValue method with an dstLength < 0 + testCaseNb = (byte) 6 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if((envHdlr.findTLV((byte)0x33,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)0,(short)-1)==0)) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : use the copyValue method with ValueOffset > TLV length + testCaseNb = (byte) 7 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)6,dstBuffer,(short)0,(short)1)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : use the copyValue method with ValueOffset < 0 + testCaseNb = (byte) 8 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)-1,dstBuffer,(short)0,(short)1)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 8 : + // -------------------------------------------- + // Test Case 9 : use the copyValue method with dstlength > TLV length + testCaseNb = (byte) 9 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)0,(short)7)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 9 : + // -------------------------------------------- + // Test Case 10 : use the copyValue method with ValueOffset+dstlength > TLV length + testCaseNb = (byte) 10 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)2,dstBuffer,(short)0,(short)5)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 10 : + // -------------------------------------------- + // Test Case 11 : use the copyValue method without current TVL + testCaseNb = (byte) 11 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x01,(byte)1)==TLV_NOT_FOUND) + &&(envHdlr.copyValue((short)2,dstBuffer,(short)0,(short)5)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 11 : + // -------------------------------------------- + // Test Case 12 : use successfully the copyValue method + testCaseNb = (byte) 12 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)0,(short)6)==6)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 12 : + // -------------------------------------------- + // Test Case 13 : use successfully the copyValue method and compare the received data + testCaseNb = (byte) 13 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)0,(short)6)==6) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer,(short)0, (short) compBuffer.length)==0)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 13 : + // -------------------------------------------- + // Test Case 14 : use successfully the copyValue + testCaseNb = (byte) 14 ; + + bRes = false ; + dstBuffer =new byte[20]; + + // initialize the buffer + for(byte i=0;i<20;i++) + dstBuffer[i] =(byte)0x55; + + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)1,dstBuffer,(short)3,(short)4)==7)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 14 : + // -------------------------------------------- + // Test Case 15 : use successfully the copyValue method and compare the received data + testCaseNb = (byte) 15 ; + + bRes = false ; + dstBuffer =new byte[32]; + + // initialize the buffer + for(byte i=0;i<32;i++) + dstBuffer[i] =(byte)0x55; + + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)1,dstBuffer,(short)3,(short)4)==7) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer2,(short)0, (short) compBuffer2.length)==0)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 15 : + // -------------------------------------------- + // Test Case 16 : use successfully the copyValue method with the length of the copy =0 + testCaseNb = (byte) 16 ; + + bRes = false ; + try { + if((envHdlr.findTLV((byte)0x06,(byte)1)==TLV_FOUND_CR_SET) + &&(envHdlr.copyValue((short)0,dstBuffer,(short)dstBuffer.length,(short)0)==dstBuffer.length)) + bRes = true; + } + catch (ToolkitException e) { + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/Test_Api_2_Enh_Cpyv.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/Test_Api_2_Enh_Cpyv.java new file mode 100644 index 0000000..a2482de --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/Test_Api_2_Enh_Cpyv.java @@ -0,0 +1,130 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Cpyv.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_cpyv; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Cpyv + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Cpyv extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_cpyv"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Cpyv() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + for(byte i = 0; i <= (byte)16; i++ ) + { + /* 1: Send Unrecognized Envelope with Tag 02, length 02 + Tag 06, length 06 + Tag 33, length C7. + */ + response = test.sendApdu( "80 C2 00 00 D9" + + "01 81 D6" + + "02 02 83 81" + + "86 06" + + "01020304 0506" + + "33 81 C7" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 01010101 01010101 01010101" + + "01010101 010101"); + if(i == 0) + result = response.checkSw("90 00"); + else + result &= response.checkSw("90 00"); + } + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "10CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/applet.opt new file mode 100644 index 0000000..a163562 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_cpyv.Api_2_Enh_Cpyv_1 +uicc.test.toolkit.api_2_enh_cpyv +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/javacard/api_2_enh_cpyv.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_cpyv/javacard/api_2_enh_cpyv.cap new file mode 100644 index 0000000000000000000000000000000000000000..9f63444adf7a39a755ec55bb327254cbe34cb1dc GIT binary patch literal 4724 zcmb7H4Nz3q6+Z9X``*6&f8e^jWp@Gpkf5@HNkuJ2f-*rM#UGru*5b;pWkuN)wlvzr zK8T8ria(QRqDh8Iqsb_eSZmWn+f1j4Q_$MPOvh^L6rCuY_?PL=Ol(?u?pu;&A7o_T z?m73Jcklhad(OS@zI&?533Y&kzkhBhdkltL4xmuEU}^ERvZqRYmBmk$l`dGaG_SJs ze?0(Qi~ritI$b$CxzD@tS1TOLf4A=6?fI48zPWnqpQnX7-Y%VX+|e2S&GjREL9{pZ zBbZfl@kg7om)_s}iRst*Fa2YwtWFE0zZzKjmU1oJo7ujlBx*j<`h;rS9XJ?ndVkrh z`wIdq4s8v6^U~M}9e-Q&@sbCpUtM_Vlh$Jy7oM(bt2ooP==6$1A52)Wq<@jCq@ zcJgO0epFX{%d)Efft_|(7tnQ8HE)j2 zh1zUmU3Im)@o41yf!qCi*Y)MD^!2UcUU=mf`?tc6+kSh8f99u`zt^4V_|D%mp9y9P z2c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!%_$C!GEMOBe+vg(#yx_RJ49)i#DA zcq(RrFvEU48sg!Koqt;RRtb+i+SxFd!-9ic9*=E2MRiJk$l)q5ulm$v$?$%z*)zgEAN9ac^?dg}SUgoJ>#URM!;;M268P6AoW+Ndt@l4!Sys!<`PFagFzU55aW4_opwCI-3}##kqjw{oq39X(Sw@`UP*M!~oI}r}PY~if zPvR;Xy(cAKrVDxkeO?eJIGGedJWJ3s=(pB5!-wW%T+nT_dK&%i8mD>8k_?S*uhrA& gx2`zNL`e=O)@w*UYD literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/Api_2_Enh_Facrb_Bs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/Api_2_Enh_Facrb_Bs_1.java new file mode 100644 index 0000000..28b09aa --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/Api_2_Enh_Facrb_Bs_1.java @@ -0,0 +1,430 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Facyb_Bs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_facrb_bs; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Facyb_Bs + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Facrb_Bs_1 extends TestToolkitApplet +{ + + /** Registry entry concerning applet instance */ + + private byte[] CompareBuffer; + private byte[] CompareBuffer2 = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4}; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Facrb_Bs_1 () + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Facrb_Bs_1 thisApplet = new Api_2_Enh_Facrb_Bs_1 (); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + //register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : try to use the findAndCompareValue method with an destination Buffer null + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + if(envHdlr.findAndCompareValue((byte)2,null,(short)0)==0) + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (NullPointerException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : use the findAndCompareValue method with an offset > buffer length + testCaseNb = (byte) 2 ; + + bRes = false ; + CompareBuffer =new byte[6]; + try { + if(envHdlr.findAndCompareValue((byte)6,CompareBuffer,(short)6)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : use the findAndCompareValue method with an offset <0 + testCaseNb = (byte) 3 ; + + bRes = false ; + CompareBuffer =new byte[6]; + try { + if(envHdlr.findAndCompareValue((byte)6,CompareBuffer,(short)-1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : use the findAndCompareValue method with an length > buffer length + testCaseNb = (byte) 4 ; + + bRes = false ; + CompareBuffer =new byte[5]; + try { + if(envHdlr.findAndCompareValue((byte)6,CompareBuffer,(short)0)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : use the findAndCompareValue method with an Offset + length > buffer length + testCaseNb = (byte) 5 ; + + bRes = false ; + CompareBuffer =new byte[6]; + try { + if(envHdlr.findAndCompareValue((byte)6,CompareBuffer,(short)1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : use the findAndCompareValue method without current tlv + testCaseNb = (byte) 6 ; + + bRes = false ; + CompareBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x02,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.findAndCompareValue((byte)3,CompareBuffer,(short)0)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // use the method getValueLength() after the unsuccessful of the method findAndCompareValue + testCaseNb = (byte) 7 ; + bRes = false; + try { + if(envHdlr.getValueLength()==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : normal execution of the findAndCompareValue() method with the TAG 06 + testCaseNb = (byte) 8 ; + + bRes = false ; + CompareBuffer =new byte[6]; + CompareBuffer[0] = (byte) 0x81; + CompareBuffer[1] = (byte) 0x11; + CompareBuffer[2] = (byte) 0x22; + CompareBuffer[3] = (byte) 0x33; + CompareBuffer[4] = (byte) 0x44; + CompareBuffer[5] = (byte) 0xF5; + + try { + if((envHdlr.findAndCompareValue((byte)0x06,CompareBuffer,(byte)0)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 8 : + // -------------------------------------------- + // Test Case 9 : normal execution of the findAndCompareValue() method and getValueLength() + testCaseNb = (byte) 9 ; + + bRes = false ; + try { + if((envHdlr.findAndCompareValue((byte)0x06,CompareBuffer,(byte)0)==0) + &&(envHdlr.getValueLength()==6)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 9 : + // -------------------------------------------- + // Test Case 10 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) with the TAG 06 + testCaseNb = (byte) 10 ; + + bRes = false ; + CompareBuffer[5] = (byte) 0xF4; + + try { + if(envHdlr.findAndCompareValue((byte)0x06,CompareBuffer,(byte)0)==(byte)1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 10 : + // -------------------------------------------- + // Test Case 11 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 11 ; + + bRes = false ; + CompareBuffer[5] = (byte) 0xF6; + + try { + if(envHdlr.findAndCompareValue((byte)0x06,CompareBuffer,(byte)0)== (byte)(-1)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 11 : + // -------------------------------------------- + // Test Case 12 : normal execution of the findAndCompareValue method with the TAG 02 + testCaseNb = (byte) 12 ; + + bRes = false ; + CompareBuffer =new byte[12]; + for( byte i=0;i<12;i++) + CompareBuffer[i]=0x55; + CompareBuffer[2] = (byte) 0x81; + CompareBuffer[3] = (byte) 0x11; + CompareBuffer[4] = (byte) 0x22; + CompareBuffer[5] = (byte) 0x33; + CompareBuffer[6] = (byte) 0x44; + CompareBuffer[7] = (byte) 0xF5; + try { + if(envHdlr.findAndCompareValue((byte)0x06,CompareBuffer,(byte)2)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 12 : + // -------------------------------------------- + // Test Case 13 : normal execution of the findAndCompareValue method with the TAG 02 and compare the stored Values + testCaseNb = (byte) 13 ; + + bRes = false ; + for( byte i=0;i<12;i++) + CompareBuffer[i]=0x55; + CompareBuffer[2] = (byte) 0x83; + CompareBuffer[3] = (byte) 0x81; + + try { + if(envHdlr.findAndCompareValue((byte)0x02,CompareBuffer,(byte)2)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 13 : + // -------------------------------------------- + // Test Case 14 : normal execution of the findAndCompareValue method with the TAG 82 + testCaseNb = (byte) 14 ; + + bRes = false ; + CompareBuffer[3] = (byte)0x80; + + try { + if(envHdlr.findAndCompareValue((byte)0x82,CompareBuffer,(byte)2)==(byte)1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 14 : + // -------------------------------------------- + // Test Case 15 : normal execution of the findAndCompareValue method with the TAG 82 and compare the stored Values + testCaseNb = (byte) 15 ; + + bRes = false ; + CompareBuffer[3] = (byte)0x82; + + try { + if(envHdlr.findAndCompareValue((byte)0x82,CompareBuffer,(byte)2)==(byte)(-1)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 15 : + // -------------------------------------------- + // Test Case 16 : normal execution of the findAndCompareValue method with the TAG B3 + testCaseNb = (byte) 16 ; + + bRes = false ; + for( byte i=0;i<12;i++) + CompareBuffer[i]=0x55; + CompareBuffer[0] = (byte) 0x83; + CompareBuffer[1] = (byte) 0x81; + + try { + if(envHdlr.findAndCompareValue((byte)0x02,CompareBuffer,(byte)0)==0) + bRes = true; + } + + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 16 : + // -------------------------------------------- + // Test Case 17 : normal execution of the findAndCompareValue method with the TAG B3 and compare the stored Values + testCaseNb = (byte) 17 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)0xB3,CompareBuffer2,(byte)0)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + } + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/Test_Api_2_Enh_Facrb_Bs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/Test_Api_2_Enh_Facrb_Bs.java new file mode 100644 index 0000000..38d5a4f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/Test_Api_2_Enh_Facrb_Bs.java @@ -0,0 +1,131 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Facyb_Bs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_facrb_bs; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Facyb_Bs + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Facrb_Bs extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_facrb_bs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Facrb_Bs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + for(byte i = 0; i <= (byte)16; i++ ) + { + /* Case 1 to 18: Send Unrecognized Envelope with Tag 82, length 02 + Tag 06, length 06 + Tag 8B, length 24. + */ + response = test.sendApdu( "80 C2 00 00 DA" + + "01 81 D7" + + "02 02 83 81" + + "06 06" + + "81112233 44F5" + + "02 02 22 44" + + "33 81 C4" + + "01020304 05060708 090A0B 0C0D0E0F10" + + "11121314 15161718 191A1B 1C1D1E1F20" + + "21222324 25262728 292A2B 2C2D2E2F30" + + "31323334 35363738 393A3B 3C3D3E3F40" + + "41424344 45464748 494A4B 4C4D4E4F50" + + "51525354 55565758 595A5B 5C5D5E5F60" + + "61626364 65666768 696A6B 6C6D6E6F70" + + "71727374 75767778 797A7B 7C7D7E7F80" + + "81828384 85868788 898A8B 8C8D8E8F90" + + "91929394 95969798 999A9B 9C9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAAB ACADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABB BCBDBEBFC0" + + "C1C2C3C4"); + if(i==0) + result = response.checkSw("90 00"); + else + result &= response.checkSw("90 00"); + } + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "11CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/applet.opt new file mode 100644 index 0000000..b287620 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_facrb_bs.Api_2_Enh_Facrb_Bs_1 +uicc.test.toolkit.api_2_enh_facrb_bs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/javacard/api_2_enh_facrb_bs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrb_bs/javacard/api_2_enh_facrb_bs.cap new file mode 100644 index 0000000000000000000000000000000000000000..1f36e469ad034ec80fe51217fbc8c8e1c19953d5 GIT binary patch literal 5567 zcmb7|33O9c8prS3lO}EdKw3frwrr&>(1nTwXobpJO0flG6`@O@rO=i(pdgNE5egIv z%AzR9qOzzd2q>E%3da#0nd*2H6+MCrjsqj((H>`$`M#8zChB|1PgL z?@L~eqS}Os{+btO_ZMvrn@~mWh>2N!v&W50$;}#+F50`mx~@XmwMadYFg|we=R1dvc>5no&uut6eRqkrbye|O!{SXP zcTI8}oKyMQ2Uow?Q2JTYXK|P2N}INA+Pp#>8h&Y!RNm*q@!oI0EWH%Fv}pUlj(vK} zDjahE=U;u~+C10gyfR|+UwY{KYt$0cbUKYox7M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igx$m&dOA#%}n=Zt{(tzN>lg^ksc> z^xDm}{N)2Cb+#j%-IPSlXQQ!=#x`2C)@rlNXH(;JXk^;9t$-(7G}#f+GEkkiRR?NY zYq!ozVD+7LM7CD1ZCkx{UfNc#tg-_w9o2mu)w!cOcT|toTRN)HzRk}aw>l90{kLfg>~I7u5;w0(WWA$Wqrl-}|G9@|T~FK%Wbv z7H-%_*EmA=8Sk1swxWoJg;_%>>F<}Yn>?^783=j)g0N~+|z27 zbw12dRwLG`nxlPTHf(&-2#d0sZMrF{^@7D$vKUcfjA8nXLubn?s#P@^gW?=9F)^Je z?BNkMYlLlx&1Q;@iHeDuW^>wD2iQ8;0_Wg6OVjq%G=7c@iqMjR;jZeUs?tiz9eD~Y zqK*3XtA=5e+hBK^hq@i+FUXCQ&D1~kP zNu_PF&OfOH9>4Vi3%3$>^YQt$#NOY^X&QBCGv`n9gI$7idB00K&0lCP0hxWUQE=w& zH);&o$e+gty9B4~eiw%l>TvuCe6UM!67F}|AF@kuN*?SLoJae;rqGiW+5!!0&8mY< zg41We$?GAT_><{im*Ab&?;=HpI+UP&H`pq8v-Mk*hHMqI^#)r7?`eLk`3QAXfjeAY Sjz+)52w|Z=UhMpKT>2lzt6RAM literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/Api_2_Enh_Facrbbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/Api_2_Enh_Facrbbs_Bss_1.java new file mode 100644 index 0000000..59242dd --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/Api_2_Enh_Facrbbs_Bss_1.java @@ -0,0 +1,616 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Facyb_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_facrbbs_bss; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Facyb_Bss + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Facrbbs_Bss_1 extends TestToolkitApplet +{ + + /** Registry entry concerning applet instance */ + private final byte[] compBuffer = {(byte)0x81,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0xF5}; + + private final byte[] compBuffer2= {(byte)0x81,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0xF4}; + + private final byte[] compBuffer3= {(byte)0x81,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0xF6}; + + private byte[] compBuffer4; + + private byte[] compBuffer5; + private byte[] compBuffer6 = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4}; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Facrbbs_Bss_1 () + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Facrbbs_Bss_1 thisApplet = new Api_2_Enh_Facrbbs_Bss_1 (); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + //register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : try to use the findAndCopyValue method with an destination Buffer null + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + if(envHdlr.findAndCompareValue((byte)2,(byte)1,(short)0,null,(short)0,(short)1)==0) + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (NullPointerException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : use the findAndCompareValue method with an offset > buffer length + testCaseNb = (byte) 2 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)0,compBuffer,(short)6,(short)1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : use the findAndCompareValue method with an offset <0 + testCaseNb = (byte) 3 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)0,compBuffer,(short)-1,(short)1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : use the findAndCompareValue method with an length > buffer length + testCaseNb = (byte) 4 ; + + bRes = false ; + + try { + byte[] SmallCompBuffer = new byte[5]; + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)0,SmallCompBuffer,(short)0,(short)6)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : use the findAndCompareValue method with an Offset + length > buffer length + testCaseNb = (byte) 5 ; + + bRes = false ; + compBuffer4 = new byte[7]; + compBuffer4[0] = (byte) 0x81; + compBuffer4[1] = (byte) 0x11; + compBuffer4[2] = (byte) 0x22; + compBuffer4[3] = (byte) 0x33; + compBuffer4[4] = (byte) 0x44; + compBuffer4[5] = (byte) 0xF5; + compBuffer4[6] = (byte) 0x00; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)0,compBuffer,(short)4,(short)3)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : use the findAndCompareValue method with an dstlength < 0 + testCaseNb = (byte) 6 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)0,compBuffer,(short)0,(short)-1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : use the findAndCompareValue method with an ValueOffset > buffer length + testCaseNb = (byte) 7 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)6,compBuffer,(short)0,(short)1)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : use the findAndCompareValue method with an ValueOffset <0 + testCaseNb = (byte) 8 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)-1,compBuffer,(short)0,(short)1)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 8 : + // -------------------------------------------- + // Test Case 9 : use the findAndCompareValue method with an CompareLength > Value length + testCaseNb = (byte) 9 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)0,compBuffer4,(short)0,(short)7)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 9 : + // -------------------------------------------- + // Test Case 10 : use the findAndCompareValue method with an ValueOffset + dstlength > ValueLength + testCaseNb = (byte) 10 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)2,compBuffer,(short)0,(short)5)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 10 : + // -------------------------------------------- + // Test Case 11 : use the findAndCompareValue method with occurence set to 0 + testCaseNb = (byte) 11 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)0,(short)0,compBuffer,(short)0,(short)1)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.BAD_INPUT_PARAMETER) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 11 : + // -------------------------------------------- + // Test case 12 : Unsuccessful of the method findAndCompareValue with wrong occurence + testCaseNb = (byte) 12 ; + bRes = false; + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)2,(short)0,compBuffer,(short)0,(short)1)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 12 : + // -------------------------------------------- + // Test Case 13 : Call the getValueLength() method after unsuccessful of the findAndCompareValue method with the TAG 06 + testCaseNb = (byte) 13 ; + + bRes = false ; + + try { + if((envHdlr.findAndCompareValue((byte)6,(byte)2,(short)0,compBuffer,(short)0,(short)6)==6) + &&(envHdlr.getValueLength()==0)) + bRes = false; + } + + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 13 : + // -------------------------------------------- + // Test Case 14 : normal execution of the findAndCompareValue method with the TAG 06 and compare the stored value + testCaseNb = (byte) 14 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)6,(byte)1,(short)0,compBuffer,(short)0,(short)6)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 14 : + // -------------------------------------------- + // Test Case 15 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) with the TAG 06 + testCaseNb = (byte) 15 ; + + bRes = false ; + + try { + if((envHdlr.findAndCompareValue((byte)6,(byte)1,(short)0,compBuffer,(short)0,(short)6)==0) + &&(envHdlr.getValueLength())==6) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 15 : + // -------------------------------------------- + // Test Case 16 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 16 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)0x06,(byte)1,(short)0,compBuffer2,(short)0,(short)6)==1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 16 : + // -------------------------------------------- + // Test Case 17 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) with the TAG 02 + testCaseNb = (byte) 17 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)0x06,(byte)1,(short)0,compBuffer3,(short)0,(short)6)==-1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 17 : + // -------------------------------------------- + // Test Case 17 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 18 ; + + bRes = false ; + compBuffer4 = new byte[11]; + + for( byte i=0;i<11;i++) + compBuffer4[i]=0x55; + compBuffer4[3] = (byte)0x22; + compBuffer4[4] = (byte)0x33; + compBuffer4[5] = (byte)0x44; + compBuffer4[6] = (byte)0xF5; + + try { + if(envHdlr.findAndCompareValue((byte)0x06,(byte)1,(short)2,compBuffer4,(short)3,(short)4)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 18 : + // -------------------------------------------- + // Test Case 18 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) with the TAG 02 and the occurence 2 + testCaseNb = (byte) 19 ; + + bRes = false ; + compBuffer4[5] = (byte)0x45; + + try { + if(envHdlr.findAndCompareValue((byte)0x06,(byte)1,(short)2,compBuffer4,(short)3,(short)4)==-1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 19 : + // -------------------------------------------- + // Test Case 19 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 20 ; + + bRes = false ; + compBuffer4[5] = (byte)0x43; + try { + if(envHdlr.findAndCompareValue((byte)0x06,(byte)1,(short)2,compBuffer4,(short)3,(short)4)==1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 20 : + // -------------------------------------------- + // Test Case 20 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) with the TAG 82 and the occurence 1 + testCaseNb = (byte) 21 ; + + bRes = false ; + compBuffer5 = new byte[12]; + for( byte i=0;i<12;i++) + compBuffer5[i]=0x55; + compBuffer5[0] = (byte)0x83; + compBuffer5[1] = (byte)0x81; + + try { + if(envHdlr.findAndCompareValue((byte)0x82,(byte)1,(short)0,compBuffer5,(short)0,(short)2)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 21 : + // -------------------------------------------- + // Test Case 21 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 22 ; + + bRes = false ; + compBuffer5[0] = (byte)0x22; + compBuffer5[1] = (byte)0x44; + + try { + if(envHdlr.findAndCompareValue((byte)0x82,(byte)2,(short)0,compBuffer5,(short)0,(short)2)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 22 : + // -------------------------------------------- + // Test Case 22 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) with the TAG 82 and the occurence 2 + testCaseNb = (byte) 23 ; + + bRes = false ; + compBuffer5[1] = (byte)0x45; + + try { + if(envHdlr.findAndCompareValue((byte)0x82,(byte)2,(short)0,compBuffer5,(short)0,(short)2)== -1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 23 : + // -------------------------------------------- + // Test Case 23 : use the findAndCompareValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 24 ; + + bRes = false ; + compBuffer5[0] = (byte)0x83; + compBuffer5[1] = (byte)0x81; + + try { + if(envHdlr.findAndCompareValue((byte)0x82,(byte)1,(short)0,compBuffer5,(short)0,(short)2)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 24 : + // -------------------------------------------- + // Test Case 24 : Successful call with tag B3 + testCaseNb = (byte) 25 ; + + bRes = false ; + + try { + if(envHdlr.findAndCompareValue((byte)0xB3,(byte)1,(short)0,compBuffer6,(short)0,(short)compBuffer6.length)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 25 : + // -------------------------------------------- + // Test Case 26 : use the findAndCompareValue method with compareLength = 0 + testCaseNb = (byte) 26 ; + + bRes = false ; + try { + if(envHdlr.findAndCompareValue((byte)0x33,(byte)1,(short)0,compBuffer6,(short)0,(short)0)==0) + bRes = true; + } + + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/Test_Api_2_Enh_Facrbbs_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/Test_Api_2_Enh_Facrbbs_Bss.java new file mode 100644 index 0000000..e0421e2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/Test_Api_2_Enh_Facrbbs_Bss.java @@ -0,0 +1,133 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Facyb_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_facrbbs_bss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Facrbbs_Bss + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Facrbbs_Bss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_facrbbs_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Facrbbs_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + for(byte i = 0; i <= (byte)26; i++ ) + { + /* Case 1 to 18: Send Unrecognized Envelope with Tag 82, length 02 + Tag 06, length 06 + Tag 8B, length 24. + */ + response = test.sendApdu( "80 C2 00 00 DA" + + "01 81 D7" + + "02 02 83 81" + + "06 06" + + "81112233 44F5" + + "02 02 22 44" + + "33 81 C4" + + "01020304 05060708 090A0B 0C0D0E0F10" + + "11121314 15161718 191A1B 1C1D1E1F20" + + "21222324 25262728 292A2B 2C2D2E2F30" + + "31323334 35363738 393A3B 3C3D3E3F40" + + "41424344 45464748 494A4B 4C4D4E4F50" + + "51525354 55565758 595A5B 5C5D5E5F60" + + "61626364 65666768 696A6B 6C6D6E6F70" + + "71727374 75767778 797A7B 7C7D7E7F80" + + "81828384 85868788 898A8B 8C8D8E8F90" + + "91929394 95969798 999A9B 9C9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAAB ACADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABB BCBDBEBFC0" + + "C1C2C3C4"); + if(i == 0) + result = response.checkSw("90 00"); + else + result &= response.checkSw("90 00"); + } + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "1ACCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/applet.opt new file mode 100644 index 0000000..20e8bc5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_facrbbs_bss.Api_2_Enh_Facrbbs_Bss_1 +uicc.test.toolkit.api_2_enh_facrbbs_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/javacard/api_2_enh_facrbbs_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facrbbs_bss/javacard/api_2_enh_facrbbs_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..2ca6427bfbd04f66146ca8617389b39be02700c1 GIT binary patch literal 6488 zcmbW53sh9q8pro}%sKO7_!x%a2;v(>MLxJ(x9;uM>Xwhy&GP>D2#rjX!GZ7hKi@ffpa0qW z>~qeXot+`cHm1kl&C>LK?7qduWR^K>LTaz{F~j3CQ^%waA2xnMT;}kfFEQpFH>J2d zL0i=Avq3lJE{v&JUG&|`(V;cRx8&R!)x&mW@42h9Z+v<%Dc&PrJF+}+@Vi&O-}dL_ zU1IkPxe$Cwmk}DdS$V(TrtzKf<%%EgR5&&ZWo*IEU4>BlcN6}zVpoB1s!QTG^D?hY zd;5i}PhPxmsPl(&qPFbWAN_pPhQmxv{K1@S{qBdUva6%}>n()_w_#mv{k!9~_svXy zql?Ly`Q_7D{Ra;$FFcl3o#$Nq)yK0l4^`&f9Gl$EHDPL0{E-v+M|Q8Sx!66cK6d9d zrS9*e(%!XIeY|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M%^41F}oOdkgR0fvlL-viAfvVV)A{OKd`m0%DWM2hclM1sn<-Q8y1IrK4R9;@c z-V`H8a+fe!BIQ9YvZm*?G*Z`_Dip86UqfDnzlXdEe-U{V{wDG&{8i*t_`ArfkRm1d z9K1|@kb(R%UP|}1LlPfwMsf+xrLh7jUUq*6hsVfaawW5ozMz>dlONK^*BX9uVoPdD zKWSuWG?jQSsQ%OZeN*XzM#jdfI+*JJaLrX3nHp+J7!%Dl)Y4o-r7;?r8*1tTYT6sR zNNKiWm_|YOS8Ny{q!gGVs{|Gz`Nr|@9z*=AMwZ3~bMs#YnQsvDJK&d5FYeYTxVf^H zdv5T(cO9G7D%ObnwS-0ox!J-)Gz#$-78?tT%@#)ct-LULo{x8_yX+*dVwdrHw99hp zlKpue-{8j&qno~QufyKP@$u^$S2(OuDEHvE%dmh7jc3*5Ru`6N zWNWOE7Eq(H(M@Y)Y7};_9cHvcmAdQD4%M#X?a=Xd=&)`^J5&j;IIk+>wvME7JbF|~ z*DyeT{g7g}G_w0n1l7=dR2#~xVT}E5wX+(9->WA3T6}+n#uhhu8nU$-X^lpI`23s` z@pF;ailn1x3GNwb!*8|4*+ZjB|Nj|WFcki-6h#@Rl zI3y(KW_4IEAL}g;RuZH>Bn%cYqacVjOd2)LX5K$Z#%D8|F26Om$&X@e7^%%osQHg_ z5k1r5f$E=L3p5IxL-QLYqeEM4)MQ32&?|7p%oeAOBs|D;u*QQ*VgZ)Cwe z-r@!YJo*FO0-yJOx6; buffer length + testCaseNb = (byte) 2 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if(envHdlr.findAndCopyValue((byte)6,dstBuffer,(short)6)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : use the findAndCopyValue method with an offset <0 + testCaseNb = (byte) 3 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if(envHdlr.findAndCopyValue((byte)6,dstBuffer,(short)-1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : use the findAndCopyValue method with an length > buffer length + testCaseNb = (byte) 4 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if(envHdlr.findAndCopyValue((byte)6,dstBuffer,(short)0)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : use the findAndCopyValue method with an Offset + length > buffer length + testCaseNb = (byte) 5 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if(envHdlr.findAndCopyValue((byte)6,dstBuffer,(short)1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : use the findAndCopyValue method without current tlv + testCaseNb = (byte) 6 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if((envHdlr.findTLV((byte)0x02,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.findAndCopyValue((byte)3,dstBuffer,(short)0)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // use the method getValueLength() after the unsuccessful of the method findAndCopyValue + testCaseNb = (byte) 7 ; + bRes = false; + try { + if(envHdlr.getValueLength()==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 7 : + // -------------------------------------------- + // Test Case 7 : normal execution of the findAndCopyValue() method with the TAG 06 + testCaseNb = (byte) 8 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if((envHdlr.findAndCopyValue((byte)0x06,dstBuffer,(byte)0)==6)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 8 : + // -------------------------------------------- + // Test Case 8 : normal execution of the findAndCopyValue() method and compare the buffer value with the TAG 06 + testCaseNb = (byte) 9 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if((envHdlr.findAndCopyValue((byte)0x06,dstBuffer,(byte)0)==6) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer,(short)0, (short) compBuffer.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 9 : + // -------------------------------------------- + // Test Case 9 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) with the TAG 06 + testCaseNb = (byte) 10 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if(envHdlr.findAndCopyValue((byte)0x06,dstBuffer,(byte)2)==8) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 10 : + // -------------------------------------------- + // Test Case 10 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 11 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if((envHdlr.findAndCopyValue((byte)0x06,dstBuffer,(byte)2)==8) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer2,(short)0, (short) compBuffer2.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 11 : + // -------------------------------------------- + // Test Case 11 : normal execution of the findAndCopyValue method with the TAG 02 + testCaseNb = (byte) 12 ; + + bRes = false ; + dstBuffer =new byte[2]; + + try { + if(envHdlr.findAndCopyValue((byte)0x02,dstBuffer,(byte)0)==2) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 12 : + // -------------------------------------------- + // Test Case 12 : normal execution of the findAndCopyValue method with the TAG 02 and compare the stored Values + testCaseNb = (byte) 13 ; + + bRes = false ; + dstBuffer =new byte[2]; + + try { + if((envHdlr.findAndCopyValue((byte)0x02,dstBuffer,(byte)0)==2) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer3,(short)0, (short) compBuffer3.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 13 : + // -------------------------------------------- + // Test Case 13 : normal execution of the findAndCopyValue method with the TAG 82 + testCaseNb = (byte) 14 ; + + bRes = false ; + dstBuffer =new byte[2]; + + try { + if(envHdlr.findAndCopyValue((byte)0x82,dstBuffer,(byte)0)==2) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 14 : + // -------------------------------------------- + // Test Case 14 : normal execution of the findAndCopyValue method with the TAG 82 and compare the stored Values + testCaseNb = (byte) 15 ; + + bRes = false ; + dstBuffer =new byte[2]; + + try { + if((envHdlr.findAndCopyValue((byte)0x82,dstBuffer,(byte)0)==2) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer3,(short)0, (short) compBuffer3.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 15 : + // -------------------------------------------- + // Test Case 16 : normal execution of the findAndCopyValue method with the TAG B3 + testCaseNb = (byte) 16 ; + + bRes = false ; + dstBuffer =new byte[0xC4]; + + try { + if(envHdlr.findAndCopyValue((byte)0xB3,dstBuffer,(byte)0)==0xC4) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 16 : + // -------------------------------------------- + // Test Case 17 : normal execution of the findAndCopyValue method with the TAG B3 and compare the stored Values + testCaseNb = (byte) 17 ; + + bRes = false ; + dstBuffer =new byte[0xC4]; + + try { + if((envHdlr.findAndCopyValue((byte)0xB3,dstBuffer,(byte)0)==0xC4) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer4,(short)0, (short) compBuffer4.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + } + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/Test_Api_2_Enh_Facyb_Bs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/Test_Api_2_Enh_Facyb_Bs.java new file mode 100644 index 0000000..0bca5d1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/Test_Api_2_Enh_Facyb_Bs.java @@ -0,0 +1,132 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Facyb_Bs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_facyb_bs; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Facyb_Bs + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Facyb_Bs extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_facyb_bs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Facyb_Bs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + for(byte i = 0; i <= (byte)17; i++ ) + { + /* Case 1 to 18: Send Unrecognized Envelope with Tag 82, length 02 + Tag 06, length 06 + Tag 8B, length 24. + */ + response = test.sendApdu( "80 C2 00 00 DA" + + "01 81 D7" + + "02 02 83 81" + + "06 06" + + "81112233 44F5" + + "02 02 22 44" + + "33 81 C4" + + "01020304 05060708 090A0B 0C0D0E0F10" + + "11121314 15161718 191A1B 1C1D1E1F20" + + "21222324 25262728 292A2B 2C2D2E2F30" + + "31323334 35363738 393A3B 3C3D3E3F40" + + "41424344 45464748 494A4B 4C4D4E4F50" + + "51525354 55565758 595A5B 5C5D5E5F60" + + "61626364 65666768 696A6B 6C6D6E6F70" + + "71727374 75767778 797A7B 7C7D7E7F80" + + "81828384 85868788 898A8B 8C8D8E8F90" + + "91929394 95969798 999A9B 9C9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAAB ACADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABB BCBDBEBFC0" + + "C1C2C3C4"); + if(i==0) + result = response.checkSw("90 00"); + else + result &= response.checkSw("90 00"); + } + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "11CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/applet.opt new file mode 100644 index 0000000..e37e1bb --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_facyb_bs.Api_2_Enh_Facyb_Bs_1 +uicc.test.toolkit.api_2_enh_facyb_bs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/javacard/api_2_enh_facyb_bs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bs/javacard/api_2_enh_facyb_bs.cap new file mode 100644 index 0000000000000000000000000000000000000000..e8f89570f882ef2d3834905ae18c273767d99d8e GIT binary patch literal 5740 zcmb7|2~-qE9>%NBIT+v%3`4_+5|jir4q_0AN(Au$5k(~$jMs>xq69`5&nOx2zzZ~9 zQDc-OCc#8Jka$Mpk+&Po`P?H zs_LGet}4uzWIHqC@27=%z1bayoyn|Va8Y)Tyb(iE3bIG!4H-P9$W<`pmkW$FkN&*8 zwx@RTp)cbX9h+#+_mo%G4UgJ#Y@2&temDE&rsbQb{^z@KSBkP~%ZmrbC0zaXzaM_I z$?N#T@U!!~_1fZfZdEV#9#@!HDi6K>*E-Ku;kc zJn7vPpC-(3U)lK0;hn=b{J8pj$Gl>{bYVd4)@9cRA9&aI-KsK+Z`I1iBY9DyK7K#< zXkxy#;OhnJ(zE*2mbK>8mn>L(;?SjrDKWqQ=H)s4?M+7?o#dGtb?TMXV^43(J^b)X zXVvBlvvNMPjkvOX=i;*~ij@vsCiG}*Idt(N`SUmZ$#wc~8(f!uuHNbR^^G z**Sd2jAuTZaN_;Z&9hIp-Uy9{(jf4vd(EU$M`OMlHAg}x~2E= zLz%}Wl#Xp1`16mE^RlkD71^Wa+rL^HJ^x_X_o*%8Q+K3I9JA-0CD*^+w6A{i?2Q-S z9OY;|*H*au_#Zz>+!iB`jXeEA;kPX@SC`d&`9{^@>M^VO7F|BY3iD0oIfMUx>}i3q z&t!(YBwO{%#xLOc&ocYQBgZ2HF}Jj&B*o{c@}>AHD#~V;`cmB9(#gFhd&*}{p6)JL zICb*Ws+3vodF~Q-<+PMsk9(S@(pBR23M}r63vJ&CqRa$pL_-#)wBcBl0NeJKd1%`&^b~H4eIjjZD%J!p49ynydVEwx;Cti)g2Rwow zZMN52=J9b~iP`TOrJ#0iKhE-$hCe?BBObw<Nk$XI;JqYom; zj+eQss(6o8=E(6g6H~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K*pIjwf!;c`buJ{FB$Ih{9 zLO1D}uuJ$@3>S;VgW_K#r!-7jAsyA^m9muTR0OF(W)WsLGG2Q!XIQc#r+UrFD$=61 zPwu#eMK(#hG=*2tAMQ?Yne;m5^&vNX?&#sY zZ6wWXw2^gf$Dy45_t0=H*f?5dH)IJDapBGJ!ghW`!qEZTjeckQYR-)LmLQ60a# zb*j`=_ENLz;J>{NS|grjRP-q$^F7AdBs6Li(yk>%Z%N@TDZC}cq1@e) z-a|oZ7VhX_yW2|0#Vdi{E`HE)xs_W}uiWfK`_ge5h2Fcg?j%ah;{BZ17aE1#QI~3e z)r#%cDEvOff6L2TsS)XQ^|um!7azK1hBNmVnKw(Lh+nCpJ4#Zsbf3{JYX34n`-3Y- zLh%^jks0(m@fe@mS6VWp)KjLvs+zHMx_z|wxl-KYwHAEFBY2Zw zSe#AxcOLP@;pcLEc#j7|EJ_E2GsKL5+AQInElDL)wL8`;5Ad{A zP)D#_>3{l)$-!JV|9Y}sNTs7xI!o85LkH{E*2V@P2C_lI0imZdGhw|za%(CQJ*8eG zWT~yKIbwEUz98DM+`hH{bLYka-~VZU+;2CCw_?3{zujvSBGAei%uaAK9N3aDx)}Ez z0xoHo(coO#?LruhjJpg0qy0e}1@;__F2?PJfJ+A{*x>{=8;mZ-4TFHofuLQC+XqH3 z;~GEURf;<+xC@kXYsGIgF)r-`CYOUY2`u!DF2+Z5z-38zutPCCsEt;}r*pvStDvn6 l&uXKU@!1!!`hkKSRr@DlVLsn0VtB<3VNc*X{1U-){|Cl=c;Em4 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/Api_2_Enh_Facyb_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/Api_2_Enh_Facyb_Bss_1.java new file mode 100644 index 0000000..3953228 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/Api_2_Enh_Facyb_Bss_1.java @@ -0,0 +1,625 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Facyb_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_facyb_bss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Facyb_Bss + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Facyb_Bss_1 extends TestToolkitApplet +{ + + /** Registry entry concerning applet instance */ + private final byte[] compBuffer = {(byte)0x81,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0xF5}; + + private final byte[] compBuffer2= {(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0xF5,(byte)0x55,(byte)0x55,(byte)0x55, + (byte)0x55,(byte)0x55}; + + private final byte[] compBuffer3= {(byte)0x83,(byte)0x81,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55, + (byte)0x55,(byte)0x55}; + + private final byte[] compBuffer4= {(byte)0x22,(byte)0x44,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55,(byte)0x55, + (byte)0x55,(byte)0x55}; + + private byte[] compBuffer5; + private byte[] dstBuffer; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Facyb_Bss_1 () + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Facyb_Bss_1 thisApplet = new Api_2_Enh_Facyb_Bss_1 (); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + //register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : try to use the findAndCopyValue method with an destination Buffer null + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + if(envHdlr.findAndCopyValue((byte)2,(byte)1,(short)0,null,(short)0,(short)1)==0) + bRes = false; + } + catch (ToolkitException e) { + bRes = false; + } + catch (NullPointerException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : use the findAndCopyValue method with an offset > buffer length + testCaseNb = (byte) 2 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)0,dstBuffer,(short)5,(short)1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : use the findAndCopyValue method with an offset <0 + testCaseNb = (byte) 3 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)0,dstBuffer,(short)-1,(short)1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : use the findAndCopyValue method with an length > buffer length + testCaseNb = (byte) 4 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)0,dstBuffer,(short)0,(short)6)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : use the findAndCopyValue method with an Offset + length > buffer length + testCaseNb = (byte) 5 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)0,dstBuffer,(short)3,(short)3)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : use the findAndCopyValue method with an dstlength < 0 + testCaseNb = (byte) 6 ; + + bRes = false ; + dstBuffer =new byte[5]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)0,dstBuffer,(short)0,(short)-1)==0) + bRes = false; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : use the findAndCopyValue method with an ValueOffset > buffer length + testCaseNb = (byte) 7 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)6,dstBuffer,(short)0,(short)1)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : use the findAndCopyValue method with an ValueOffset <0 + testCaseNb = (byte) 8 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)-1,dstBuffer,(short)0,(short)1)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 8 : + // -------------------------------------------- + // Test Case 9 : use the findAndCopyValue method with an dstLength > Value length + testCaseNb = (byte) 9 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)0,dstBuffer,(short)0,(short)7)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 9 : + // -------------------------------------------- + // Test Case 10 : use the findAndCopyValue method with an ValueOffset + dstlength > ValueLength + testCaseNb = (byte) 10 ; + + bRes = false ; + dstBuffer =new byte[15]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)2,dstBuffer,(short)0,(short)5)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 10 : + // -------------------------------------------- + // Test Case 11 : use the findAndCopyValue method without the researched TAG + testCaseNb = (byte) 11 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if((envHdlr.findTLV((byte)0x02,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.findAndCopyValue((byte)6,(byte)2,(short)0,dstBuffer,(short)0,(short)1)==0)) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // use the method getValueLength() after the unsuccessful of the method findAndCopyValue + testCaseNb = (byte) 12 ; + bRes = false; + try { + if(envHdlr.getValueLength()==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 12 : + // -------------------------------------------- + // Test Case 12 : normal execution of the findAndCopyValue method with the TAG 06 + testCaseNb = (byte) 13 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if(envHdlr.findAndCopyValue((byte)6,(byte)1,(short)0,dstBuffer,(short)0,(short)6)==6) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 13 : + // -------------------------------------------- + // Test Case 13 : normal execution of the findAndCopyValue method with the TAG 06 and compare the stored value + testCaseNb = (byte) 14 ; + + bRes = false ; + dstBuffer =new byte[6]; + try { + if((envHdlr.findAndCopyValue((byte)6,(byte)1,(short)0,dstBuffer,(short)0,(short)6)==6) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer,(short)0, (short) compBuffer.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 14 : + // -------------------------------------------- + // Test Case 14 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) with the TAG 06 + testCaseNb = (byte) 15 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if(envHdlr.findAndCopyValue((byte)0x06,(byte)1,(short)2,dstBuffer,(short)3,(short)4)==7) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 15 : + // -------------------------------------------- + // Test Case 15 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 16 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if((envHdlr.findAndCopyValue((byte)0x06,(byte)1,(short)2,dstBuffer,(short)3,(short)4)==7) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer2,(short)0, (short) compBuffer2.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 16 : + // -------------------------------------------- + // Test Case 16 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) with the TAG 02 + testCaseNb = (byte) 17 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if(envHdlr.findAndCopyValue((byte)0x02,(byte)1,(short)0,dstBuffer,(short)0,(short)2)==2) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 17 : + // -------------------------------------------- + // Test Case 17 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 18 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if((envHdlr.findAndCopyValue((byte)0x02,(byte)1,(short)0,dstBuffer,(short)0,(short)2)==2) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer3,(short)0, (short) compBuffer3.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + + case (byte) 18 : + // -------------------------------------------- + // Test Case 18 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) with the TAG 02 and the occurence 2 + testCaseNb = (byte) 19 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if(envHdlr.findAndCopyValue((byte)0x02,(byte)2,(short)0,dstBuffer,(short)0,(short)2)==2) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 19 : + // -------------------------------------------- + // Test Case 19 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 20 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if((envHdlr.findAndCopyValue((byte)0x02,(byte)2,(short)0,dstBuffer,(short)0,(short)2)==2) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer4,(short)0, (short) compBuffer4.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 20 : + // -------------------------------------------- + // Test Case 20 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) with the TAG 82 and the occurence 1 + testCaseNb = (byte) 21 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if(envHdlr.findAndCopyValue((byte)0x82,(byte)1,(short)0,dstBuffer,(short)0,(short)2)==2) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 21 : + // -------------------------------------------- + // Test Case 21 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 22 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if((envHdlr.findAndCopyValue((byte)0x82,(byte)1,(short)0,dstBuffer,(short)0,(short)2)==2) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer3,(short)0, (short) compBuffer3.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 22 : + // -------------------------------------------- + // Test Case 22 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) with the TAG 82 and the occurence 2 + testCaseNb = (byte) 23 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if(envHdlr.findAndCopyValue((byte)0x82,(byte)2,(short)0,dstBuffer,(short)0,(short)2)==2) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 23 : + // -------------------------------------------- + // Test Case 23 : use the findAndCopyValue method (store the TLV value in a fulfilled buffer) and compare the stored values + testCaseNb = (byte) 24 ; + + bRes = false ; + dstBuffer =new byte[12]; + + for( byte i=0;i<12;i++) + dstBuffer[i]=0x55; + + try { + if((envHdlr.findAndCopyValue((byte)0x82,(byte)2,(short)0,dstBuffer,(short)0,(short)2)==2) + &&(Util.arrayCompare(dstBuffer,(short)0,compBuffer4,(short)0, (short) compBuffer4.length)==0)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 24 : + // -------------------------------------------- + // Test Case 24 : use the findAndCopyValue method (with the length = 0 and the offset = length of the destination buffer) + testCaseNb = (byte) 25 ; + + bRes = false ; + try { + if(envHdlr.findAndCopyValue((byte)0x82,(byte)2,(short)0,dstBuffer,(short)dstBuffer.length,(short)0)==dstBuffer.length) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 25 : + // -------------------------------------------- + // Test Case 26 : use the findAndCopyValue method with Invalid Parameter(occurrence = 0) + testCaseNb = (byte) 26 ; + + bRes = false ; + dstBuffer =new byte[0x10D]; + + try { + if(envHdlr.findAndCopyValue((byte)0x0B,(byte)0,(short)0x11,dstBuffer,(short)0,(short)0x10D)==0x10D) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.BAD_INPUT_PARAMETER) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/Test_Api_2_Enh_Facyb_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/Test_Api_2_Enh_Facyb_Bss.java new file mode 100644 index 0000000..d10b3af --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/Test_Api_2_Enh_Facyb_Bss.java @@ -0,0 +1,132 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Facyb_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_facyb_bss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Facyb_Bss + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Facyb_Bss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_facyb_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Facyb_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + for(byte i = 0; i <= (byte)26; i++ ) + { + /* Case 1 to 18: Send Unrecognized Envelope with Tag 82, length 02 + Tag 06, length 06 + Tag 8B, length 24. + */ + response = test.sendApdu( "80 C2 00 00 DA" + + "01 81 D7" + + "02 02 83 81" + + "06 06" + + "81112233 44F5" + + "02 02 22 44" + + "33 81 C4" + + "01020304 05060708 090A0B 0C0D0E0F10" + + "11121314 15161718 191A1B 1C1D1E1F20" + + "21222324 25262728 292A2B 2C2D2E2F30" + + "31323334 35363738 393A3B 3C3D3E3F40" + + "41424344 45464748 494A4B 4C4D4E4F50" + + "51525354 55565758 595A5B 5C5D5E5F60" + + "61626364 65666768 696A6B 6C6D6E6F70" + + "71727374 75767778 797A7B 7C7D7E7F80" + + "81828384 85868788 898A8B 8C8D8E8F90" + + "91929394 95969798 999A9B 9C9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAAB ACADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABB BCBDBEBFC0" + + "C1C2C3C4"); + if(i == 0) + result = response.checkSw("90 00"); + else + result &= response.checkSw("90 00"); + } + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "1ACCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/applet.opt new file mode 100644 index 0000000..e1b3ee2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_facyb_bss.Api_2_Enh_Facyb_Bss_1 +uicc.test.toolkit.api_2_enh_facyb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/javacard/api_2_enh_facyb_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_facyb_bss/javacard/api_2_enh_facyb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..ec0829faf68f3ba2bd44cb2114ffcee12117ae86 GIT binary patch literal 5665 zcmbVQ4R90372dnOU!5ecWa)giF<=70Fd!S4*iMLX9TQ`XF}Q#WAps(cTm;5aZG{Gg zX%8DPzYb+Wh7!`!b|8k-&=}L2P8xpNnHEYIC)0FVh!g%N)AG}%g@H~J_wC7!bcaeJ zPI~+9-R^$hySICL_qL`Aa~>qY@7^l^6DZ;EAP!YOJEv^Ce?~=qb=eGm#j~^L_^KozN!*m zT~qSO{U2W0Rk2RFH$!{V-@q&=KX|#Ig_kc~-PK?4MBlWui|78hxZq8u>fR5Ot}7?D z;hPI<=Un4&Z{#OtaV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&$XppEAgfs}QahOGjPJf{pSmH1Wu zC&^I7b1J{BERf{RZJjwhrw$}}*_#f;Ihf}(0o$rK`7I4CFNNoSZr0$7Dqu7s{PHrx zZFbu%88&N?|36=jx5~dGRHM1yHy?kBa{?mM$hH}uZ~CF3({rs&W2RUs#&=#SrfzQIfXt-AEoFXrRo+X*Xp7I-@-He zghqen!a7YEMlN6!BK!=Ex4JAPHYeW0LhveBh?fxngO!-6pp|kgz<5Pqtre;=@i0&U zm!J>!0|HgRb?A%50|!=Z9}K12@e&8nLJx@d`OvN}qL0uyARB-f0!ES~nHRr?aO{C( z{Ei!RAM-AntR53QD|c!{0`*>k%u6JC~rsmWUL@eT-N~ z+>8WujQAFXzmxQrt%+Db+=B!KHb*27>`254;(`}c@X90Ef~fq7WyCcvDDyBP8Bqlk h%ZQ6pP^J;3`#)I2!Q=n{ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/Api_2_Enh_Gcap_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/Api_2_Enh_Gcap_1.java new file mode 100644 index 0000000..2b7bfbe --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/Api_2_Enh_Gcap_1.java @@ -0,0 +1,103 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Gcap_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gcap; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_enh_gcap + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Gcap_1 extends TestToolkitApplet +{ + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Gcap_1 () + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Gcap_1 thisApplet = new Api_2_Enh_Gcap_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + //register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes; + + // results of methods + short sLength = 0; + short sCapacity = 0; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + // Get length of the BER TLV + bRes = false; + testCaseNb++; + try { + sLength = envHdlr.getLength(); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + // get capacity of the handler + try { + sCapacity = envHdlr.getCapacity(); + bRes &= true; + } + catch (Exception e) { + bRes &= false; + } + + // Capacity must be greater than length of BER TLV + if (sCapacity < sLength) + { + bRes &= false; + } + else + { + bRes &= true; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/Test_Api_2_Enh_Gcap.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/Test_Api_2_Enh_Gcap.java new file mode 100644 index 0000000..c5ba48a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/Test_Api_2_Enh_Gcap.java @@ -0,0 +1,105 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Gcap.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gcap; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Gcap + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Gcap extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_gcap"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Gcap() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 1: Send Unrecognized Envelope to trig the Applet + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/applet.opt new file mode 100644 index 0000000..2af71ac --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_gcap.Api_2_Enh_Gcap_1 +uicc.test.toolkit.api_2_enh_gcap +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/javacard/api_2_enh_gcap.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcap/javacard/api_2_enh_gcap.cap new file mode 100644 index 0000000000000000000000000000000000000000..9d478e2f45681cba10bb5b6d7ca44d6c7ab9345e GIT binary patch literal 2904 zcmb7_drVVT9LIn6(RbOfR;(Ze%@7c!Ej~~PvJPPos8m7YbQ_j(r56gVrD8b?)Ny0Io=3rydJDCnggSX5qNOqm)mC+Eh?}$?2C#D^2^H89R-gD0FEqKS=wqf zZAu=>y}LMJ;QH--KSZsWW%{sV#+e<;0q^G>nje?G@|R>Qj|- z&#yN%?mTm3f7|l(lfMk^R6Vom!UpTpVomI}prgB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source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/Api_2_Enh_Gcid_1.java new file mode 100644 index 0000000..e6622f0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/Api_2_Enh_Gcid_1.java @@ -0,0 +1,202 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Gcid_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gcid; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.test.util.*; + +/** + * Test Area : uicc.test.toolkit.api_2_enh_gcid + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Gcid_1 extends TestToolkitApplet +{ + private final byte[] ADDRESS = {(byte)0x91, (byte)0x11, (byte)0x22, (byte)0x33, (byte)0x44} ; + private final byte[] BEARER_DESC = {(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00}; + private static byte[] menuEntry = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)' ',(byte)'1'}; + // Number of tests + byte testCaseNb = (byte) 0x00; + private static final byte DEV_ID_ME = (byte)0x82; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Gcid_1 () + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Gcid_1 thisApplet = new Api_2_Enh_Gcid_1 (); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Set Event Download Channel Status as an activation event for the applet + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS); + // Set Unrecognized Envelope as an activation event for the applet + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + //register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0,(short)menuEntry.length,(byte)0,false,(byte)0,(short)0); + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes; + // Miscelaneous + byte bChannelNb; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + if (event == EVENT_MENU_SELECTION) + { + // The Applet open all the 7 channels by sending 7 Open Channel commands + proHdlr.init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_ME); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + proHdlr.appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + for (bChannelNb = 0; bChannelNb < 7; bChannelNb++) + { + proHdlr.send() ; + } + } + else + { + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : getChannelIdentifier(), normal execution + testCaseNb = (byte) 1 ; + bRes = false ; + try { + if (envHdlr.getChannelIdentifier() == 0x01) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : Twice calling of getChannelIdentifier() with 2 + // Channel Status TLV + testCaseNb = (byte) 2 ; + bRes = false ; + try { + if (envHdlr.getChannelIdentifier() == 0x04) + if (envHdlr.getChannelIdentifier() == 0x04) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : Channel Status TLV is selected after the call + // of getChannelIdentifier() + testCaseNb = (byte) 3 ; + bRes = false ; + try { + envHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte) 0x01); + if (envHdlr.getChannelIdentifier() == + envHdlr.getValueByte((byte)0x00)) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : getChannelIdentifier() with no Channel Status TLV + testCaseNb = (byte) 4 ; + bRes = false ; + try { + envHdlr.getChannelIdentifier(); + bRes = false; + } + catch (ToolkitException e){ + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) + { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : getChannelIdentifier() on a clased channel + testCaseNb = (byte) 5 ; + bRes = false ; + try { + if (envHdlr.getChannelIdentifier() == 0x06) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 5 : getChannelIdentifier() with an empty Channel Status TLV + testCaseNb = (byte) 6 ; + bRes = false ; + try { + envHdlr.getChannelIdentifier(); + bRes = false; + } + catch (ToolkitException e){ + if (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) + { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + } // End switch + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/Test_Api_2_Enh_Gcid.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/Test_Api_2_Enh_Gcid.java new file mode 100644 index 0000000..4419caf --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/Test_Api_2_Enh_Gcid.java @@ -0,0 +1,176 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Gcid.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gcid; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Gcid + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Gcid extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_gcid"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Gcid() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("1FF0FFFF 00FF0000 010000 1F40"); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // Position and Id of the first item + "07" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession("1FF0FFFF 00FF0000 010000 1F40"); + + // 0: Send Envelope Menu Selection with Item Identifier set to 01 + // to open 7 channels + response = test.envelopeMenuSelection("10 01 01",""); + + // Fetch the first OPEN CHANNEL proactive command + response = test.fetch("1C"); + result = response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + test.terminalResponse("81030140 01820282 81030100 38028100" + + "35040100 00003902 0080"); + + // Fetch the second OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + test.terminalResponse("81030140 01820282 81030100 38028200" + + "35040100 00003902 0080"); + + // Fetch the third OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + test.terminalResponse("81030140 01820282 81030100 38028300" + + "35040100 00003902 0080"); + + // Fetch the fourth OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + test.terminalResponse("81030140 01820282 81030100 38028400" + + "35040100 00003902 0080"); + + // Fetch the fifth OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + test.terminalResponse("81030140 01820282 81030100 38028500" + + "35040100 00003902 0080"); + + // Fetch the sixth OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + test.terminalResponse("81030140 01820282 81030100 38028600" + + "35040100 00003902 0080"); + + // Fetch the seventh OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + test.terminalResponse("81030140 01820282 81030100 38028700" + + "35040100 00003902 0080"); + + // 1 : Trig the applet with EventDownloadChannelStatus with channel status value = 0x8100 + test.envelopeEventDownloadChannelStatus("38028100"); + + // 2 : Trig the applet with EventDownloadChannelStatus with channel status value = 0x8400 and 0x8500 + test.envelopeEventDownloadChannelStatus("38028400 38028500"); + + // 3 : Send envelope EvenDownloadChannelStatus with channel status value = 0x0605 + test.envelopeEventDownloadChannelStatus("38020605"); + + // 4 : Send unrecognized envelope with no channel status TLV + test.unrecognizedEnvelope(); + + // 5 : Send envelope EvenDownloadChannelStatus with channel status value = 0x0600 + test.envelopeEventDownloadChannelStatus("38020600"); + + // 5 : Send unrecognized envelope with channel status TLV length set to 0 + test.sendApdu("80C20000 08010682 02828138 00"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "06CCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/applet.opt new file mode 100644 index 0000000..bf759af --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_gcid.Api_2_Enh_Gcid_1 +uicc.test.toolkit.api_2_enh_gcid +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/javacard/api_2_enh_gcid.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcid/javacard/api_2_enh_gcid.cap new file mode 100644 index 0000000000000000000000000000000000000000..bcf5697bd7a183978577b3ffce85bbcf42630b39 GIT binary patch literal 3460 zcmb7G3v5$W82-dnIroCus6eEs5x@~iLeXr+Bd zhiQxFx_RI`x~-#=<$*E7mgs+uZK$}qZinX9%EtGCFD=1;@@FD!5%*;7f7;9@ury(D+-`AHHvfA5I)j zH48D*2eGHc^NXJ;xSw&e_+Zp4Z*di?L;I&X+Rx2vKX+<>e^W;8_Jt{TUcWQ7<@+V6 ztJX{_^&MJ$=>`6_`1}?_O>@S!udjSQ#y>B#W{*pMao5hoyDO;Y`Gec9<=52z z^VL0X>As}TEmwc={8m}td~|4K882*4t@X|&0H+y%O58hb=Z-0Rcl74}~re1VK>&?BJLKu+ssc5CW&X3*z?Ud$J7oA{Y%^FbWZaeHK9j+G*%u zv?|cJe#@69;=dF;jff!7YG-Y&5+Mi1aRH!#(kfvcUP?hwAle|W`WEVw->Y-r0u)5H zMHRAtwr7??#ZzMik{^g7<)9-o14dGZZBxKRKF0P4XvrCfB1ZyR@*|FK1)?b$bW|c} zsUZ+WB?h$A2+*;j)ChtkH0f-#xXxl@#8``s6$e>tocOfG#*0Ok6(I4-G=sA=P9iwk zvVutTN~%uCUJHz^5!j4=l8LcPrXdZ$^=kmW-!fWE2vK+nu}3}XECel$SWn{<5)4bv5N&4GK#Z9+iG0<>cvdWA#9)X4eFFBmHlW*JeTW6U9*4PYgl;4M4fAL*pjgJy zIbNI&5ztH4B*s21CrRY1Z?=+w?Nlv!3b%sA(>V%cXoll(Lt<7^bap(0_M*sCF-*2s zFmrUamy+74{tXb@3cpBfHygexrpuattn~qjduYuvAsR%=+GQQj(75&|P}EC&Hwr7# z8_iri*8p)`7YW}jB=2*Q(9K+YWYaxtZ?+_M1=6`R#b-j7Pf>V`)4HA~ReE_#ixHEh zAP>>|12Ea|^t)ZfZn?Vi+Y~U{N);qDa20aRoB`SBO?3u#8vcUu_*Ow=WRv7q%RMe6 z^wcN^L4##CK{hfbt!5-0MW-hu>IUmlbwjj$bt#a_3lATzfQe!>8lKSzY@A*nrOS%f zYvW@D!Jv;e#2EF_@jY`fz*kbZ5kpg8LG(TsMRKjn=k}sbDADO)1Lgs+CNMxRrGi3` z@9301GjtYBGr@*{87l!$0UDNq9kM!WHxLbua-a}r@HoR^7)uu8bq6rHX8ff>T1N-k z<{+}LXIAtMav`s?wLu}-NwV141Dc4)?8(NCGN`0;L{doEE6WIFK<#>Tf9kHz%KfS5 z^Q7C9;zbKjR`RfyPca3(PhnWs)eLI!4l@kL4ECO(hm@;H)KVQL`5+>auyCsx)EXUT z(9w}BBdpkJ2DR#j88%16pw?hDk6JXtJVp2w^?pOfJ(5s0fm$oW1nm(Kgq2gxpe}o1 z1_vL>5>!P{O`|S&VVd0$(WuIwnnqo?!ZZ`HcJzKjdX}-uG8Qjc06P3-VczpK%IIIo CG=B>K literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/Api_2_Enh_Gcst_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/Api_2_Enh_Gcst_1.java new file mode 100644 index 0000000..213ece7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/Api_2_Enh_Gcst_1.java @@ -0,0 +1,242 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Gcst_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gcst; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Gcst + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Gcst_1 extends TestToolkitApplet +{ + private final byte[] ADDRESS = {(byte)0x91, (byte)0x11, (byte)0x22, (byte)0x33, (byte)0x44} ; + private final byte[] BEARER_DESC = {(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00}; + private static byte[] menuEntry = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)' ',(byte)'1'}; + private final byte[] DisplayText = {(byte)'A',(byte)'P',(byte)'P',(byte)'L',(byte)'E',(byte)'T',(byte)'1'}; + + // Number of tests + byte testCaseNb = (byte) 0x00; + private static final byte DEV_ID_ME = (byte)0x82; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Gcst_1 () + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Gcst_1 thisApplet = new Api_2_Enh_Gcst_1 (); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Set Event Download Channel Status as an activation event for the applet + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS); + // Set Unrecognized Envelope as an activation event for the applet + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + //register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0,(short)menuEntry.length,(byte)0,false,(byte)0,(short)0); + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes; + // Miscelaneous + byte bChannelNb; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + if (event == EVENT_MENU_SELECTION) + { + // The Applet send an open channel proactive command + (ProactiveHandlerSystem.getTheHandler()).init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_ME); + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + (ProactiveHandlerSystem.getTheHandler()).send() ; + + } + else + { + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : getChannelStatus(), with no Channel Status TLV + testCaseNb = (byte) 1 ; + bRes = false ; + try { + envHdlr.getChannelStatus((byte)0x01); + } + catch (ToolkitException e) + { + if(e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true; + else + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : getChannelStatus(), with no wrong identifier + testCaseNb = (byte) 2 ; + bRes = false ; + try { + envHdlr.getChannelStatus((byte)0x01); + } + catch (ToolkitException e) + { + if(e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true; + else + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : Channel Status TLV with length set to 00 + testCaseNb = (byte) 3 ; + bRes = false ; + try { + envHdlr.getChannelStatus((byte)0x01); + } + catch (ToolkitException e) + { + if(e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true; + else + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : getChannelStatus() with length set to 01 + testCaseNb = (byte) 4 ; + bRes = false ; + try { + envHdlr.getChannelStatus((byte)0x01); + } + catch (ToolkitException e) + { + if(e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true; + else + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : getChannelStatus() value + testCaseNb = (byte) 5 ; + bRes = false ; + try { + if(envHdlr.getChannelStatus((byte)0x01)== (short)0x8100) + bRes =true; + } + catch (ToolkitException e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : getChannelStatus() with two TLV + testCaseNb = (byte) 6 ; + bRes = false ; + try { + if(envHdlr.getChannelStatus((byte)0x01)== (short)0x8100) + bRes =true; + } + catch (ToolkitException e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : Channel Status TLV is the currently selected TLV + testCaseNb = (byte) 7 ; + bRes = false ; + try { + // Find the Device ID TLV anc compare to the result of getChannelStatus + envHdlr.findTLV(DEV_ID_TERMINAL,(byte)0x01); // Set the current TLV to Device Id TLV + short ChannelStatusValue = envHdlr.getChannelStatus((byte)0x01); + if((envHdlr.getChannelStatus((byte)0x01)== envHdlr.getValueShort((short)0)) + && (ChannelStatusValue== (short)0x8100)) + bRes = true; + else + bRes = false; + } + catch (ToolkitException e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : Get channel Status value after proactive command + testCaseNb = (byte) 8 ; + bRes = false ; + try { + short ChannelStatusValue = envHdlr.getChannelStatus((byte)0x01); + (ProactiveHandlerSystem.getTheHandler()).initDisplayText((byte)00,(byte)0xF6,DisplayText,(short)0,(short)DisplayText.length); + (ProactiveHandlerSystem.getTheHandler()).send(); + if((envHdlr.getChannelStatus((byte)0x01)) == ChannelStatusValue) + bRes = true; + else + bRes = false; + } + catch (ToolkitException e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + } // End switch + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/Test_Api_2_Enh_Gcst.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/Test_Api_2_Enh_Gcst.java new file mode 100644 index 0000000..c608ec1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/Test_Api_2_Enh_Gcst.java @@ -0,0 +1,144 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Gcst.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gcst; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Gcst + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Gcst extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_gcst"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Gcst() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // Position and Id of the first item + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession("1FF0FFFF 00FF0000 010000 1F"); + + // 0: Send Envelope Menu Selection with Item Identifier set to 01 + // to open a channel + response = test.envelopeMenuSelection("10 01 01",""); + + // Fetch the first OPEN CHANNEL proactive command + response = test.fetch("1C"); + result = response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + test.terminalResponse("81030140 01820282 81030100 38028100" + + "35040100 00003902 0080"); + + // 1 : Trig the applet with Unrecognized Envelope with no Channel Status TLV + test.sendApdu("80C20000 09010799 010A8202 8281"); + + // 2 : Trig the applet with Unrecognized envelope with the expected Identifier not present + test.sendApdu("80C20000 0D010B99 010A8202 82813802 8200"); + + // 3 : Send an Unrecognized envelope with channel status TLV length set to 0 + test.sendApdu("80C20000 0B010999 010A8202 82813800"); + + // 4 : Send an Unrecognized Envelope with channel length set to 01 + test.sendApdu("80C20000 0C010A99 010A8202 82813801 81"); + + // 5 : Send envelope EvenDownloadChannelStatus with channel status value set to 0x8100 + test.envelopeEventDownloadChannelStatus("38028100"); + + // 6 : Send envelope EvenDownloadChannelStatus with two TLV + test.envelopeEventDownloadChannelStatus("38028100 38028101"); + + // 7 : Channel Status TLV is the curently selected TLV + test.envelopeEventDownloadChannelStatus("38028100"); + + // 8 : Get channel status value after proactive command + test.envelopeEventDownloadChannelStatus("38028100"); + // Fetch the display text proactive command + response = test.fetch("15"); + result &= response.checkData("D0138103 01210082 0281028D 08F64150" + + "504C4554 31"); + test.terminalResponse("81030121 00020282 81030100"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check result */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "08CCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + return result; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/applet.opt new file mode 100644 index 0000000..c466841 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_gcst.Api_2_Enh_Gcst_1 +uicc.test.toolkit.api_2_enh_gcst +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/javacard/Api_2_Enh_Gcst.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gcst/javacard/Api_2_Enh_Gcst.cap new file mode 100644 index 0000000000000000000000000000000000000000..fb8eab407b31ac77ac9b6a3d6f77d714d0822a61 GIT binary patch literal 3648 zcmb7G32+lt82;bB-OVOV?WRrJl~QOci~$O53dL{)8+r`26hdLFiqHvZXhV<0Hg*O? zC!`8UOQCg;;TWhFhggIGD(K*dTyhB3!NH3|QO09H6k!BrTK`wAA&bl;Z}a7U*Z$xC z{w(D98bvqiXPn52AZ}{lfnj4osK45sCuW$@GkauY4u+En*Z{zr^hEp{sItP5Y zY`T4!<*NJoQ&TIxs!R2)_%SWbusWk_{D|E(=XPc{PMEIMKR$oc&}BoK601+8E}rep zC0}Reb%}dAzw7>?WaPjv-`skuvZgeCXieF>yKb*}x;}T?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E3oQSC!pyy4!&rnG3>A~4q zh)k@R5ZN$>UEg4ZN68M7DO9GcBr?C-j1|_flN_2Qb2fVs;f#0%_vLPA-;=@gM9rYiL4ph^csYd65R#FoNz@rfkYsg4B*FYc&7e*- zf(-b*M6irt;-O|xrx8Jh#St;6lL|GDItvK$WZ+j6{)XiCyUrC8@6* literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/Api_2_Enh_Giid_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/Api_2_Enh_Giid_1.java new file mode 100644 index 0000000..5bc47d5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/Api_2_Enh_Giid_1.java @@ -0,0 +1,233 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Giid_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.toolkit.api_2_enh_giid; + +import uicc.toolkit.*; +import uicc.test.util.*;; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Giid + * + * @version 0.0.1 - 28 oct. 2004 + * @author 3GPP T3 SWG API + */ + +public class Api_2_Enh_Giid_1 extends TestToolkitApplet +{ + + /** Registry entry concerning applet instance */ + private static byte[] displayString = {(byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'O'}; + private static byte[] Menu1 = {(byte)'M', (byte)'E', (byte)'N', (byte)'U', (byte)'1'}; + private static byte[] Menu2 = {(byte)'M', (byte)'E', (byte)'N', (byte)'U', (byte)'2'}; + private static byte[] Menu3 = {(byte)'M', (byte)'E', (byte)'N', (byte)'U', (byte)'3'}; + private static byte[] Menu4 = {(byte)'M', (byte)'E', (byte)'N', (byte)'U', (byte)'4'}; + private static byte[] Menu66 = {(byte)'M', (byte)'E', (byte)'N', (byte)'U', (byte)'6', (byte)'6'}; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + private static final byte DCS_8_BIT_DATA = (byte) 0x04; + + + /** + * Constructor of the applet + */ + public Api_2_Enh_Giid_1() + { + + + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Giid_1 thisApplet = new Api_2_Enh_Giid_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(Menu1, (short) 0, (short) Menu1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(Menu2, (short) 0, (short) Menu2.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(Menu3, (short) 0, (short) Menu3.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(Menu4, (short) 0, (short) Menu4.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(Menu66, (short) 0, (short) Menu66.length, (byte) 0, false, (byte) 0, (short) 0); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + switch ( testCaseNb ) { + + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : get item identifier value is 03 + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + if (envHdlr.getItemIdentifier() == (byte) 0x03) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : Receive envelope with two item identifier TLV with first value 02 and second 01 + // method must return 02 + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + if (envHdlr.getItemIdentifier() == (byte) 0x02) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : Receive envelope with two item identifier TLV with first value 04 and second 01, call twice the method getItemIdentifier + // method must always return 04 + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + if ((envHdlr.getItemIdentifier() == (byte) 0x04) && (envHdlr.getItemIdentifier() == (byte) 0x04) ) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : Receive envelope with item identifier TLV and value of 66. FindTLV with TAG 02. getItemIdentifier and after getValueByte with offset 0 + // getItemIdentifier returned value = getValueByte returned value + testCaseNb = (byte) 4 ; + + bRes = false ; + try { + envHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1); + if ( envHdlr.getItemIdentifier() == envHdlr.getValueByte((short)0) ) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : Receive envelope without item identifier TLV and getItemIdentifier + // getItemIdentifier must throw ToolkitException (UNAVAILABLE_ELEMENT) + testCaseNb = (byte) 5 ; + + bRes = false ; + try { + envHdlr.getItemIdentifier(); + bRes = false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT ) + bRes = true; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : Receive envelope with item identifier TLV (66), send proactive command. Then getItemIdentifier + // method must return 66 + testCaseNb = (byte) 6 ; + + bRes = false ; + try { + proHdlr.initDisplayText((byte)0x80, DCS_8_BIT_DATA, displayString, (short) 0, (short) displayString.length); + proHdlr.send(); + if (envHdlr.getItemIdentifier() == (byte) 0x66) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + break; + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : Receive envelope with item identifier TLV but without item number, send proactive command. + testCaseNb = (byte) 7 ; + + bRes = false ; + try { + if (envHdlr.getItemIdentifier() == (byte) 0x00) + bRes = false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + break; + } + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/Test_Api_2_Enh_Giid.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/Test_Api_2_Enh_Giid.java new file mode 100644 index 0000000..93a4e21 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/Test_Api_2_Enh_Giid.java @@ -0,0 +1,134 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Giid.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_giid; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Giid + * + * @version 0.0.1 - 28 oct. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Giid extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/Api_2_Enh_Giid"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Giid() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8012" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "05" + // V Maximum number of menu entries + "0101" + // Position and Id of the first item + "0202" + // Position and Id of the first item + "0303" + // Position and Id of the first item + "0404" + // Position and Id of the first item + "0566" + // Position and Id of the first item + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // 1: Send Envelope Menu Selection with Item Identifier set to 03 + response = test.envelopeMenuSelection("100103",""); + + // 2 : Send Envelope Menu Selection with two Item Identifier TLV + response = test.envelopeMenuSelection("10010210 0101",""); + + // 3 : Send Envelope Menu Selection with two Item Identifier TLV + response = test.envelopeMenuSelection("90010410 0101",""); + + // 4 : Send Envelope Menu Selection Item Identifier set to 66 + response = test.envelopeMenuSelection("900166",""); + + // 5 : Send Unrecognized Envelope + test.unrecognizedEnvelope(); + + // 6 : Send Envelope Menu Selection with item identifier set to 66 + response = test.envelopeMenuSelection("100166",""); + + // Fetch the proactive command + response = test.fetch("13"); + result = response.checkData("D0118103 01218082 0281028D 06044845" + + "4C4C4F"); + test.terminalResponse("81030121 80020282 81030100"); + + // 7 : Send Unrecognized envelope with item Identifier TLV but without Item Number + response = test.sendApdu("80C20000 08010682 02018110 00"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "07CCCCCC CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/applet.opt new file mode 100644 index 0000000..14af638 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_giid.Api_2_Enh_Giid_1 +uicc.test.toolkit.api_2_enh_giid +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/javacard/api_2_enh_giid.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_giid/javacard/api_2_enh_giid.cap new file mode 100644 index 0000000000000000000000000000000000000000..59d53b51e19b233ec493923f48a8033e87f7a7ac GIT binary patch literal 3551 zcmb7G4@?th6o22{_3qk2DcaTphB_l?qEZSBQB;OVC*zM5P!_>pEp=3o)>2JCmz8QF z1I2;=l`JwdLY)8S;&f`VxQ*$IGPCIv=QK;yL`0ogjEft4S0G1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Sy&x#Ypm|2G(yPK$VW3fP94A+? z!7Qg>BeZI*I#eC%3;)(uT<$_JQ4-4k4QB9etIOs@Ya;9*aNzq%f=U6in)Y&dFG=w* zuo|M!_mreXDIpf3v5f_9@idJ8hnP6Y`3{DN?rt0xjT%Z^6o$hn{5DeYviUQo|T3T8$BPfFrjQjFA-M9h}~ YVSF9RoF~J71Ll|@h{toU>M^K)06$bt7ytkO literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/Api_2_Enh_Gtsz_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/Api_2_Enh_Gtsz_1.java new file mode 100644 index 0000000..1db8c50 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/Api_2_Enh_Gtsz_1.java @@ -0,0 +1,103 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Gtsz_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gtsz; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_enh_gtsz + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Gtsz_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + private final byte[] DisplayText = {(byte)'A',(byte)'P',(byte)'P',(byte)'L',(byte)'E',(byte)'T',(byte)'1'}; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Gtsz_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Gtsz_1 thisApplet = new Api_2_Enh_Gtsz_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + // -------------------------------------------- + // Test Case 1 : GetSize() after applet triggering + testCaseNb = (byte) 1 ; + bRes = false ; + try { + if(envHdlr.getSize() == (byte)0x33) + bRes = true; + else + bRes = false; + } + catch (ToolkitException e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 2 : Getsize() after proactive command + + (ProactiveHandlerSystem.getTheHandler()).initDisplayText((byte)00,(byte)0xF6,DisplayText,(short)0,(short)DisplayText.length); + (ProactiveHandlerSystem.getTheHandler()).send(); + + testCaseNb = (byte) 2 ; + bRes = false ; + try { + if(envHdlr.getSize() == (byte)0x33) + bRes = true; + else + bRes = false; + } + catch (ToolkitException e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/Test_Api_2_Enh_Gtsz.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/Test_Api_2_Enh_Gtsz.java new file mode 100644 index 0000000..5aa63ac --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/Test_Api_2_Enh_Gtsz.java @@ -0,0 +1,118 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Gtsz.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gtsz; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Gtsz + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Gtsz extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/Api_2_Enh_Gtsz"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Gtsz() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + /* 1: Send Unrecognized Envelope with Tag 02, length 02 + Tag 06, length 06 + Tag 33, length C8. + */ + response = test.sendApdu( "80 C2 00 00 33" + + "01 31 " + + "02 02 83 81" + + "33 2B" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "01020304 05060708 090A0B"); + response = test.fetch("15"); + result = response.checkData("D0138103 01210082 0281028D 08F64150" + + "504C4554 31"); + test.terminalResponse("81030121 00020282 81030100"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "02CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/applet.opt new file mode 100644 index 0000000..9e5eac2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_gtsz.Api_2_Enh_Gtsz_1 +uicc.test.toolkit.api_2_enh_gtsz +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/javacard/api_2_enh_gtsz.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gtsz/javacard/api_2_enh_gtsz.cap new file mode 100644 index 0000000000000000000000000000000000000000..f2af2e498015656b1cf79779d6e0b75e57e365b5 GIT binary patch literal 2991 zcmb7_3v5$W7{|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fksKiq^?

NQ6|W3ny-eJkhW8>t$0|RYS(S+`5apwi=vcio6e2wm!`R|5V1VSLE458DG)pOY zvqV4&Em|M>8b2UPF5_ix-s4|QP!hO6!`g5{vxF-#nWbEX$;^p4qp6i@6dAVzW8Mm^UZd8r7PW3lJBT#xAl9_d zbO(*j*(jd84di+?+XjqL(?LOsf~^y?#sJG01JY^aOsjigd^@CW0|mp4L?|Xg?d%Xk zS|(QD4{7STYSI7y-55Vr>IN?!QDBUS=AaVK$YS2fdtFwqyM8oSQe1+6mv}};=e+$B z@f}fej79G1Qojp1ejiDQ3>Ud9Ylcp#O=ZStK`D`n3)xgwDoM>`6fCRAjOTuLVqJJM zGKoy6#K$(@9dZS|0kj)}O@S6%b7(8%Xrh~?INQjggGpoxQsD=SgMlVc!nD!p29yjI zKV1(Xdk4j_eMY>=V`g)B zanKfrouXCfcn|m4M?IbFv+?D>c3skn{6VVz&HrPq^y1(Wk63Is5E6uzA0y~69*Gm; zHUJ?+Xz($}uB0F_yB89K&K@J&ONtQlc_BgQ+A%^4lT4t59xmhvO*qEU;w(x$A;k|Z zSqKn%Zw#C`jL@fIm@P?R;$6#O R7vbLkDR|^z+^Z$z=`ZsmC;0#X literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/Api_2_Enh_Gvby_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/Api_2_Enh_Gvby_1.java new file mode 100644 index 0000000..5179397 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/Api_2_Enh_Gvby_1.java @@ -0,0 +1,213 @@ +//----------------------------------------------------------------------------- +//Api_2_Enh_Gvby.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gvby; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + + +/** + * Test Area : uicc.test.toolkit.api_2_enh_gvby + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Api_2_Enh_Gvby_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Enh_Gvby_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Enh_Gvby_1 thisApplet = new Api_2_Enh_Gvby_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : use the method getValueByte with the offset parameter = 0 + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + if (envHdlr.getValueByte((short)0)==0) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : use the method getValueByte() with the offset parameter out of the tlv + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + if ((envHdlr.findTLV((byte)2,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.getValueByte((short)3)==0x00 )) + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : normal execution of the getValueByte() methodon TAG 02 and offset 1 + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + if ((envHdlr.findTLV((byte)2,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.getValueByte((short)1)==(byte)0x81 )) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : normal execution of the getValueByte() method on TAG 02 and offset 0 + testCaseNb = (byte) 4 ; + + bRes = false ; + try { + if ((envHdlr.findTLV((byte)2,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.getValueByte((short)0)==(byte)0x83 )) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : normal execution of the getValueByte() method on TAG 33 and offset 7E + testCaseNb = (byte) 5 ; + + bRes = false ; + try { + if ((envHdlr.findTLV((byte)0x33,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.getValueByte((short)0x007E)==(byte)0x7F )) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : normal execution of the getValueByte() method on TAG 33 and offset 80 + testCaseNb = (byte) 6 ; + + bRes = false ; + try { + if ((envHdlr.findTLV((byte)0x33,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.getValueByte((short)0x0080)==(byte)0x81 )) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : normal execution of the getValueByte() method on TAG 33 and offset 7F + testCaseNb = (byte) 7 ; + + bRes = false ; + try { + if ((envHdlr.findTLV((byte)0x33,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.getValueByte((short)0x007F)==(byte)0x80 )) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : normal execution of the getValueByte() method on TAG B3 and offset C7 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + if ((envHdlr.findTLV((byte)0xB3,(byte)1)==TLV_FOUND_CR_NOT_SET) + &&(envHdlr.getValueByte((short)0x00C7)==(byte)0xC8 )) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + } + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/Test_Api_2_Enh_Gvby.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/Test_Api_2_Enh_Gvby.java new file mode 100644 index 0000000..99798bf --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/Test_Api_2_Enh_Gvby.java @@ -0,0 +1,131 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Enh_Gvby.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_enh_gvby; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Gvby + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Enh_Gvby extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_enh_gvby"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Enh_Gvby() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + for(byte i = 0; i <= (byte)8; i++ ) + { + /* 1: Send Unrecognized Envelope with Tag 02, length 02 + Tag 06, length 06 + Tag 33, length C8. + */ + response = test.sendApdu( "80 C2 00 00 DA" + + "01 81 D7" + + "02 02 83 81" + + "06 06" + + "01020304 0506" + + "33 81 C8" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F80" + + "81828384 85868788 898A8B8C 8D8E8F90" + + "91929394 95969798 999A9B9C 9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAABAC ADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABBBC BDBEBFC0" + + "C1C2C3C4 C5C6C7C8 "); + if(i == 0) + result = response.checkSw("90 00"); + else + result &= response.checkSw("90 00"); + } + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "08CCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/applet.opt new file mode 100644 index 0000000..56b7a51 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_enh_gvby.Api_2_Enh_Gvby_1 +uicc.test.toolkit.api_2_enh_gvby +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/javacard/api_2_enh_gvby.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_enh_gvby/javacard/api_2_enh_gvby.cap new file mode 100644 index 0000000000000000000000000000000000000000..a45713b1e18749c680337ebfa10f05a27fd6ff36 GIT binary patch literal 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tP9P%L?=FtBb zHR>Ubd^D=7)tLsZ;ZJ^qO$E7&*{lVZpqj2~v7 zi7%kn^DF%Vaxee)Jw$s^j4$A1x!Bc9H;!lOljO?GVuCpRx(IJ#gq%9TEg6d;;$-WB z9Q6p|O1)x&ILo>SO4gHMxN@$TAkLdE!Xb|c;w&oWh*P196N|fO>I;%Okr>4QaRzh& z4tfM|RE7)*el7ui ML@0qStTQ703*TXD(f|Me literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/Api_2_Erh_Apda_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/Api_2_Erh_Apda_Bss_1.java new file mode 100644 index 0000000..9b26228 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/Api_2_Erh_Apda_Bss_1.java @@ -0,0 +1,409 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Apda_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_apda_bss; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_apda_bss + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Apda_Bss_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] buffer5 = new byte[5]; + private byte[] buffer = new byte[8] ; + private byte[] copyBuffer = new byte[32] ; + private byte[] compareBuffer = new byte[32] ; + private byte[] large_buffer; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Apda_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Apda_Bss_1 thisApplet = new Api_2_Erh_Apda_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + short offset = 0 ; + short length = 0 ; + + // -------------------------------------------- + // Test Case 1 : Null buffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + EnvRespHdlr.appendTLV((byte) 1, (byte) 1); + + try { + offset = (short)0 ; + length = (short)1 ; + + EnvRespHdlr.appendArray(null, offset, length) ; + } catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : offset>buffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + try { + offset = (short)5 ; + length = (short)1 ; + + EnvRespHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : offset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + offset = (short)-1 ; + length = (short)1 ; + + EnvRespHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : length>buffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + offset = (short)0 ; + length = (short)6 ; + + EnvRespHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : offset + length>buffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + offset = (short)3 ; + length = (short)3 ; + + EnvRespHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : length < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + try { + offset = (short)0 ; + length = (short)-1 ; + + EnvRespHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : handler overflow + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + try { + offset = (short)0 ; + length = (short)(EnvRespHdlr.getCapacity() + 1) ; + large_buffer = new byte[length]; + Util.arrayFillNonAtomic(large_buffer,(short)0,(short)large_buffer.length,(byte)0); + EnvRespHdlr.appendArray(large_buffer, offset, length) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : A successfull append does not modify the current TLV + testCaseNb = (byte) 8 ; + bRes = false ; + + + + try { + + EnvRespHdlr.clear(); + + //built the first tlv + buffer[0]=(byte)0x11; + buffer[1]=(byte)0x22; + buffer[3]=(byte)0x33; + EnvRespHdlr.appendTLV((byte)0x81,buffer,(short) 0x00, (short) 3); + + //built the second tlv + buffer[0]=(byte)0x99; + buffer[1]=(byte)0x77; + EnvRespHdlr.appendTLV((byte)0x82,buffer,(short) 0x00, (short) 2); + + + // Initialise buffer + for (short i=0; i<(short)buffer.length; i++) + buffer[i] = (byte) ((byte)0xFF-i) ; + + // Select Command Details TLV + EnvRespHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append buffer + offset = (short)0 ; + length = (short)buffer.length ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + + // Verify current TLV + if(EnvRespHdlr.getValueLength()==(short)3) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Successfull call + testCaseNb = (byte) 9 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)buffer.length; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + compareBuffer[i] = (byte)((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + } + + try { + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append buffer + offset = (short)0 ; + length = (short)buffer.length ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + + // Copy the handler + offset = (short) 0 ; + length = (short) 8 ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset,compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successfull call + testCaseNb = (byte) 10 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)buffer.length; i++) + { + buffer[i] = (byte)i ; // 00 01 02 03 04 05 06 07 + if (i>=(byte)2) + compareBuffer[(short)(i+6)] = (byte)i ; // FF FE FD FC FB FA F9 F8 02 03 04 05 06 07 + } + + try { + + // Append buffer + offset = (short)2 ; + length = (short)6 ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + + // Copy the handler + offset = (short)0 ; + length = (short)14 ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Successfull call + testCaseNb = (byte) 11 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)buffer.length; i++) + { + buffer[i] = (byte) ((i+1)*0x11) ; // 11 22 33 44 55 66 77 88 + if (i>=(byte)2) + compareBuffer[(short)(i+12)] = (byte)((i+1)*0x11) ; // FF FE FD FC FB FA F9 F8 02 03 04 05 06 07 33 44 55 66 + } + + try { + + // Append buffer + offset = (short)2 ; + length = (short)4 ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + + // Copy the handler + offset = (short)0 ; + length = (short)18 ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset,compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 12 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append buffer + try { + offset = (short)2 ; + length = (short)4 ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/Test_Api_2_Erh_Apda_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/Test_Api_2_Erh_Apda_Bss.java new file mode 100644 index 0000000..41b3901 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/Test_Api_2_Erh_Apda_Bss.java @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Apda_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_apda_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_apda_bss + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Apda_Bss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_apda_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Apda_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 12 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/applet.opt new file mode 100644 index 0000000..ea71f99 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_apda_bss.Api_2_Erh_Apda_Bss_1 +uicc.test.toolkit.api_2_erh_apda_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/javacard/api_2_erh_apda_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_apda_bss/javacard/api_2_erh_apda_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..c7077a0287fc9a7aebf2b309d3c0876ac1b3cce7 GIT binary patch liter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y)yZWA%uVp!zE;y!*4SPF26q8h5iC6ZO@$HcV>)X%eMMMq6x!=3hL3Uj;? z?+SBNS&08dhW}T_h}$KUsAfruPA^&kX#5-dV=v2$8=_Bn4so zjE-<6?E#x-nk%boNYO{QvOg8MvQ2Jq*<_*Jgx`=A(ar37nb>4DxhulG6`{_EG2`aK z)XicVB21lsF*0>F9d#@5WeC;@?Fk6hDMt6bhxIyQ(=qxbq)VD`GI+vV;QCo`qnduq z7XBXNlOE(c&u>|xx9V{r32h=~i_Wa1S+07b4~@3-fBM9PTP2ginD^Z$1D-%@Q+cbm zJ+d9jctqd3qB*@E?izU!+nB`8sr7EI@--pL*U7eB9Toz4?~9Tor8Z>eWaljBc)d#$ z^*T`>XHJkDdb3%w7-@z{iDN3kYC^RP$|d>!OU$4~DjO^bNjAKbA`)ja>FtKJJ$xdGaPIdru;N(&9;H0Q1I0ft=1bOI#LwJ~_v;IT}XJ7>^V4v|MoP@Rf zDJ-N|ag+QK0Yv2izOFj}>=Imaci$Lh*P`r=A^Q4%?+?t2erD-BsBTrgjAL+O3$R+nYAM=MRi!+N zagB`p%Tz5zTal`i6h7AJsP(CqqOCDi%7-yiv=yh8r7a0nRy(e& z*b-E7w?NcFw3VO=`6_0JS{G_5+Fe$qT-U`q70sTjMQJx$6;*|sb8J!5Y`a>NcI#77 b8HQL<(Hmh+rGT#&fK{gfHeeodjm-KVJCFV& literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/Api_2_Erh_Aptlb_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/Api_2_Erh_Aptlb_Bss_1.java new file mode 100644 index 0000000..600fcd4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/Api_2_Erh_Aptlb_Bss_1.java @@ -0,0 +1,506 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Aptlb_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlb_bss; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlb_bss + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Aptlb_Bss_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte compareBuffer[] = new byte[256] ; + private byte buffer5[] = new byte[5] ; + private byte buffer256[] = new byte[256] ; + private byte buffer[] = new byte[32] ; + private byte copyBuffer[] = new byte[256] ; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Aptlb_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Aptlb_Bss_1 thisApplet = new Api_2_Erh_Aptlb_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + short length = 0 ; + short offset = 0 ; + short valueLength = 0 ; + short valueOffset = 0 ; + + + // -------------------------------------------- + // Test Case 1 : Null value + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)1 ; + + try { + EnvRespHdlr.appendTLV(tag, null, valueOffset, valueLength) ; + } + catch (NullPointerException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : valueOffset >= value.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)5 ; + valueLength = (short)1 ; + + try { + EnvRespHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : valueOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)-1 ; + valueLength = (short)1 ; + + try { + EnvRespHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : valueLength > value.Length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)6 ; + + try { + EnvRespHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : valueOffset + valueLength > value.Length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)3 ; + valueLength = (short)3 ; + + try { + EnvRespHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : valueLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)-1 ; + + try { + EnvRespHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : handler overflow + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)(EnvRespHdlr.getCapacity() - 1) ; + + try { + EnvRespHdlr.appendTLV(tag, buffer256, valueOffset, valueLength) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : bad input parameter + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)256 ; + + try { + EnvRespHdlr.appendTLV(tag, buffer256, valueOffset, valueLength) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : the current TLV is not modified + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + EnvRespHdlr.clear(); + + //built the first tlv + buffer[0]=(byte)0x11; + buffer[1]=(byte)0x22; + buffer[3]=(byte)0x33; + EnvRespHdlr.appendTLV((byte)0x81,buffer,(short) 0x00, (short) 3); + + //built the second tlv + buffer[0]=(byte)0x99; + buffer[1]=(byte)0x77; + EnvRespHdlr.appendTLV((byte)0x82,buffer,(short) 0x00, (short) 2); + + for (short i=0; i<(short)8; i++) + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + + // Select tag 02h + EnvRespHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + tag = (byte)0x04 ; + valueOffset = (short)0 ; + valueLength = (short)8 ; + EnvRespHdlr.appendTLV(tag, buffer, valueOffset, valueLength) ; + + // Verify current TLV + if(EnvRespHdlr.getValueLength()== (short)3) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successfull call + testCaseNb = (byte) 10 ; + bRes = false ; + + tag = (byte)4 ; + + // Initialise buffers + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + compareBuffer[(short)(i+2)] = (byte)((byte)0xFF-i) ; // 04 08 FF FE FD FC FB FA F9 F8 + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)8 ; + + try { + + //erase the copy buffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append buffer + valueOffset = (short)0 ; + valueLength = (short)8 ; + EnvRespHdlr.appendTLV(tag, buffer, valueOffset, valueLength) ; + + // Copy the handler + offset = (short) 0 ; + length = (short) EnvRespHdlr.getLength() ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Successfull call + testCaseNb = (byte) 11 ; + bRes = false ; + + tag = (byte)0x85 ; + + // Initialise buffers + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte)i ; // 00 01 02 03 04 05 06 07 + } + compareBuffer[10] = tag ; + compareBuffer[11] = (byte)0x06 ; + for (short i=0; i<(short)6; i++) { + compareBuffer[(short)(12+i)] = (byte)(i+2) ; // 04 08 FF FE FD FC FB FA F9 F8 85 06 02 03 04 05 06 07 + } + + + try { + + //erase the copy buffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Append buffer + valueOffset = (short)2 ; + valueLength = (short)6 ; + EnvRespHdlr.appendTLV(tag, buffer, valueOffset, valueLength) ; + + // Copy the handler + offset = (short)0 ; + length = (short)EnvRespHdlr.getLength() ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + + tag = (byte) 0x01 ; + // Initialise buffers + for (short i=0; i<8; i++) { + buffer[i] = (byte) ((i+1)*0x11) ; // 11 22 33 44 55 66 77 88 + } + + compareBuffer[18] = tag ; + compareBuffer[19] = (byte) 0x04 ; + compareBuffer[20] = (byte) 0x33 ; + compareBuffer[21] = (byte) 0x44 ; + compareBuffer[22] = (byte) 0x55 ; + compareBuffer[23] = (byte) 0x66 ; + + try { + + //erase the copy buffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Append buffer + valueOffset = (short)2 ; + valueLength = (short)4 ; + EnvRespHdlr.appendTLV(tag, buffer, valueOffset, valueLength) ; + + // Copy the handler + offset = (short)0 ; + length = (short)EnvRespHdlr.getLength() ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successfull call + testCaseNb = (byte) 13 ; + bRes = false ; + + tag = (byte)04 ; + + // Initialise buffers + for (short i=0; i<(short)81; i++) { + buffer256[i] = (byte)i ; + compareBuffer[(short)(i+3)] = (byte)i ; + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0x80 ; + + try { + + //erase the copy buffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append buffer + valueOffset = (short)0 ; + valueLength = (short)0x80 ; + EnvRespHdlr.appendTLV(tag, buffer256, valueOffset, valueLength) ; + + // Copy the handler + offset = (short) 0 ; + length = (short)EnvRespHdlr.getLength() ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 14 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append buffer + try { + valueOffset = (short)0 ; + valueLength = (short)0x80 ; + EnvRespHdlr.appendTLV(tag, buffer256, valueOffset, valueLength) ; + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/Test_Api_2_Erh_Aptlb_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/Test_Api_2_Erh_Aptlb_Bss.java new file mode 100644 index 0000000..c0c084a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/Test_Api_2_Erh_Aptlb_Bss.java @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Aptlb_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlb_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlb_bss + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Aptlb_Bss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_aptlb_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Aptlb_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 14 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0ECCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/applet.opt new file mode 100644 index 0000000..4d7f054 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_aptlb_bss.Api_2_Erh_Aptlb_Bss_1 +uicc.test.toolkit.api_2_erh_aptlb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/javacard/api_2_erh_aptlb_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss/javacard/api_2_erh_aptlb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..2050d2aa40f6ffcd4c7365911212e5a62e23c8eb GIT binary patch literal 4710 zcmbVPeQ*=U6@PoT_o36*S(Z*V=EE?<)FQ2o#m5-Thh-UBFm??%!3<1^Y>QxQER7{# zFbO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OtIp@Au8UTmd! zIx^0Ns-R-Yc}ldvSUiDi3xQ0cD+$7DLRo@PRW3^id_vgH_kyQ9Z5I0GG0b>sQ{&(h zJv1R`k|y?1aFKG>MjDiRK?|i6vl@q1wW4C`24;~piayh_|>EyJn{W zHD?Br+lgjJEk8w-Tq!McC3KwX#?8jcqgJs>Q=es(S6w>Tov5Ys$OdMoq+^hh_6Pgx zhVs7>b~p$0M^1lsx;Y2w=0M%jYvUot zd(Y)%|FFk#lt$e}PLC7+qe82QhnTWu@F)*jt~2v1-g@TG@7VGC$H2miEWd;E}E;JdhP8N&^Xk^uZHXd>WeaT5oA7CQ0Zr&v+& z3;2Sd^UwvyG2$s^?-L7LgUK+GwG~2aP%D%sLs~D41^>fm{QdhlV=|(Qh2p6KQ?WMy zRWK7~ld= value1.length + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + tag = (byte)1 ; + value1Offset = (short)5 ; + value1Length = (short)1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : value1Offset < 0 + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + tag = (byte)1 ; + value1Offset = (short)-1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : value1Length > value1.Length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + tag = (byte)1 ; + value1Offset = (short)0 ; + value1Length = (short)6 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : value1Offset + value1Length > value1.length + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + tag = (byte)1 ; + value1Offset = (short)3 ; + value1Length = (short)3 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : value1Length < 0 + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + tag = (byte)1 ; + value1Offset = (short)0 ; + value1Length = (short)-1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : value2Offset >= value2.length + testCaseNb = (byte) 8 ; + bRes = false ; + value1Offset = (short)0 ; + value1Length = (short)1 ; + + try { + tag = (byte)1 ; + value2Offset = (short)5 ; + value2Length = (short)1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : value2Offset < 0 + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)-1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : value2Length > value2.Length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)6 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : value2Offset + value2Length > value2.length + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)3 ; + value2Length = (short)3 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : value2Length < 0 + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)-1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, value1Offset,value1Length,value2,value2Offset, value2Length); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 13 : handler overflow + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + tag = (byte)1 ; + EnvRespHdlr.appendArray(buffer256,(short)0,(short)(EnvRespHdlr.getCapacity() - 1)); + + try { + EnvRespHdlr.appendTLV(tag, buffer256,(short)0,(short)1,buffer256,(short)0,(short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : bad input parameter + testCaseNb = (byte) 14 ; + bRes = false ; + value1 = new byte[256]; + value2 = new byte[256]; + + try { + tag = (byte)1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1,(short)0,(short)0x0100,value2,(short)0,(short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : bad input parameter + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + tag = (byte)1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1,(short)0,(short)1,value2,(short)0,(short)0x100) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 9 : the current TLV is not modified + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + + // clear the handler + EnvRespHdlr.clear(); + + //built the first tlv + + buffer[0]=(byte)0x11; + buffer[1]=(byte)0x22; + buffer[3]=(byte)0x33; + EnvRespHdlr.appendTLV((byte)0x81,buffer,(short) 0x00, (short) 3); + + //built the second tlv + buffer[0]=(byte)0x99; + buffer[1]=(byte)0x77; + EnvRespHdlr.appendTLV((byte)0x82,buffer,(short) 0x00, (short) 2); + + for (short i=0; i<(short)8; i++) + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + + for (short i=8; i<(short)0x11; i++) + buffer[i] = (byte) ((byte)0xFF-i) ; + + // Select tag 02h + EnvRespHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + tag = (byte)0x04 ; + value1Offset = (short)0 ; + value1Length = (short)8 ; + value2Offset = (short)8 ; + value2Length = (short)8 ; + EnvRespHdlr.appendTLV(tag, buffer,value1Offset,value1Length,buffer,value2Offset, value2Length) ; + + // Verify current TLV + if(EnvRespHdlr.getValueLength()==3) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Successfull call + testCaseNb = (byte) 17 ; + bRes = false ; + + tag = (byte)4 ; + + // Initialise buffers + Util.arrayCopyNonAtomic(buffer,(short)0,compareBuffer,(short)2,(short)0x10); + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)0x10 ; + + try { + + //erase the copybuffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append buffer + value1Offset = (short)0 ; + value1Length = (short)8 ; + + value2Offset = (short)8 ; + value2Length = (short)8 ; + EnvRespHdlr.appendTLV(tag, buffer,value1Offset,value1Length,buffer,value2Offset, value2Length) ; + + // Copy the handler + EnvRespHdlr.copy(copyBuffer,(short)0,(short) EnvRespHdlr.getLength()) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer,(short)0, compareBuffer, (short)0,(short)0x10)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : Successfull call + testCaseNb = (byte) 18 ; + bRes = false ; + + tag = (byte)0x85 ; + + // Initialise buffers + for (short i=0; i<(short)0x10; i++) + buffer[i] = (byte)i ; // 00 01 02 03 04 05 06 07 + + compareBuffer[0x12] = tag ; + compareBuffer[0x13] = (byte)0x0C ; + Util.arrayCopyNonAtomic(buffer,(short)0x02,compareBuffer,(short)0x14,(short)0x06); + Util.arrayCopyNonAtomic(buffer,(short)0x0A,compareBuffer,(short)0x1A,(short)0x06); + + try { + //erase the copybuffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Append buffer + value1 = new byte[8]; + Util.arrayCopyNonAtomic(buffer,(short)0,value1,(short)0,(short)value1.length); + value1Offset = (short)2 ; + value1Length = (short)6 ; + value2 = new byte[8]; + Util.arrayCopyNonAtomic(buffer,(short)8,value2,(short)0,(short)value2.length); + value2Offset = (short)2 ; + value2Length = (short)6 ; + EnvRespHdlr.appendTLV(tag, value1,value1Offset,value1Length,value2,value2Offset,value2Length) ; + + // Copy the handler + EnvRespHdlr.copy(copyBuffer, (short)0,(short) EnvRespHdlr.getLength()) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer,(short)0, compareBuffer,(short)0, EnvRespHdlr.getLength())==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 19 : Successfull call + testCaseNb = (byte) 19 ; + bRes = false ; + + tag = (byte) 0x01 ; + // Initialise buffers + for (short i=1; i<0x11; i++) + buffer[i] = (byte) (i*0x11) ; // 11 22 33 44 55 66 77 88 + + compareBuffer[0x20] = tag ; + compareBuffer[0x21] = (byte) 0x08 ; + Util.arrayCopyNonAtomic(buffer,(short)0x02,compareBuffer,(short)0x22,(short)0x04); + Util.arrayCopyNonAtomic(buffer,(short)0x0B,compareBuffer,(short)0x26,(short)0x04); + + try { + //erase the copybuffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Initialise value1 and value2 + Util.arrayCopyNonAtomic(buffer,(short)0,value1,(short)0,(short)value1.length); + Util.arrayCopyNonAtomic(buffer,(short)9,value2,(short)0,(short)value1.length); + value2[7] = (byte)0; + + value1Offset = (short)2 ; + value1Length = (short)4 ; + + value2Offset = (short)2 ; + value2Length = (short)4 ; + EnvRespHdlr.appendTLV(tag, value1,value1Offset,value1Length,value2,value2Offset, value2Length) ; + + // Copy the handler + EnvRespHdlr.copy(copyBuffer,(short) 0, EnvRespHdlr.getLength()) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer,(short)0, compareBuffer, (short)0, EnvRespHdlr.getLength())==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 20 : Successfull call + testCaseNb = (byte) 20 ; + bRes = false ; + + tag = (byte)04 ; + + // Initialise buffers + for (short i=0; i<(short)0x00FD; i++) { + buffer256[i] = (byte)(i) ; + compareBuffer[(short)(i+3)] = (byte)(i) ; + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0xFD ; + + try { + + //erase the copybuffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Clear the handler + EnvRespHdlr.clear() ; + + // Initialise value1 and value2 + value1 = new byte[128]; + Util.arrayCopyNonAtomic(buffer256,(short)0,value1,(short)0,(short)value1.length); + value1Offset = (short)0; + value1Length = (short)0x80; + + value2 = new byte[125]; + Util.arrayCopyNonAtomic(buffer256,(short)0x80,value2,(short)0,(short)value2.length); + value2Offset = (short)0; + value2Length = (short)0x7D ; + EnvRespHdlr.appendTLV(tag, value1,value1Offset,value1Length,value2,value2Offset, value2Length) ; + + // Copy the handler + EnvRespHdlr.copy(copyBuffer,(short)0, EnvRespHdlr.getLength()) ; + + byte[] toto = new byte[256]; + Util.arrayCopyNonAtomic(compareBuffer,(short)0,toto,(short)0,(short)EnvRespHdlr.getLength()); + + // Compare buffer + if(Util.arrayCompare(copyBuffer, (short)0, compareBuffer,(short)0, EnvRespHdlr.getLength())==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 21 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 21 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append buffer + try { + value1Offset = (short)0; + value1Length = (short)0x01; + value2Offset = (short)0; + value2Length = (short)0x01; + EnvRespHdlr.appendTLV(tag, buffer256,value1Offset,value1Length,buffer256,value2Offset, value2Length) ; + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/Test_Api_2_Erh_Aptlb_Bss_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/Test_Api_2_Erh_Aptlb_Bss_Bss.java new file mode 100644 index 0000000..f1e9b4f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/Test_Api_2_Erh_Aptlb_Bss_Bss.java @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Aptlb_Bss_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlb_bss_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlb_bss_bss + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Aptlb_Bss_Bss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_aptlb_bss_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Aptlb_Bss_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 15 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "15CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/applet.opt new file mode 100644 index 0000000..0f947ad --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_aptlb_bss_bss.Api_2_Erh_Aptlb_Bss_Bss_1 +uicc.test.toolkit.api_2_erh_aptlb_bss_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/javacard/api_2_erh_aptlb_bss_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlb_bss_bss/javacard/api_2_erh_aptlb_bss_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..28911329bbc720ec206bf637be856e63959209cc GIT binary patch literal 5700 zcmbVQ3s6+o89w)(bI*P3>n{7oC<=nCsEeS8phiTf_zI(@Y8{I!YzkouJFuEaG`Wx% zs|ZqUW7A2i?P$lO-PS}JaU7Yx?5NRcYnmDBqqb_2wwkDkjWfwu`k&p!g{zLR_wK*< z{^#6tzW;R||EXMni5*FB8(J!+q5+p35wxgmS;@qT#pS+5C5tP{%a$&iw5a@lrx1!P zS=88;>+aokE3M_C`S`mp2ETZ9p>6k(*Zu1=9oy>XuGyb@_vZ3*%VxJV{Ou>Eu8%+5 zuxE#-z3fE3aJlF7+?1u-#G2I3YYT6q&RL&ZW*T1jm-%AP1^4M!e7kPsFWtDSweH5M z!$0$<{wer-?>Xi2&Fp)JJLm7Low#hv{@-Pc+I@4>f~ULhyteYSwD+H{DW)T{aN(tW zTTdVP=ycT~#}@bb_eJH;KOVE~iv#OTJD%F~mP`05_piQRU!V20&Huff_w!wUDE?(# z<{R(TjN>PHYrnVL^UlYi^z;|=+E?@#3+MHGV|LxQBKxy6d-lZ%Yf^K1&t5-zVai=g z?`JzAT{HHsS^MOXt6!ck+uIW8Q8z3(G?w~$`C2Ko=L(m(`XAdb38N*`5A8qV-~CLB z?9n1Q{H&F$|Fh!m9O12X!PfPCZ%+I{clU?ezu*0~`NZVI^NVjx>F7C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ux$@ZqN*_2`&VV^k@wRJs_~$pE!kF(#qXAYDLunMohh zEP_=L7lMAGR}{Rm_=u4?WJQbv6tTww1bdAkSA;l?PU9+w4X2Tou(y>)c(tN?!H*JA z(+c&1dha2zEO;Cp;1h|A_V0BYB4OyS)0-S9ESsbSR0F2r+ z8h#Hr%rrnx2k03OaTs5)0^3}%`8=_{g8FQMCHKb_G`DA)9445mgn9~Ni?9x1gbnDp zW$+%i{>-_klaB0{duB$Gu3k0KkH3`L%DCi97_JmhEUnnrbu8~oaU`qne zENrX>z{Uo)F_a;f(faZwN+nSm`DEcV>ZAG5dpgafQ=)G<4l-4e=`=E(QbneU*^^Hv zVwqB$PE9J#wu&NFh=NT##x|bd6jnOH4y7`Yv4pWmu;`2yN_Gm(9Ppu?7ubg`D=wvI zvnUPWqEm^HNQP;yEY}#r@gWoRCn zj~1gPTrPJ|s2$zKsib={yv)XVDmR;Uch42NOWCuOFR5I>@pedq`%h^GrvB`dX7Kf> zGaJ^65|8kQ9TOyaIS#f;!sv-Z13i@fWFP@G6O5b$)Sz<$J(~U;Ac1x)Ikd#7fF4SJ z0FZ$4;iMEx90%y3^eKG;>O^u-`UGDOsL#9;fIA`Nl5kpSe;%$!(kI*rBtb|DDUp8b zq4bMJ0_qp$q@Z+5h#pVBZY1zLmZb1>tB4*?KX)eZHmgbD4W3CW7eJm5mjUi=5C!|J GjQc-aSnve^ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/Api_2_Erh_Aptlbb_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/Api_2_Erh_Aptlbb_1.java new file mode 100644 index 0000000..f3bdd8a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/Api_2_Erh_Aptlbb_1.java @@ -0,0 +1,244 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Aptlbb_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbb; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbb + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Aptlbb_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte compareBuffer[] = new byte[10] ; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Aptlbb_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Aptlbb_1 thisApplet = new Api_2_Erh_Aptlbb_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + byte value = 0 ; + short length = 0 ; + short offset = 0 ; + byte[] buffer = new byte[256] ; + + // -------------------------------------------- + // Test Case 1 : handler overflow + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + offset = (short)0 ; + buffer[1] = (byte) 0x81; + buffer[2] = (byte) 250; + length = (short)(EnvRespHdlr.getCapacity() - 1) ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + + // appendTLV + try { + EnvRespHdlr.appendTLV(tag, value) ; + EnvRespHdlr.appendTLV(tag, value) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : the current TLV is not modified + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // clear the handler + EnvRespHdlr.clear(); + + //built the first tlv + buffer[0]=(byte)0x11; + buffer[1]=(byte)0x22; + buffer[3]=(byte)0x33; + EnvRespHdlr.appendTLV((byte)0x81,buffer,(short) 0x00, (short) 3); + + //built the second tlv + buffer[0]=(byte)0x99; + buffer[1]=(byte)0x77; + EnvRespHdlr.appendTLV((byte)0x82,buffer,(short) 0x00, (short) 2); + + + // Select tag 02h + EnvRespHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + EnvRespHdlr.appendTLV(tag, value) ; + + // Verify current TLV + if(EnvRespHdlr.getValueLength()==(short)3) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + //erase the begin of the array + for(short i=0;i<10;i++) + buffer[i]=(byte)0x00; + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append TLV + tag = (byte)0x84 ; + value = (byte)0x00 ; + EnvRespHdlr.appendTLV(tag, value) ; + + // Initialise compareBuffer + compareBuffer[0] = tag ; + compareBuffer[1] = (byte) 1; + compareBuffer[2] = value ; + + // Copy the handler + offset = (short)0 ; + length = (short)3 ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + //erase the begin of the array + for(short i=0;i<10;i++) + buffer[i]=(byte)0x00; + + // Append TLV + tag = (byte)0x01 ; + value = (byte)0xFE ; + EnvRespHdlr.appendTLV(tag, value) ; + + // Initialise compareBuffer + compareBuffer[3] = tag ; + compareBuffer[4] = (byte) 1; + compareBuffer[5] = value ; + + // Copy the handler + offset = (short)0 ; + length = (short)6 ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append TLV + try { + tag = (byte)0x01 ; + value = (byte)0xFE ; + EnvRespHdlr.appendTLV(tag, value) ; + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/Test_Api_2_Erh_Aptlbb.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/Test_Api_2_Erh_Aptlbb.java new file mode 100644 index 0000000..56aa79d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/Test_Api_2_Erh_Aptlbb.java @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Aptlbb.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbb; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbb + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Aptlbb extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_aptlbb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Aptlbb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 5 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/applet.opt new file mode 100644 index 0000000..323b19f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_aptlbb.Api_2_Erh_Aptlbb_1 +uicc.test.toolkit.api_2_erh_aptlbb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/javacard/api_2_erh_aptlbb.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb/javacard/api_2_erh_aptlbb.cap new file mode 100644 index 0000000000000000000000000000000000000000..5a778411794c4115e3675b827264fd393b738084 GIT binary patch literal 3524 zcmb7`eNa?Y6u{4Y@4mNh-!Af4cb7$CK?8M7KtL2j6Xc@^LB@~KoH1RNC2^76ffb8l zW?8f_VkOH)?Ms>(r%}>za5T$8`Y<&$QyNQ08>WwGCL5=kK1`)^S8Ca3{qgS3dGFqL zch2wJbM8IoR+aPA3=;l?ma<$J)yzPlqGWMldRb*@W<_CTS!v0l#TgZ)w@v``F0Akd zr`g_n?pkuor7<5_=gxTCHGk|2Z*O-tr&*r%6t8;2cJudp>Zha>9{ln1s-NF&z5Kna z)Mej4e_;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U2ITd9JD~veGM9INymq(_NeZuOLZlch>EbJ7J0zO+2 z`}&Hw!m4t@nX$zEbJrSO$k|;hy8YkHi)oQZ!uVfBKceLbu1t%=B3A%4LtW=1j12Ul z7DiOnS7X#wJ%ZV#5fiELYKFR;M;Inv+fpLMUCmGz=m_I=jSO|UR+H4VHbN@G{iG!@ zMgLS@H9}otBZ$2k5s`wcW~ehl#6-l&1!%6ITSZS<<$m W=rmSUF5vA9z<|GE^#2+?8~qLK2zd|y literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/Api_2_Erh_Aptlbb_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/Api_2_Erh_Aptlbb_Bss_1.java new file mode 100644 index 0000000..afd3f45 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/Api_2_Erh_Aptlbb_Bss_1.java @@ -0,0 +1,511 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Aptlbb_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbb_bss; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbb_bss + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Aptlbb_Bss_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte compareBuffer[] = new byte[256] ; + private byte buffer5[] = new byte[5] ; + private byte buffer256[] = new byte[256] ; + private byte buffer[] = new byte[32] ; + private byte copyBuffer[] = new byte[256] ; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Aptlbb_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Aptlbb_Bss_1 thisApplet = new Api_2_Erh_Aptlbb_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + short length = 0 ; + short offset = 0 ; + byte value1 = 0 ; + short value2Length = 0 ; + short value2Offset = 0 ; + + + // -------------------------------------------- + // Test Case 1 : Null value + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, null, value2Offset, value2Length) ; + } + catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : value2Offset >= value2.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)5 ; + value2Length = (short)1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : value2Offset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)-1 ; + value2Length = (short)1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : value2Length > value2.Length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)6 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : value2Offset + value2Length > value2.Length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)3 ; + value2Length = (short)3 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : valueLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)-1 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : handler overflow + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)(EnvRespHdlr.getCapacity() - 3) ; + byte[] large_buffer = new byte[value2Length]; + Util.arrayFillNonAtomic(large_buffer,(short)0,(short)large_buffer.length,(byte)0); + EnvRespHdlr.appendArray(large_buffer,(short)0,value2Length); + + try { + EnvRespHdlr.appendTLV(tag, value1, buffer256, value2Offset, (short)1); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : bad input parameter + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)255 ; + + try { + EnvRespHdlr.appendTLV(tag, value1, buffer256, value2Offset, value2Length) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : the current TLV is not modified + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + // clear the handler + EnvRespHdlr.clear(); + + //built the first tlv + buffer[0]=(byte)0x11; + buffer[1]=(byte)0x22; + buffer[3]=(byte)0x33; + EnvRespHdlr.appendTLV((byte)0x81,buffer,(short) 0x00, (short) 3); + + //built the second tlv + buffer[0]=(byte)0x99; + buffer[1]=(byte)0x77; + EnvRespHdlr.appendTLV((byte)0x82,buffer,(short) 0x00, (short) 2); + + for (short i=0; i<(short)8; i++) + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + + // Select tag 02h + EnvRespHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + tag = (byte)0x04 ; + value1 = (byte)0x05 ; + value2Offset = (short)0 ; + value2Length = (short)8 ; + EnvRespHdlr.appendTLV(tag, value1, buffer, value2Offset, value2Length) ; + + // Verify current TLV + if(EnvRespHdlr.getValueLength()==3) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successfull call + testCaseNb = (byte) 10 ; + bRes = false ; + + tag = (byte)4 ; + value1 = (byte)0x05 ; + + // Initialise buffers + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + compareBuffer[(short)(i+3)] = (byte)((byte)0xFF-i) ; // 04 08 FF FE FD FC FB FA F9 F8 + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)9 ; + compareBuffer[2] = value1 ; + + + try { + + //erase the copybuffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append buffer + value2Offset = (short)0 ; + value2Length = (short)8 ; + EnvRespHdlr.appendTLV(tag, value1, buffer, value2Offset, value2Length) ; + + // Copy the handler + offset = (short) 0 ; + length = (short) EnvRespHdlr.getLength() ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Successfull call + testCaseNb = (byte) 11 ; + bRes = false ; + + tag = (byte)0x85 ; + value1 = (byte)0x55 ; + + // Initialise buffers + for (short i=0; i<(short)8; i++) + buffer[i] = (byte)i ; // 00 01 02 03 04 05 06 07 + + compareBuffer[11] = tag ; + compareBuffer[12] = (byte)0x07 ; + compareBuffer[13] = value1 ; + + for (short i=0; i<(short)6; i++) + compareBuffer[(short)(14+i)] = (byte)(i+2) ; // 04 08 FF FE FD FC FB FA F9 F8 85 06 02 03 04 05 06 07 + + try { + //erase the copybuffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Append buffer + value2Offset = (short)2 ; + value2Length = (short)6 ; + EnvRespHdlr.appendTLV(tag, value1, buffer, value2Offset, value2Length) ; + + // Copy the handler + offset = (short)0 ; + length = (short)EnvRespHdlr.getLength() ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + + tag = (byte) 0x01 ; + value1 = (byte) 0x44 ; + // Initialise buffers + for (short i=0; i<8; i++) + buffer[i] = (byte) ((i+1)*0x11) ; // 11 22 33 44 55 66 77 88 + + compareBuffer[20] = tag ; + compareBuffer[21] = (byte) 0x05 ; + compareBuffer[22] = value1 ; + compareBuffer[23] = (byte) 0x33 ; + compareBuffer[24] = (byte) 0x44 ; + compareBuffer[25] = (byte) 0x55 ; + compareBuffer[26] = (byte) 0x66 ; + + try { + //erase the copybuffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Append buffer + value2Offset = (short)2 ; + value2Length = (short)4 ; + EnvRespHdlr.appendTLV(tag, value1, buffer, value2Offset, value2Length) ; + + // Copy the handler + offset = (short)0 ; + length = (short)EnvRespHdlr.getLength() ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successfull call + testCaseNb = (byte) 13 ; + bRes = false ; + + tag = (byte)04 ; + value1 = (byte) 0x00 ; + + // Initialise buffers + for (short i=0; i<(short)80; i++) { + buffer256[i] = (byte)(i+1) ; + compareBuffer[(short)(i+4)] = (byte)(i+1) ; + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0x80 ; + compareBuffer[3] = value1 ; + + try { + + //erase the copybuffer + Util.arrayFillNonAtomic(copyBuffer,(short)0,(short)copyBuffer.length,(byte)0x00); + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append buffer + value2Offset = (short)0 ; + value2Length = (short)0x7F ; + EnvRespHdlr.appendTLV(tag, value1, buffer256, value2Offset, value2Length) ; + + // Copy the handler + offset = (short) 0 ; + length = (short)EnvRespHdlr.getLength() ; + EnvRespHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + if(Util.arrayCompare(copyBuffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 14 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append buffer + try { + value2Offset = (short)0 ; + value2Length = (short)0x7F ; + EnvRespHdlr.appendTLV(tag, value1, buffer256, value2Offset, value2Length) ; + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/Test_Api_2_Erh_Aptlbb_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/Test_Api_2_Erh_Aptlbb_Bss.java new file mode 100644 index 0000000..d9a7f10 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/Test_Api_2_Erh_Aptlbb_Bss.java @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Aptlbb_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbb_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbb_bss + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Aptlbb_Bss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_aptlbb_Bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Aptlbb_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 14 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0ECCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/applet.opt new file mode 100644 index 0000000..d2788cc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_aptlbb_bss.Api_2_Erh_Aptlbb_Bss_1 +uicc.test.toolkit.api_2_erh_aptlbb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/javacard/api_2_erh_aptlbb_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbb_bss/javacard/api_2_erh_aptlbb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..e148feaa5a1cc0d2b8b69f3286483b89bf7bd8fa GIT binary patch literal 4841 zcmbVP3vg7`8UD|`=RS7t-QAOA_hu6sUd5U%k4=`)hQyRCfea857fGD*uw?TPLSnKe zYmL;-M|Gd8M{^!5v{(rDcq%KhTwQ|l>7*t$9p?p?lVA7n5QeSzXVovF-1(lP_ORpaV zh~2fgr7OqNar>v!|9$^YvR`jM{Wsf|?@Vl)a^&Ks%IrO9od-^wdwc0eFGcCueXH|| zkDdH{+k4N9pZN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h=8~d<19fKI#5>605lN{&-qTw(c6b**E;!pyK=Yi36LjJLiAC`)-_jL+ zI>0pf)uhIh4Pt6XrhOk1IzJw-&UEf?HwDQJyRw;^;m0X8%INr%uY>MCXuXv~1BS*A zPQ78nKP{K(!}#Mah=d{ywWSU9P4VBLib2{y8H%KDUUKOd*vDl!NO#rWJFle{(OR1M z57&ah;OxVytSV|&Q{L3Psfz;BWZ7zwt@fO$R<|t6;KS9r&_-vB9j&;^6pz*6aNZNYhtm1; z{6v$cdi0E;Mu5yT;Z-yM7alpL8sN;VZ>w!>2xE-QZJ@y(3=T0G!$?Q$6uMLla4;|f z@bfs0fS-qI0{D5fCW4=0MZquO04XX$C%g&yFqw}h7U;zQXe@uW5~4$ev?U%$r$Y|- z2d=yuH*iJ)N+>Np{Ro z=42)bbzm4!$<)S-W6oldIOE0CUn!Z>m~qT`NfPJaFmTLSiW$wEMkLW5LLWr6MgP9I(Gnn}}OoA=KA5y9t WHS}-{mPwe^0cdzN;eIT$bM1c)6lLiE literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/Api_2_Erh_Aptlbbb_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/Api_2_Erh_Aptlbbb_1.java new file mode 100644 index 0000000..2df645d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/Api_2_Erh_Aptlbbb_1.java @@ -0,0 +1,247 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Aptlbbb_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbbb; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbbb + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Aptlbbb_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte compareBuffer[] = new byte[10] ; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Aptlbbb_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Aptlbbb_1 thisApplet = new Api_2_Erh_Aptlbbb_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + byte value1 = 0 ; + byte value2 = 0 ; + short length = 0 ; + short offset = 0 ; + byte[] buffer = new byte[256] ; + + // -------------------------------------------- + // Test Case 1 : handler overflow + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + offset = (short)0 ; + length = (short)(EnvRespHdlr.getCapacity() - 1) ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + + // appendTLV + try { + EnvRespHdlr.appendTLV(tag, value1, value2) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : the current TLV is not modified + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // clear the handler + EnvRespHdlr.clear(); + + //built the first tlv + buffer[0]=(byte)0x11; + buffer[1]=(byte)0x22; + buffer[3]=(byte)0x33; + EnvRespHdlr.appendTLV((byte)0x81,buffer,(short) 0x00, (short) 3); + + //built the second tlv + buffer[0]=(byte)0x99; + buffer[1]=(byte)0x77; + EnvRespHdlr.appendTLV((byte)0x82,buffer,(short) 0x00, (short) 2); + + // Select tag 02h + EnvRespHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Verify current TLV + if(EnvRespHdlr.getValueLength()==3) + bRes =true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + //erase the begin of the array + for(short i=0;i<10;i++) + buffer[i]=(byte)0x00; + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append TLV + tag = (byte)0x84 ; + value1 = (byte)0x00 ; + value2 = (byte)0x01 ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[0] = tag ; + compareBuffer[1] = (byte) 2; + compareBuffer[2] = value1 ; + compareBuffer[3] = value2 ; + + // Copy the handler + offset = (short)0 ; + length = (short)4 ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + //erase the begin of the array + for(short i=0;i<10;i++) + buffer[i]=(byte)0x00; + + // Append TLV + tag = (byte)0x01 ; + value1 = (byte)0xFE ; + value2 = (byte)0xFD ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[4] = tag ; + compareBuffer[5] = (byte) 2; + compareBuffer[6] = value1 ; + compareBuffer[7] = value2 ; + + // Copy the handler + offset = (short)0 ; + length = (short)8 ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append TLV + try { + tag = (byte)0x01 ; + value1 = (byte)0xFE ; + value2 = (byte)0xFD ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/Test_Api_2_Erh_Aptlbbb.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/Test_Api_2_Erh_Aptlbbb.java new file mode 100644 index 0000000..1dd4c93 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/Test_Api_2_Erh_Aptlbbb.java @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Aptlbbb.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbbb; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbbb + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Aptlbbb extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_aptlbbb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Aptlbbb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 5 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/applet.opt new file mode 100644 index 0000000..8420a08 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_aptlbbb.Api_2_Erh_Aptlbbb_1 +uicc.test.toolkit.api_2_erh_aptlbbb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/javacard/api_2_erh_aptlbbb.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbb/javacard/api_2_erh_aptlbbb.cap new file mode 100644 index 0000000000000000000000000000000000000000..0fe428bd00a33f60f3bd792be29afda97213ac1a GIT binary patch literal 3561 zcmb7`du&rx7{I@C@41iOcH7-pyN+cWOh?uUD;rD-+jL_C9o=y9PvNCXEy03|pw5(sgTNE8(WQA7;^QHY}AgZZ6;mR{tKdz$awd+uqz z-}gB8`%Z(Cr|BT$Pi(I(h3iH-P^h0Ut!hN=!tzCrq7IR6p@bKS0lv`e1aV zb?=%Bx$P&C4_NNJ{V{jlpyzk5bv=@AUg4|hpH%weSKH4_tBeMYZQAhdqCemN=-|@L z<@0t&f2#X__G@&maqaTkGN%uZrZgUS=H+F4SPJ~LKp9s4Y~Db>dDeG*&gyfYjjlVr zY@3z%a+YUrYCKmkbanpy*)Lw~OMc-mxn=X}%Zmep?+I6LaC&I(^kL2WN;aKZU1Z&V z_+pN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fT9USe#YwO0B_$TL2B(0BHvl94CSwkk8QAO};}eC! literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/Api_2_Erh_Aptlbbs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/Api_2_Erh_Aptlbbs_1.java new file mode 100644 index 0000000..813e28a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/Api_2_Erh_Aptlbbs_1.java @@ -0,0 +1,243 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Aptlbbs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbbs; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbbs + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Aptlbbs_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte compareBuffer[] = new byte[10] ; + /** + * Constructor of the applet + */ + public Api_2_Erh_Aptlbbs_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Aptlbbs_1 thisApplet = new Api_2_Erh_Aptlbbs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + byte value1 = 0 ; + short value2 = 0 ; + short length = 0 ; + short offset = 0 ; + byte[] buffer = new byte[256] ; + + // -------------------------------------------- + // Test Case 1 : handler overflow + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + offset = (short)0 ; + length = (short)(EnvRespHdlr.getCapacity() - 1) ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + + // appendTLV + try { + EnvRespHdlr.appendTLV(tag, value1, value2) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : the current TLV is not modified + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // clear the handler + EnvRespHdlr.clear(); + + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x81,(byte)0x11,(short)0x2233); + + //built the second tlv + EnvRespHdlr.appendTLV((byte)0x82,(byte)0x99,(byte)0x77); + + // Select tag 02h + EnvRespHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Verify current TLV + if(EnvRespHdlr.getValueLength()==3) + bRes =true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + //erase the begin of the array + for(short i=0;i<10;i++) + buffer[i]=(byte)0x00; + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append TLV + tag = (byte)0x84 ; + value1 = (byte)0x00 ; + value2 = (short)0x0102 ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[0] = tag ; + compareBuffer[1] = (byte) 3; + compareBuffer[2] = value1 ; + compareBuffer[3] = (byte)(value2 >> 8); + compareBuffer[4] = (byte)value2; + + // Copy the handler + offset = (short)0 ; + length = (short)5 ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + //erase the begin of the array + for(short i=0;i<10;i++) + buffer[i]=(byte)0x00; + + // Append TLV + tag = (byte)0x01 ; + value1 = (byte)0xFE ; + value2 = (short)0xFDFC ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[5] = tag ; + compareBuffer[6] = (byte) 3; + compareBuffer[7] = value1 ; + compareBuffer[8] = (byte)(value2 >> 8); + compareBuffer[9] = (byte)value2; + + // Copy the handler + offset = (short)0 ; + length = (short)0x0A ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append TLV + try { + tag = (byte)0x01 ; + value1 = (byte)0xFE ; + value2 = (byte)0xFDFC ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/Test_Api_2_Erh_Aptlbbs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/Test_Api_2_Erh_Aptlbbs.java new file mode 100644 index 0000000..0db5163 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/Test_Api_2_Erh_Aptlbbs.java @@ -0,0 +1,105 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Aptlbbs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbbs; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbbs + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Aptlbbs extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_aptlbbs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Aptlbbs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 5 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/applet.opt new file mode 100644 index 0000000..b265362 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_aptlbbs.Api_2_Erh_Aptlbbs_1 +uicc.test.toolkit.api_2_erh_aptlbbs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/javacard/api_2_erh_aptlbbs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbbs/javacard/api_2_erh_aptlbbs.cap new file mode 100644 index 0000000000000000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+ + // Copy the handler + offset = (short)0 ; + length = (short)4 ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + //erase the begin of the array + for(short i=0;i<10;i++) + buffer[i]=(byte)0x00; + + // Append TLV + tag = (byte)0x01 ; + value = (short)0xFEFF ; + EnvRespHdlr.appendTLV(tag, value) ; + + // Initialise compareBuffer + compareBuffer[4] = tag ; + compareBuffer[5] = (byte) 2; + compareBuffer[6] = (byte)(value >> 8); + compareBuffer[7] = (byte)value; + + // Copy the handler + offset = (short)0 ; + length = (short)8 ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append TLV + try { + tag = (byte)0x01 ; + value = (byte)0xFEFF ; + EnvRespHdlr.appendTLV(tag, value) ; + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/Test_Api_2_Erh_Aptlbs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/Test_Api_2_Erh_Aptlbs.java new file mode 100644 index 0000000..d19baae --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/Test_Api_2_Erh_Aptlbs.java @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Aptlbs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbs; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbs + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Aptlbs extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_aptlbs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Aptlbs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 5 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/applet.opt new file mode 100644 index 0000000..535146f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_aptlbs.Api_2_Erh_Aptlbs_1 +uicc.test.toolkit.api_2_erh_aptlbs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/javacard/api_2_erh_aptlbs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbs/javacard/api_2_erh_aptlbs.cap new file mode 100644 index 0000000000000000000000000000000000000000..0753e3be0c974c5f4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Zfi8bE7{MCDj50zTlPmy_S%ptXY@YC^L;Udj!0m0bW*&P>22x8QADAYWaQ= literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/Api_2_Erh_Aptlbss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/Api_2_Erh_Aptlbss_1.java new file mode 100644 index 0000000..9299f66 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/Api_2_Erh_Aptlbss_1.java @@ -0,0 +1,237 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Aptlbss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbss + * + * @version 0.0.1 - 3 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Aptlbss_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte compareBuffer[] = new byte[12] ; + /** + * Constructor of the applet + */ + public Api_2_Erh_Aptlbss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Aptlbss_1 thisApplet = new Api_2_Erh_Aptlbss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + short value1 = 0 ; + short value2 = 0 ; + short length = 0 ; + short offset = 0 ; + byte[] buffer = new byte[256] ; + + // -------------------------------------------- + // Test Case 1 : handler overflow + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + offset = (short)0 ; + length = (short)(EnvRespHdlr.getCapacity() - 1) ; + EnvRespHdlr.appendArray(buffer, offset, length) ; + + // appendTLV + try { + EnvRespHdlr.appendTLV(tag, value1, value2) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : the current TLV is not modified + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // clear the handler + EnvRespHdlr.clear(); + + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x81,(byte)0x11,(short)0x2233); + + //built the second tlv + EnvRespHdlr.appendTLV((byte)0x82,(byte)0x99,(byte)0x77); + + // Select tag 02h + EnvRespHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Verify current TLV + if(EnvRespHdlr.getValueLength()==3) + bRes =true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + //erase the begin of the array + for(short i=0;i<10;i++) + buffer[i]=(byte)0x00; + + // Clear the handler + EnvRespHdlr.clear() ; + + // Append TLV + tag = (byte)0x84 ; + value1 = (short)0x0001 ; + value2 = (short)0x0203 ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[0] = tag ; + compareBuffer[1] = (byte) 4; + compareBuffer[2] = (byte)(value1 >> 8); + compareBuffer[3] = (byte) value1; + compareBuffer[4] = (byte)(value2 >> 8); + compareBuffer[5] = (byte)value2; + + // Copy the handler + offset = (short)0 ; + length = (short)6 ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + // Append TLV + tag = (byte)0x01 ; + value1 = (short)0xFEFD ; + value2 = (short)0xFCFB ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[6] = tag ; + compareBuffer[7] = (byte) 4; + compareBuffer[8] = (byte)(value1 >> 8); + compareBuffer[9] = (byte) value1 ; + compareBuffer[10] = (byte)(value2 >> 8); + compareBuffer[11] = (byte)value2; + + // Copy the handler + offset = (short)0 ; + length = (short)0x0C ; + EnvRespHdlr.copy(buffer, offset, length) ; + + // Compare the handler + if(Util.arrayCompare(buffer, offset, compareBuffer, offset, length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + // Append TLV + try { + tag = (byte)0x01 ; + value1 = (byte)0xFEFD ; + value2 = (byte)0xFCFB ; + EnvRespHdlr.appendTLV(tag, value1, value2) ; + + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/Test_Api_2_Erh_Aptlbss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/Test_Api_2_Erh_Aptlbss.java new file mode 100644 index 0000000..217d9f6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/Test_Api_2_Erh_Aptlbss.java @@ -0,0 +1,105 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Aptlbss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_aptlbss; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +/** + * Test Area : uicc.test.toolkit.api_2_erh_aptlbss + * + * @version 0.0.1 - 3 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Aptlbss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_aptlbss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Aptlbss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() + { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 5 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/applet.opt new file mode 100644 index 0000000..9d50184 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_aptlbss.Api_2_Erh_Aptlbss_1 +uicc.test.toolkit.api_2_erh_aptlbss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/javacard/api_2_erh_aptlbss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_aptlbss/javacard/api_2_erh_aptlbss.cap new file mode 100644 index 0000000000000000000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0dESnk0wko>6WEjb`lM`g& z1w*1FJR^_AA6b03G?I}iunNf%DZKiBQG_Iw$=~ zov{@iqsl-9KP7nkkRbkKC?<&Wo}VCRLm7rY3yKNiOy(zS z4T&JmYhsQ#8TmQWa2Ex?AchyINemF@AU|M#NC1CE5);G$&`Pw*@0+Bw^%qIqT!jDt literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/Api_2_Pah_Indt_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/Api_2_Pah_Indt_1.java new file mode 100644 index 0000000..ac93fc8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/Api_2_Pah_Indt_1.java @@ -0,0 +1,479 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Indt.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_indt; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_indt + * + * @version 0.0.1 - 13 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Indt_1 extends TestToolkitApplet +{ + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + private byte[] TEXTA = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'A'} ; + private byte[] TEXTB = {(byte)'1',(byte)'2',(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'B'} ; + private byte[] TEXTC = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'C',(byte)'1',(byte)'2'} ; + private byte[] TEXTD = {(byte)'1',(byte)'2',(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'D',(byte)'3',(byte)'4'} ; + private byte[] TEXTE = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'E'} ; + private byte[] TEXTF = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'F'} ; + private byte[] TEXTG = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'G'} ; + private byte[] TEXTH = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'H',(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'H'} ; + private byte[] LONGTEXT = new byte[256] ; + + private static final short MAXIMUM_SIZE = (short) (241) ; + + private byte[] destination = new byte[9] ; + + private byte DCS_8_BIT_DATA = (byte) 0x04; + private byte DCS_DEFAULT_ALPHABET = (byte)0; + private byte DCS_UCS2 = (byte)0x08; + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Indt_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Indt_1 thisApplet = new Api_2_Pah_Indt_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : NULL as parameter to buffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, null, (short)0, (short)1) ; + } + catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 2 : offset > buffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)5, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 3 : offset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)-1, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 4 : length > buffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)5) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : offset + length > buffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)3, (short)2) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 6 : length < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)3, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : Successful call, whole buffer + // Verify the command number + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5) ; + + // Get command number + proHdlr.copy(destination, (short)0, (short)9) ; + short commandNumber = (short) (destination[2] & (short)0xFF) ; + + bRes = ((commandNumber>=(short)0x01) && (commandNumber<=(short)0xFE)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : Send the command + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + proHdlr.send() ; + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 9 : Successful call, part of a buffer + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXTB, (short)2, (short)5) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 10 : Successful call, part of a buffer + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXTC, (short)0, (short)5) ; + proHdlr.send() ; + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 11 : Successful call, part of a buffer + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXTD, (short)2, (short)5) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 12 : Successful call, qualifier = 81 + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x81, DCS_8_BIT_DATA, TEXTE, (short)0, (short)5) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 13 : Successful call, DCS = 0 + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_DEFAULT_ALPHABET , TEXTF, (short)0, (short)5) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 14 : Successful call, DCS = 8 + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_UCS2 , TEXTG, (short)0, (short)5) ; + proHdlr.send() ; + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 15 : Test initialisation of the handler + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5) ; + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXTH, (short)0, (short)10) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 16 : Successful call, text length is zero + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXTH, (short)0, (short)0) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 17 : no TLV is selected after the method invocation + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + + // Select 1st TLV of the handler + proHdlr.findTLV((byte)1, (byte)1) ; + + // Method invocation + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5) ; + + try { + short length = proHdlr.getValueLength() ; + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true ; + } + } + + } + catch (Exception e) { + bRes = false ; + } + + reportTestOutcome(testCaseNb, bRes) ; + + // Prepare buffer + + for (short i=(short)0; i<(short)LONGTEXT.length; i++) { + LONGTEXT[i] = (byte) 0x55 ; + } + + // -------------------------------------------- + // Test Case 18 : initDisplayText with buffer length = 7Eh + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)0x7E) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true); ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false); ; + } + + // -------------------------------------------- + // Test Case 19 : initDisplayText with buffer length = 7Fh + testCaseNb = (byte) 19 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)0x7F) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true); ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false); ; + } + + // -------------------------------------------- + // Test Case 20 : initDisplayText with buffer length = 240 + testCaseNb = (byte) 20 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)240) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true); ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false); ; + } + + // -------------------------------------------- + // Test Case 21 : initDisplayText with a too long buffer + testCaseNb = (byte) 21 ; + bRes = false ; + + try { + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, MAXIMUM_SIZE) ; + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.HANDLER_OVERFLOW) { + bRes = true ; + } + } + } catch (Exception e) { + bRes = false ; + } + + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 22 : initDisplayText without sending the command + testCaseNb = (byte) 22 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)10) ; + + // Command successfull + reportTestOutcome(testCaseNb,true); + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/Test_Api_2_Pah_Indt.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/Test_Api_2_Pah_Indt.java new file mode 100644 index 0000000..4147a7a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/Test_Api_2_Pah_Indt.java @@ -0,0 +1,242 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Indt.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_indt; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_indt + * + * @version 0.0.1 - 13 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Indt extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_indt"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Pah_Indt() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 to 8 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9113"); + + response = test.fetch("13"); + result &= response.checkData("D0118103 01210082 0281028D 06045465" + + "787441"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 9 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01210082 0281028D 06045465" + + "787442"); + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 10 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01210082 0281028D 06045465" + + "787443"); + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 11 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01210082 0281028D 06045465" + + "787444"); + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 12 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01218182 0281028D 06045465" + + "787445"); + response = test.terminalResponse("81030121 81020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 13 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01210082 0281028D 06005465" + + "787446"); + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 14 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01210082 0281028D 06085465" + + "787447"); + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9118"); + + /*********************************************************************/ + /** Testcase 15 */ + /*********************************************************************/ + response = test.fetch("18"); + result &= response.checkData("D0168103 01210082 0281028D 0B045465" + + "78744854 65787448"); + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("910D"); + + /*********************************************************************/ + /** Testcase 16 */ + /*********************************************************************/ + response = test.fetch("0D"); + result &= response.checkData("D00B8103 01210082 0281028D 00"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("918D"); + + /*********************************************************************/ + /** Testcase 17,18 */ + /*********************************************************************/ + response = test.fetch("8D"); + result &= response.checkData("D0818A81 03012100 82028102 8D7F0455" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("918F"); + + /*********************************************************************/ + /** Testcase 19 */ + /*********************************************************************/ + response = test.fetch("8F"); + result &= response.checkData("D0818C81 03012100 82028102 8D818004" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 555555"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9100"); + + /*********************************************************************/ + /** Testcase 20,21,22 */ + /*********************************************************************/ + response = test.fetch("00"); + result &= response.checkData("D081FD81 03012100 82028102 8D81F104" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "16CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/applet.opt new file mode 100644 index 0000000..b478675 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_indt.Api_2_Pah_Indt_1 +uicc.test.toolkit.api_2_pah_indt +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/javacard/api_2_pah_indt.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_indt/javacard/api_2_pah_indt.cap new file mode 100644 index 0000000000000000000000000000000000000000..51dc6ebef20298c2758493708067dc81092846d8 GIT binary patch literal 4817 zcmb7H4{#La6@UBf|Gm51Cgkomgyi@mgb+wbKyn)HOb8rc2!ube{u#t09B`24ZoW)?|Z-Rz1{ovy_zbP%LEC}(x&-$Lcb#uIH;bptYXUih5n-IiiPw2bCxbEtoDC< z3?ROwI@~-}`}M9X?xs)De(zkoCcHiLPDyFW@k0l;em2r^f4;x_M(ZBs{mv5fe|+278;8CLWO>TRMb5kA=elYRTr1pN{{mYo z?|5kWpAN4%vYN}BY5m@kxBk2#mMhcfZP>>3*r>k=OR$vF4T4t}i=h9<42S>V;szgde<7WWV%Q-H#fN z*S7PQI`7FmSoqrE@~@iTX#IM1-bY9N_3mBg0$+WxJ^txO`_eu>yr`y1lp+rvn6i-p z=;Q!u@YX4b8%A&42cLNF&Owc0I$~p}uC6E=+z>5_hQsyiL(!r@B($PrMI^9xMW|s_ zv}j#mQ=l%;xT5uM1ucjK{bG*TwhjT!gfj6cX+A`2PjgDvLX_x z4@M~`3z@e>$B@m*@ii2+|J8>i6sZx-|86AQm>}Yy%$&$8=#DVrizrqyj48_*_$%}d z0+YO+y)#CQ`92O)+>IE1zAM8G8=`@RXbnCFG<+TtolDRKfip*amD4`?H^%{Eg|9s0^gv(OX8 zG(-wP)dx0gpwS56tkgjTi-Jocd$tm2mKdd3G(9(yl>dEk02fS=+U=|kM%RW{Q7Tc` zmrD*}4qgW*IjB3xZ@@)PKpOcJG;%_Bl8dNcg)~+~{i^O{?cieFs2738x=}AheJ<+X zL47XjD^QQ1uA?47y#@6j>ND7rC_mE`_TMPGb&bmc7dHvzY?QSq!zgtpIS2ugSf*SS2K$C7i;uX~jPmIyj zo|(mTW(l2%J_PDRq&_6{;Z+57mM2DTn%+W!rj^tbeV}QHC&p^3oM0Wo>uj7Ls?+dW zQm1=j+#qY6O4I(*x} za}gGEk(3d&XKC#WWNT%Zu;f9xZ{39NiO<0eV5;<)vV990z|_)b$_?e!nlM$j9Ooya@*HpmgybGJU))W8~-oxED>d4Ok}d|d9R?@}}R79q3h<4FtF z+#LQTBG!q5=4R;?QAhN*-ZGSRWEe- zx30P=xoBAb$5XG{@V!cLS4!{KrO`k%ROb%`>l3d&3Cps+Bbj5t;>mX$!ZC`}IF;s?#9~=U^6{LM_|7L*yqZSt zwA#pIJg1Oi0&7HRutVsMaaK-}GhFGtXND`oT42e@5PLr(ZeC>A6IV97Xm#X^lHx!( zDHO*DQAtih*&OfA8<+qJ4`TR*%tUJ$3tY#d5bH6lXxOc!S;9gFOD-%! zX{E-1j}~hLe6(I;!ADCr4t%s~V0jE-JZL7vJtIhn{m* zcQ^QPrXT#Yf9N@&3V&S$OPHTCQ~9-{cQPvX%VNB!VM|n|oK)0QF(eZ^ft$@}|6YeS zqshlWtts`Q^ggb)>x&F8Z(^c{f1`{p$;@DGg$#yCnBd_vBsE565_98YknBr|#At)e z4Cao buffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)5, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 3 : offset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)-1, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 4 : length > buffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)5) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : offset + length > buffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)3, (short)2) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 6 : length < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)3, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : Successful call, whole buffer + // Verify the command number + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5) ; + + // Get command number + proHdlr.copy(destination, (short)0, (short)9) ; + short commandNumber = (short) (destination[2] & (short)0xFF) ; + + bRes = ((commandNumber>=(short)0x01) && (commandNumber<=(short)0xFE)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : Send the command + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + proHdlr.send() ; + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 9 : Successful call, part of a buffer + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXTB, (short)2, (short)5) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 10 : Successful call, part of a buffer + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXTC, (short)0, (short)5) ; + proHdlr.send() ; + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 11 : Successful call, part of a buffer + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXTD, (short)2, (short)5) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 12 : Successful call, qualifier = 81 + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x81, DCS_8_BIT_DATA, TEXTE, (short)0, (short)5) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 13 : Successful call, DCS = 0 + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x00, DCS_DEFAULT_ALPHABET , TEXTF, (short)0, (short)5) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 14 : Successful call, DCS = 8 + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x00, DCS_UCS2 , TEXTG, (short)0, (short)5) ; + proHdlr.send() ; + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 15 : Test initialisation of the handler + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5) ; + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXTH, (short)0, (short)10) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 16 : Successful call, text length is zero + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXTH, (short)0, (short)0) ; + proHdlr.send() ; + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb,bRes); + + // -------------------------------------------- + // Test Case 17 : no TLV is selected after the method invocation + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + + // Select 1st TLV of the handler + proHdlr.findTLV((byte)1, (byte)1) ; + + // Method invocation + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5) ; + + try { + short length = proHdlr.getValueLength() ; + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true ; + } + } + + } + catch (Exception e) { + bRes = false ; + } + + reportTestOutcome(testCaseNb, bRes) ; + + // Prepare buffer + + for (short i=(short)0; i<(short)LONGTEXT.length; i++) { + LONGTEXT[i] = (byte) 0x55 ; + } + + // -------------------------------------------- + // Test Case 18 : initGetInkey with buffer length = 7Eh + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)0x7E) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true); ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false); ; + } + + // -------------------------------------------- + // Test Case 19 : initGetInkey with buffer length = 7Fh + testCaseNb = (byte) 19 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)0x7F) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true); ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false); ; + } + + // -------------------------------------------- + // Test Case 20 : initGetInkey with buffer length = 240 + testCaseNb = (byte) 20 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)240) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true); ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false); ; + } + + // -------------------------------------------- + // Test Case 21 : initGetInkey with a too long buffer + testCaseNb = (byte) 21 ; + bRes = false ; + + try { + try { + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, MAXIMUM_SIZE) ; + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.HANDLER_OVERFLOW) { + bRes = true ; + } + } + } catch (Exception e) { + bRes = false ; + } + + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 22 : initGetInkey without sending the command + testCaseNb = (byte) 22 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initGetInkey((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)10) ; + + // Command successfull + reportTestOutcome(testCaseNb,true); + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/Test_Api_2_Pah_Ingk.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/Test_Api_2_Pah_Ingk.java new file mode 100644 index 0000000..64d9aaf --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/Test_Api_2_Pah_Ingk.java @@ -0,0 +1,242 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Ingk.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_ingk; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_ingk + * + * @version 0.0.1 - 13 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Ingk extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_ingk"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Pah_Ingk() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 to 8 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9113"); + + response = test.fetch("13"); + result &= response.checkData("D0118103 01220082 0281828D 06045465" + + "787441"); + + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 9 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01220082 0281828D 06045465" + + "787442"); + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 10 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01220082 0281828D 06045465" + + "787443"); + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 11 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01220082 0281828D 06045465" + + "787444"); + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 12 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01228182 0281828D 06045465" + + "787445"); + response = test.terminalResponse("81030122 81020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 13 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01220082 0281828D 06005465" + + "787446"); + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("9113"); + + /*********************************************************************/ + /** Testcase 14 */ + /*********************************************************************/ + response = test.fetch("13"); + result &= response.checkData("D0118103 01220082 0281828D 06085465" + + "787447"); + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("9118"); + + /*********************************************************************/ + /** Testcase 15 */ + /*********************************************************************/ + response = test.fetch("18"); + result &= response.checkData("D0168103 01220082 0281828D 0B045465" + + "78744854 65787448"); + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("910D"); + + /*********************************************************************/ + /** Testcase 16 */ + /*********************************************************************/ + response = test.fetch("0D"); + result &= response.checkData("D00B8103 01220082 0281828D 00"); + + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("918D"); + + /*********************************************************************/ + /** Testcase 17,18 */ + /*********************************************************************/ + response = test.fetch("8D"); + result &= response.checkData("D0818A81 03012200 82028182 8D7F0455" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55"); + + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("918F"); + + /*********************************************************************/ + /** Testcase 19 */ + /*********************************************************************/ + response = test.fetch("8F"); + result &= response.checkData("D0818C81 03012200 82028182 8D818004" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 555555"); + + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("9100"); + + /*********************************************************************/ + /** Testcase 20,21,22 */ + /*********************************************************************/ + response = test.fetch("00"); + result &= response.checkData("D081FD81 03012200 82028182 8D81F104" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555"); + + response = test.terminalResponse("81030122 00020282 81030100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "16CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/applet.opt new file mode 100644 index 0000000..235310e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_ingk.Api_2_Pah_Ingk_1 +uicc.test.toolkit.api_2_pah_ingk +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/javacard/api_2_pah_ingk.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingk/javacard/api_2_pah_ingk.cap new file mode 100644 index 0000000000000000000000000000000000000000..7b62faef1c078164a73acc5568c8db12914d2604 GIT binary patch literal 4818 zcmb7H3vd(X5#IansnhE$Tk_dP79=5H3>X`O1xAVuws@F_0|uw$0g6$KV%O5xf&nLl zvq=$8*8{X9F`a~lNoc9uHf>6WG-XKABxGnq`bbjBq%_QgPNxZY+8HLHpzbdl%R2Bw zclxxq`uE@O-@Vg+yR|hemjx1@?)JsAV91dL94xD@tDLrYxvywhQ!~qm-%je z01#WbEYvwe{q4bPuJ((T-#H#^4DAcPRZ>=Ru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U ziLhz1pt@LkMU>2;*4sz3&KhE!0oO(|x2Kr*CCo7k>hyInKOyppExIxNyKPeP73gxlK3tlCcK(SW|_=n zDxT9wF@Z)=8tD+?QO?9k23vNg^vynSJ_Ca%m@(PS?WCE1Q}P{{U7 zQBF-ld9|neCMJNwjTn0&Qx#}yXbpz39;P`k!Z%nHVm*cx4ckFFB`jpHwsqX%Q!bm)3DcjisfWNn>d> zXVzE?`nPDrio&X~&;fnmW4=RK83Wk@i(mr1mKo9mbsPuzsN`c^e7Ca#`p^0CIQVd; z4}7$L=s%zae_a79nV&H;_>JSc8HM|0F<#WNB??nPDr;*Pl7*eX?QV2vuS2`h)ML2b zlzNc|9@o3|MM*Ee!9J%hd#N-`8;g2&E~(irJU^o>uFgi$UMf=y~*QMUp3sPtn+K$b#EVhMqv*O(Y2}q(zYIE%Xff zojb{J-k44Zx_w+vqu;!fG^M6=Xmne-o<_etCTZs2t7+^vBz3c_t>Lko!wn738JPEd IbR&cR18F8gng9R* literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/Api_2_Pah_Ingp_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/Api_2_Pah_Ingp_1.java new file mode 100644 index 0000000..5c24d91 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/Api_2_Pah_Ingp_1.java @@ -0,0 +1,472 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Ingp_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_ingp; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_ingp + * + * @version 0.0.1 - 13 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Ingp_1 extends TestToolkitApplet +{ + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + private byte[] TEXTA = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'A'} ; + private byte[] TEXTB = {(byte)'1',(byte)'2',(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'B'} ; + private byte[] TEXTC = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'C',(byte)'1',(byte)'2'} ; + private byte[] TEXTD = {(byte)'1',(byte)'2',(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'D',(byte)'3',(byte)'4'} ; + private byte[] TEXTE = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'E'} ; + private byte[] TEXTF = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'F'} ; + private byte[] TEXTG = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'G'} ; + private byte[] TEXTH = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'H',(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'H'} ; + private byte[] LONGTEXT = new byte[256] ; + + private static final short MAXIMUM_SIZE = (short) (241) ; + + private byte[] destination = new byte[9] ; + + private byte DCS_8_BIT_DATA = (byte) 0x04; + private byte DCS_DEFAULT_ALPHABET = (byte)0; + private byte DCS_UCS2 = (byte)0x08; + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Ingp_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Ingp_1 thisApplet = new Api_2_Pah_Ingp_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : NULL as parameter to buffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, null, (short)0, (short)1, (short)0, (short)0) ; + } + catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 2 : offset > buffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)5, (short)1, (short)0, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 3 : offset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)-1, (short)1, (short)0, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 4 : length > buffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)5, (short)0, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : offset + length > buffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)3, (short)2, (short)0, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 6 : length < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)3, (short)-1, (short)0, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : Successful call, whole buffer + // Verify the command number + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5, (short)0, (short)0xFF) ; + + // Get command number + proHdlr.copy(destination, (short)0, (short)9) ; + short commandNumber = (short) (destination[2] & (short)0xFF) ; + + bRes = ((commandNumber>=(short)0x01) && (commandNumber<=(short)0xFE)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : Send the command + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 9 : Successful call, part of a buffer + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXTB, (short)2, (short)5, (short)0x10, (short)0xff) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 10 : Successful call, part of a buffer + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXTC, (short)0, (short)5, (short)0xff, (short)0xff) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 11 : Successful call, part of a buffer + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXTD, (short)2, (short)5, (short)0, (short)0) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 12 : Successful call, qualifier = 81 + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + proHdlr.initGetInput((byte)0x81, DCS_8_BIT_DATA, TEXTE, (short)0, (short)5, (short)0, (short)0x10) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 13 : Successful call, DCS = 0 + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + proHdlr.initGetInput((byte)0x00, DCS_DEFAULT_ALPHABET , TEXTF, (short)0, (short)5, (short)0x10, (short)0x10) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 14 : Successful call, DCS = 8 + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + proHdlr.initGetInput((byte)0x00, DCS_UCS2 , TEXTG, (short)0, (short)5, (short)0x00, (short)0xff) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 15 : Test initialisation of the handler + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + //proHdlr.init((byte)0xFF, (byte)0xFF, (byte)0xFF) ; + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5, (short)0, (short)0x10) ; + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXTH, (short)0, (short)10, (short)0, (short)0x10) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 16 : Successful call, null text string + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXTH, (short)0, (short)0, (short)0, (short)0x10) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 17 : no TLV is selected after the method invocation + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + + // Select 1st TLV of the handler + proHdlr.findTLV((byte)1, (byte)1) ; + + // Method invocation + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXTA, (short)0, (short)5, (short)0, (short)0x10) ; + + try { + short length = proHdlr.getValueLength() ; + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true ; + } + } + + } + catch (Exception e) { + bRes = false ; + } + + reportTestOutcome(testCaseNb, bRes) ; + + // Prepare buffer + + for (short i=(short)0; i<(short)LONGTEXT.length; i++) { + LONGTEXT[i] = (byte) 0x55 ; + } + + // -------------------------------------------- + // Test Case 18 : initGetInput with buffer length = 7Eh + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)0x7E, (short)0, (short)0x10) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true) ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 19 : initGetInput with buffer length = 7Fh + testCaseNb = (byte) 19 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)0x7F, (short)0, (short)0x10) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true) ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 20 : initGetInput with buffer length = 237 + testCaseNb = (byte) 20 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)236, (short)0, (short)0x10) ; + + // Send the command + proHdlr.send() ; + + // Command successfull + reportTestOutcome(testCaseNb,true) ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 21 : initGetInput with a too long buffer + testCaseNb = (byte) 21 ; + bRes = false ; + + try { + try { + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, MAXIMUM_SIZE, (short)0, (short)0x10) ; + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.HANDLER_OVERFLOW) { + bRes = true ; + } + } + } catch (Exception e) { + bRes = false ; + } + + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 22 : initGetInput without sending the command + testCaseNb = (byte) 22 ; + bRes = false ; + + try { + // Initialize the command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)10, (short)0, (short)0x10) ; + + // Command successfull + reportTestOutcome(testCaseNb,true) ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/Test_Api_2_Pah_Ingp.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/Test_Api_2_Pah_Ingp.java new file mode 100644 index 0000000..9941c6f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/Test_Api_2_Pah_Ingp.java @@ -0,0 +1,245 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Ingp.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_ingp; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_ingp + * + * @version 0.0.1 - 13 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Ingp extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_ingp"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Pah_Ingp() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 to 8 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9117"); + + response = test.fetch("17"); + result &= response.checkData("D0158103 01230082 0281828D 06045465" + + "78744191 0200FF"); + + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9117"); + + /*********************************************************************/ + /** Testcase 9 */ + /*********************************************************************/ + response = test.fetch("17"); + result &= response.checkData("D0158103 01230082 0281828D 06045465" + + "78744291 0210FF"); + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9117"); + + /*********************************************************************/ + /** Testcase 10 */ + /*********************************************************************/ + response = test.fetch("17"); + result &= response.checkData("D0158103 01230082 0281828D 06045465" + + "78744391 02FFFF"); + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9117"); + + /*********************************************************************/ + /** Testcase 11 */ + /*********************************************************************/ + response = test.fetch("17"); + result &= response.checkData("D0158103 01230082 0281828D 06045465" + + "78744491 020000"); + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9117"); + + /*********************************************************************/ + /** Testcase 12 */ + /*********************************************************************/ + response = test.fetch("17"); + result &= response.checkData("D0158103 01238182 0281828D 06045465" + + "78744591 020010"); + response = test.terminalResponse("81030123 81020282 81030100 0D020441"); + result &= response.checkSw("9117"); + + /*********************************************************************/ + /** Testcase 13 */ + /*********************************************************************/ + response = test.fetch("17"); + result &= response.checkData("D0158103 01230082 0281828D 06005465" + + "78744691 021010"); + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9117"); + + /*********************************************************************/ + /** Testcase 14 */ + /*********************************************************************/ + response = test.fetch("17"); + result &= response.checkData("D0158103 01230082 0281828D 06085465" + + "78744791 0200FF"); + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 15 */ + /*********************************************************************/ + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01230082 0281828D 0B045465" + + "78744854 65787448 91020010"); + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9111"); + + /*********************************************************************/ + /** Testcase 16 */ + /*********************************************************************/ + response = test.fetch("11"); + result &= response.checkData("D00F8103 01230082 0281828D 00910200" + + "10"); + + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9191"); + + /*********************************************************************/ + /** Testcase 17,18 */ + /*********************************************************************/ + response = test.fetch("91"); + result &= response.checkData("D0818E81 03012300 82028182 8D7F0455" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55910200" + + "10"); + + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9193"); + + /*********************************************************************/ + /** Testcase 19 */ + /*********************************************************************/ + response = test.fetch("93"); + result &= response.checkData("D0819081 03012300 82028182 8D818004" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555591" + + "020010"); + + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9100"); + + /*********************************************************************/ + /** Testcase 20,21,22 */ + /*********************************************************************/ + response = test.fetch("00"); + result &= response.checkData("D081FD81 03012300 82028182 8D81ED04" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 91020010"); + + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "16CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/applet.opt new file mode 100644 index 0000000..8da6f55 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_ingp.Api_2_Pah_Ingp_1 +uicc.test.toolkit.api_2_pah_ingp +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/javacard/api_2_pah_ingp.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_ingp/javacard/api_2_pah_ingp.cap new file mode 100644 index 0000000000000000000000000000000000000000..ee7c83c859636b9a29588c3a5ec70ba91986c218 GIT binary patch literal 4911 zcmb7H4^R~66@UBf-`l%`MY+2L0w-D=&=xqP<&bg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UmV0aisU$&d@JV%nvo~aO5fQgtR`m-r8%chFLOGbm6FJDJeQqOK=Pxb zfE18ab0aAxE>ei22uCWyP23i1R4XQ>1cIV8-X#o$ISVJ5(j60rN4mpqnQoTk3{jFZ z5q5++3XTb=I1s55M2qdK!!y)6L$=vPIX)X7Rt;3&!c0)O5s8;cbA0X1ZT=uu+cX(w z_!3J_toE>8VmFgc3Ckob=&;D8bsz&CS_%^I&}xtc4=o5e@X(r&2M;X^1@O?yPy`Px z4khr=`p^U(S|ZBep;e+;V`-si(O6n5S~WHW*H6(%DvDH%h0SmcYM3pQl`)a^Pz$;A zyUdWCu#j5}IjH1d)qSrq3+{~BLqkx5o;6TIyOTQ?)ZwoU(8TO#iuu)(`WS^f;KDDB zY>C3mB2|rb3`xg6W2Ds`-AU0_H~t!{@ujQC!}smIx-NZ{Lzw8q4@&RBj10y`OJ|sd z2~M0LuI)0C7~3kHWLHuodXr^jF!obAgUluqhTdHn8H^p0&hV3@7>xark;mAy=sW?u zixNMO>X8=4NMP($bb=3(BG5Y*BZKh~t}}eal1vDO2fC5Q_!QS^x{{(XJkyOd#>b;h e^BlgT5=(short)0x01) && (commandNumber<=(short)0xFE)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : + // Call the init() method + // Verify each simple TLV + + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + // Call to init method + // type = FFh + // qualifier = FEh + // dstDevice = FDh + + proHdlr.init((byte)0xFF, (byte)0xFE, (byte) 0xFD) ; + + // Verify length of the handler (=9) + bRes = (proHdlr.getLength() == (short)9) ; + + // Copy the handler in a buffer + proHdlr.copy(destination, (short)0, (short)9) ; + + // Delete Command Number (tested in test #2) + destination[2] = 0 ; + + // Prepare source buffer + source[3] = (byte) 0xFF ; // Type of command + source[4] = (byte) 0xFE ; // Command qualifier + source[8] = (byte) 0xFD ; // Destination device identities + + // Compare buffers + bRes = bRes & (javacard.framework.Util.arrayCompare(source, + (short)0, + destination, + (short)0, + (short)9) == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : + // Verify there is no selected TLV + + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + // Select 1st TLV + proHdlr.findTLV((byte)0x01, (byte)0x01) ; + + proHdlr.init((byte)0, (byte)0, (byte)0) ; + + // Verify there is no selected TLV + try { + proHdlr.getValueLength() ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } catch (Exception e) { + bRes = false ; + } + + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/Test_Api_2_Pah_Init.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/Test_Api_2_Pah_Init.java new file mode 100644 index 0000000..e71816f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/Test_Api_2_Pah_Init.java @@ -0,0 +1,112 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Init.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_init; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_init + * + * @version 0.0.1 - 13 juin 2005 + * @author 3GPP T3 SWG API + */ +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.Api_2_Enh_Gvsh + * + * @version 0.0.1 - 3 nov. 2004 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Init extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_init"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Pah_Init() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "04CCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/applet.opt new file mode 100644 index 0000000..54641a6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_init.Api_2_Pah_Init_1 +uicc.test.toolkit.api_2_pah_init +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/javacard/api_2_pah_init.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_init/javacard/api_2_pah_init.cap new file mode 100644 index 0000000000000000000000000000000000000000..67926de83095157a8cca0296ebe79669288961d8 GIT binary patch literal 3258 zcmb7`3s6*L6vxkf?}NuRSsreyh@Lnijfg~);I|%mfC1O#thSRw3H&$D~S#va>v zZ%E~}h|}-Aa{hYk<<%Bj$s6-?nA77E+w<#t9;qg(*0;W})T&*6eahWmlP$G1%lF+- zHy)ljP|?0-)~VOG>IR>9H2?mNMO_enqW;6#$LFk0Ilt`iH+!ExlvDb3(^~7K1FAg> z#++>5@mslO^X^a97&TjJJ#5^H$gG4-)=B%rS4C_b;4Yk(s8lqpQBJreW?rpofyHs# zOY6$c+eQQB zx@oukWw~nFFwdi?Nb5FO^y3A{D80Dz_NKjaZxy!!8SKe)jd-xhX*D@hmRwNcWw{=Wk z(O6{|IVr5D`K7xPm%KGS@7saKTtPOu*mraZ1#poCFyhiF`WB2VUFWsQX&S5%rJ|Nt z&1SvZ;&SWVc6&v+)vY%%~$VkH|pW>P9z}fKL!jLR1h%5vv(q z2dugdIQ1%u_R%0fB|m~m7Uk=eN#vqs86Br)#A<_@*MmaK zvpP=2vmEbZK^ddseH17`l$Ud?gJF_YyozN+Iq9R)RV=Z=vj(+5EXa7nU^Ua%Uk_oX zz84CT9Wt%JBs=KXXl`&FgmXHs-%1~#&&cor&|9Drq6M}hELs=<-#F8l4k+h<9Rl5bg<&87%8#KuM>oc!pt~U@_^Afm%T&)IkK_KO+uW;$~&w87V*i z<@@2dgNU99X)6}EO>V0>+iI!k+a)rLLjRON#*yQnHjltQqR<%mmW8wIX5`pyWGBio z&e16v&a7r0i-+(RD%wOC?}1S98a4ThLZnyKnuY@xq!n;B*a5P zZ!bQlMU5bd0&AmCdW-}UsIgpW{CY}cJCgB_k?-ipWKu+G8l7RxrRXRO`G0?PJekzU zS4Uv^zi$v?MbW=d|CIp!RzAQ{1wU2(bSNcAbDp1&i19RdLO=$TLZlha4`~ev;?H+d zf;6@H2?{2ZVfYiBlpsx3enL}71ZnD$a-_M(&l!iiDEI}*{5um#0n(J?2Q-HS@FyTC zK^n9CgkzYOgCBwiWb7U$h9 HBelN(0sdPT literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/Api_2_Pah_Inmt_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/Api_2_Pah_Inmt_1.java new file mode 100644 index 0000000..fdc51d9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/Api_2_Pah_Inmt_1.java @@ -0,0 +1,116 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Inmt_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_inmt; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_inmt + * + * @version 0.0.1 - 22 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Inmt_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Inmt_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Inmt_1 thisApplet = new Api_2_Pah_Inmt_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Result of each test + boolean bRes = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : + // Call the init() method + // Verify each simple TLV + + testCaseNb = (byte) 1 ; + + try { + // Call to initMoreTime() method + + proHdlr.initMoreTime(); + proHdlr.send(); + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 2 : + // Verify there is no selected TLV + + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Select 1st TLV + proHdlr.findTLV((byte)0x01, (byte)0x01) ; + + proHdlr.initMoreTime() ; + + // Verify there is no selected TLV + try { + proHdlr.getValueLength() ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } catch (Exception e) { + bRes = false ; + } + + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/Test_Api_2_Pah_Inmt.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/Test_Api_2_Pah_Inmt.java new file mode 100644 index 0000000..35fc93d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/Test_Api_2_Pah_Inmt.java @@ -0,0 +1,109 @@ +//----------------------------------------------------------------------------- +//Test_APi_2_Pah_Inmt.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_inmt; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_inmt + * + * @version 0.0.1 - 22 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Inmt extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_inmt"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Pah_Inmt() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 & 2 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + test.unrecognizedEnvelope(); + // Fetch the initMoreTime proactive command + response = test.fetch("0B"); + result = response.checkData("D0098103 01020082 028182"); + + response = test.terminalResponse("81030102 00020282 81030100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "02CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/applet.opt new file mode 100644 index 0000000..3f3a73e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_inmt.Api_2_Pah_Inmt_1 +uicc.test.toolkit.api_2_pah_inmt +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/javacard/api_2_pah_inmt.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_inmt/javacard/api_2_pah_inmt.cap new file mode 100644 index 0000000000000000000000000000000000000000..6473b82f7b293a86d9add11863243a3f18a357c1 GIT binary patch literal 2956 zcmb7_3rtg27{|Z+YA>zSf}j;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G2~TXCS<5V7vu%Y88;2hD=so(lOOy9# z==i_4Dp^JKurB}Q=<+IOFrM&}B>Ou}piNvROhtnTpAcf{G=#Qn8FC;Zh-~0Af%a;d zpvHoRABODQG=X+sna~yyf%amWLmR5hF=7{mA4$$5d!+%ikII035dmaZr3th}$%IZJ uk`O4vqA|2f$ru6OXW?gx@+=xdTa%305D_NSsBDE~lK^V`kizDT_|#vTiz0&n literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/Api_2_Pah_Send_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/Api_2_Pah_Send_1.java new file mode 100644 index 0000000..5011eaa --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/Api_2_Pah_Send_1.java @@ -0,0 +1,418 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Send_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_send; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_send + * + * @version 0.0.1 - 14 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Send_1 extends TestToolkitApplet +{ + private byte[] text = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + + private byte[] LONGTEXT = new byte[256] ; + + private byte[] source = {(byte)0x81, (byte)0x03, (byte)0x01, (byte)0x21, (byte)0x00, + (byte)0x82, (byte)0x02, (byte)0x81, (byte)0x02, + (byte)0x8D, (byte)0x05, (byte)0x04, (byte)'T', (byte)'e', (byte)'x', (byte)'t'} ; + + private byte[] destination = new byte[16] ; + private byte DCS_8_BIT_DATA = (byte) 0x04; + /** + * This boolean is used to know there is no invocation of select() or deselect() method by the + * send() method. + */ + + private boolean testingSelectDeselect = false ; + + /** + * Used to know there has been an invocation of select() or deselect() method. + */ + + private boolean selectDeselectCalled = false ; + + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Send_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Send_1 thisApplet = new Api_2_Pah_Send_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of send() + byte result ; + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Build a DISPLAY TEXT command + testCaseNb = (byte) 1 ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 2 : send the command and verify the result + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + result = proHdlr.send() ; + + // RES_CMD_PERF = 00 (Command performed successfully) + bRes = (result == RES_CMD_PERF) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 3 : Build a DISPLAY TEXT command + testCaseNb = (byte) 3 ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 4 : send the command and verify the result + testCaseNb = (byte) 4 ; + + bRes = false ; + try { + result = proHdlr.send() ; + + // RES_CMD_PERF_PARTIAL_COMPR = 01 (Partial comprehension) + bRes = (result == RES_CMD_PERF_PARTIAL_COMPR) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : Build a DISPLAY TEXT command + testCaseNb = (byte) 5 ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 6 : send the command and verify the result + testCaseNb = (byte) 6 ; + + bRes = false ; + try { + result = proHdlr.send() ; + + // RES_CMD_PERF_PARTIAL_COMPR = 01 (Partial comprehension) + bRes = (result == RES_CMD_PERF_PARTIAL_COMPR) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : Build a DISPLAY TEXT command + testCaseNb = (byte) 7 ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + + reportTestOutcome(testCaseNb,true) ; + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + // -------------------------------------------- + // Test Case 8 : send the command and verify the result + testCaseNb = (byte) 8 ; + + bRes = false ; + try { + result = proHdlr.send() ; + + // RES_CMD_PERF_MISSING_INFO = 02 + bRes = (result == RES_CMD_PERF_MISSING_INFO) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // Initialize the long text array + for (short i=0; i<(short)LONGTEXT.length; i++) { + LONGTEXT[i] = (byte)'U' ; + } + + + // -------------------------------------------- + // Test Case 9 : send a 7Fh byte command + testCaseNb = (byte) 9 ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)0x0073) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + + // -------------------------------------------- + // Test Case 10 : send a 80h byte command + testCaseNb = (byte) 10 ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)0x0074) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + + // -------------------------------------------- + // Test Case 11 : send a FDh byte command (Status 9100h) + testCaseNb = (byte) 11 ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, LONGTEXT, (short)0, (short)240) ; + proHdlr.send() ; + reportTestOutcome(testCaseNb,true) ; + + } catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + + // -------------------------------------------- + // Test Case 12 : Verify ProactiveHandler was not modified + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + + // Copy the content of the handler + proHdlr.copy(source, (short)0, (short)16) ; + + // Build and send a DISPLAY TEXT command + proHdlr.send() ; + + // Copy the content of the handler + proHdlr.copy(destination, (short)0, (short)16) ; + + // Compare the content of handler + result = javacard.framework.Util.arrayCompare(source, (short)0, destination, (short)0, (short)16) ; + + bRes = (result == (byte)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Verify there is no invocation of select() or deselect() method. + + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + // Build a DISPLAY TEXT command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + + selectDeselectCalled = false ; + + // Initialize a boolean + testingSelectDeselect = true ; + + // Send the command + proHdlr.send() ; + + testingSelectDeselect = false ; + + if (selectDeselectCalled) { + + reportTestOutcome(testCaseNb,false) ; + } else { + + reportTestOutcome(testCaseNb,true) ; + } + } + catch (Exception e) { + reportTestOutcome(testCaseNb,false) ; + } + + + // -------------------------------------------- + // Test Case 14 : Send a command. Terminal Response with 2 Result TLV + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + result = proHdlr.send() ; + + bRes = (result == (short) 0x02) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Terminal Response without Result Simple TLV + // testCaseNb = (byte) 16 ; + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + + // Build and send a command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + + try { + proHdlr.send() ; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true ; + } + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Terminal Response without general result byte in Result Simple TLV + // testCaseNb = (byte) 17 ; + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + + // Build and send a command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, text, (short)0, (short)text.length) ; + + try { + proHdlr.send() ; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) { + bRes = true ; + } + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + } + + /** + * This implementation of deselect() method is used to test there is no invocation + * by the send() method. + */ + public void deselect() { + + if (testingSelectDeselect) { + selectDeselectCalled = true ; + } + } + + /** + * This implementation of select() method is used to test there is no invocation + * by the send() method. + * If we are not testing this specific point, we call the super method. + */ + public boolean select() { + + if (testingSelectDeselect) { + selectDeselectCalled = true ; + return true ; + } + return super.select() ; + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/Test_Api_2_Pah_Send.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/Test_Api_2_Pah_Send.java new file mode 100644 index 0000000..602d072 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/Test_Api_2_Pah_Send.java @@ -0,0 +1,249 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Send.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_send; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_send + * + * @version 0.0.1 - 14 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Send extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_send"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Send() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1,2 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 3,4 */ + /*********************************************************************/ + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030101"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 5,6 */ + /*********************************************************************/ + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030201 55"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 7,8 */ + /*********************************************************************/ + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030402 654321"); + result &= response.checkSw("9181"); + + /*********************************************************************/ + /** Testcase 9 */ + /*********************************************************************/ + response = test.fetch("81"); + result &= response.checkData("D07F8103 01210082 0281028D 74045555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9183"); + + /*********************************************************************/ + /** Testcase 10 */ + /*********************************************************************/ + response = test.fetch("83"); + result &= response.checkData("D0818081 03012100 82028102 8D750455" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "555555"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9100"); + + /*********************************************************************/ + /** Testcase 11 */ + /*********************************************************************/ + response = test.fetch("00"); + result &= response.checkData("D081FD81 03012100 82028102 8D81F104" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 12 */ + /*********************************************************************/ + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 13 */ + /*********************************************************************/ + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 14 */ + /*********************************************************************/ + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030202 12030303" + + "3456"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 15 */ + /*********************************************************************/ + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 16 */ + /*********************************************************************/ + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 810300"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "10CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/applet.opt new file mode 100644 index 0000000..5a72d85 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_send.Api_2_Pah_Send_1 +uicc.test.toolkit.api_2_pah_send +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/javacard/api_2_pah_send.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_send/javacard/api_2_pah_send.cap new file mode 100644 index 0000000000000000000000000000000000000000..e057e801925189e206b75c0b5d1fd1c88bd66700 GIT binary patch literal 4227 zcmb7H4Nz3q6+ZX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nlKB*$Zwf>mtF zEM8^G22%pUibygmF)=o)B@UZ%id8lxB9dl@uk!i6jINfR*YfvgD% z3Pq#P0ezSP9K;?F1IdOWNat-MA**2(T?Uv&Fv6Zf9RnYi2N@PP;eueuO`8kBrT0Mh4cMUOQtDZrhbcPsy92J8;1=aKDbHotOI=n@ZA4us`#;7OI zr-LDa;iw2g$)TP>?|DNEzs6r-Pqz6SWNghaNk{K-uoXtd-odv literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/Api_2_Phs_Gthd_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/Api_2_Phs_Gthd_1.java new file mode 100644 index 0000000..7692432 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/Api_2_Phs_Gthd_1.java @@ -0,0 +1,125 @@ +//----------------------------------------------------------------------------- +//Api_2_Phs_Gthd_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_phs_gthd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.ProactiveHandler; +import uicc.toolkit.ProactiveHandlerSystem; + +/** + * Test Area : uicc.test.toolkit.api_2_phs_gthd + * + * @version 0.0.1 - 3 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Api_2_Phs_Gthd_1 extends TestToolkitApplet +{ + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + + /** + * Constructor of the applet + */ + public Api_2_Phs_Gthd_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Phs_Gthd_1 thisApplet = new Api_2_Phs_Gthd_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : use th methode getTheHandler() Twice + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + ProactiveHandler ProHdlr1 = ProactiveHandlerSystem.getTheHandler(); + ProactiveHandler ProHdlr2 = ProactiveHandlerSystem.getTheHandler(); + + if (ProHdlr1==ProHdlr2 ) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : verify that the methode getTheHandler return ProactiveHandler reference + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + ProactiveHandler ProHdlr1 = ProactiveHandlerSystem.getTheHandler(); + + if (ProHdlr1 instanceof ProactiveHandler) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : verify that the methode getTheHandler does not return NULL + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + ProactiveHandler ProHdlr1 = ProactiveHandlerSystem.getTheHandler(); + + if (ProHdlr1!=null) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + } + } +} + + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/Test_Api_2_Phs_Gthd.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/Test_Api_2_Phs_Gthd.java new file mode 100644 index 0000000..475c4c9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/Test_Api_2_Phs_Gthd.java @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Phs_Gthd.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_phs_gthd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +/** + * Test Area : uicc.test.toolkit.api_2_phs_gthd + * + * @version 0.0.1 - 3 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Phs_Gthd extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_phs_gthd"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Phs_Gthd() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Applet installation */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 to 3 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test cases 1,2,3 + for (byte i = 0; i < 3; i++) + { + response = test.unrecognizedEnvelope(); + } + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "03CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/applet.opt new file mode 100644 index 0000000..ee963d1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_phs_gthd.Api_2_Phs_Gthd_1 +uicc.test.toolkit.api_2_phs_gthd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/javacard/api_2_phs_gthd.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_phs_gthd/javacard/api_2_phs_gthd.cap new file mode 100644 index 0000000000000000000000000000000000000000..fc48192c41b4c9c613ad4f24b5808d7b36022cb4 GIT binary patch literal 2954 zcmb7_2~bl<7{|YN<#>pq6EF~vC}&1R}{KPi^rE@ffLq zRz}1+wRp5nt)(8N)*kBUh=uX2)$yt`PPId=PO-M5j*jWKjQY&8ok{l1|GnhxzWwd@ z?e2fgMGUI~1zwre1tZ|8q5>97c_qf-1rzi2C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rj8F(URAbA~oJmAGoigxzt8y1gFeHxj>EuSJ9jZ zI%ViIicUF=>e0~>d|R-oh8Y-U708+L0A#3iqc};W=&0n#>o~D7^P>wVqDwQNr`|`G zCc)WE={-@tajG&Uk+8YrE2gvH?Aa09FEFF0gBv4ZvIyHCQ_ye$Y3(>8Vl?nck$zlQ z0xtM;qSkMS?KegGMVrny#;O~cJjs;zbxbKNin2e+qRE=vR=Qf|G}*Gt`#Huu9(Z*c zyk-&d+fywhpKLH%Xg<~1lR86KlVZMrZw#h>A*4O9A!~+UZjIfN`~TGl#ki9)DNATe zZV5O89#@^m?Tze~6i;k+R*M3Ny{%7g=@;-M0la}CfK>1HdVRL33fud28}^Q|zkNQ4 ztxOWLW2O7)Wj+_$;_G6&wv2hhyl_rlqg*dH;7XgT6ex3*5~WpXQ8c_}qm(EQD-DVU z?FJfCB!wgqnxavOU54}&#h}o<6eGJQ(VY1vnzJC4CY#fZ1|v!8L%;%ZDi*e=_2M zox=wYb{-!D>;gU{uoHYxu(JUW;@Ppug#_q@AR2*PsLIfX$;2F1$7A&fILLfRLB$L< zSUfR-KXJqZ dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + try { + dstOffset = (short)6 ; + dstLength = (short)0 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + dstOffset = (short)-1 ; + dstLength = (short)1 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + dstOffset = (short)0 ; + dstLength = (short)6 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + dstOffset = (short)3 ; + dstLength = (short)3 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + try { + dstOffset = (short)0 ; + dstLength = (short)-1 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : dstLength > length of the simple TLV list + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + try { + dstOffset = (short)0 ; + dstLength = (short)13 ; + proRespHdlr.copy(dstBuffer13, dstOffset, dstLength) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successful call, whole buffer + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + dstOffset = (short)0 ; + dstLength = (short)12 ; + result = proRespHdlr.copy(dstBuffer12, dstOffset, dstLength) ; + + bRes = (result == (short)(dstOffset + dstLength)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Compare the buffer + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + // Initialise the buffer + compareBuffer[0] = (byte)0x81 ; compareBuffer[1] = (byte)0x03 ; + compareBuffer[2] = (byte)0x01 ; compareBuffer[3] = (byte)0x21 ; compareBuffer[4] = (byte)0x00 ; + compareBuffer[5] = (byte)0x02 ; compareBuffer[6] = (byte)0x02 ; + compareBuffer[7] = (byte)0x82 ; compareBuffer[8] = (byte)0x81 ; + compareBuffer[9] = (byte)0x03 ; compareBuffer[10] = (byte)0x01 ; compareBuffer[11] = (byte)0x00 ; + + // Compare buffers + result = Util.arrayCompare(compareBuffer, (short)0, + dstBuffer12, (short)0, (short)12) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successful call, part of a buffer + testCaseNb = (byte) 10 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)20; i++) { + dstBuffer20[i] = (byte)i ; + compareBuffer[i] = (byte)i ; + } + + try { + + dstOffset = (short)3 ; + dstLength = (short)12 ; + result = proRespHdlr.copy(dstBuffer20, dstOffset, dstLength) ; + + bRes = (result == (short)(dstOffset + dstLength)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Compare the buffer + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + // Initialise the buffer + compareBuffer[3] = (byte)0x81 ; compareBuffer[4] = (byte)0x03 ; + compareBuffer[5] = (byte)0x01 ; compareBuffer[6] = (byte)0x21 ; compareBuffer[7] = (byte)0x00 ; + compareBuffer[8] = (byte)0x02 ; compareBuffer[9] = (byte)0x02 ; + compareBuffer[10] = (byte)0x82 ; compareBuffer[11] = (byte)0x81 ; + compareBuffer[12] = (byte)0x03 ; compareBuffer[13] = (byte)0x01 ; compareBuffer[14] = (byte)0x00 ; + + // Compare buffers + result = Util.arrayCompare(compareBuffer, (short)0, + dstBuffer20, (short)0, (short)20) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successful call, part of a buffer + testCaseNb = (byte)12 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)20; i++) { + dstBuffer20[i] = (byte)i ; + compareBuffer[i] = (byte)i ; + } + + try { + + dstOffset = (short)3 ; + dstLength = (short)9 ; + result = proRespHdlr.copy(dstBuffer20, dstOffset, dstLength) ; + + bRes = (result == (short)(dstOffset + dstLength)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare the buffer + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + // Initialise the buffer + compareBuffer[3] = (byte)0x81 ; compareBuffer[4] = (byte)0x03 ; + compareBuffer[5] = (byte)0x01 ; compareBuffer[6] = (byte)0x21 ; compareBuffer[7] = (byte)0x00 ; + compareBuffer[8] = (byte)0x02 ; compareBuffer[9] = (byte)0x02 ; + compareBuffer[10] = (byte)0x82 ; compareBuffer[11] = (byte)0x81 ; + + // Compare buffers + result = Util.arrayCompare(compareBuffer, (short)0, + dstBuffer20, (short)0, (short)20) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/Test_Api_2_Prh_Copy.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/Test_Api_2_Prh_Copy.java new file mode 100644 index 0000000..4fc6046 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/Test_Api_2_Prh_Copy.java @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Copy.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_copy; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_copy + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Copy extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_copy"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Copy() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 13 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no additional information + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0DCCCCCC CCCCCCCC CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/applet.opt new file mode 100644 index 0000000..c419824 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_copy.Api_2_Prh_Copy_1 +uicc.test.toolkit.api_2_prh_copy +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/javacard/api_2_prh_copy.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_copy/javacard/api_2_prh_copy.cap new file mode 100644 index 0000000000000000000000000000000000000000..24a70bc5063696f93c4157a956694dac2dcc7c83 GIT binary patch literal 4213 zcmbtX4Nz3q6+ZXf_q#vvl-+f~5b!4*R*?n#TOmX!27-t~fJ&%NaJy~_i0o!r9VMh$ zHYs8if;Nd0C!N4FI%>;I+DKC+v6habkV-O5J2oxaT1{d)Iy!AL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n2=$dkYUnfn6+CHCS(XywcI6RI-^OGVbEk4Yz9q+X6p>ZW|)$pXpiD+Wf-T) zF#kU?=)gUTo|eBYdgIu9?vHPqajj)o5!aeq9drj9Jtd9aW^Fl?acll+M00ePIp#ly z*BIjCsPaCw#^*sEUkh7u72Nz+9!(J?9DM3GXnB@1%bERfmM949Pm)AYqzmN~c7lDs z#|a86B>CL)wZf#|M)E`VsIg1->p`8 zTRnkBKQ=i`lo3X7r^ihe+bP3j7APo=zxCgOv=y$qQEsMggNZHfsjO~p>JS21=v7~)AghdkLBQ(O2kH*tCB+T*s)@+sIr`J7EC|&gJF6< z%6>3JkN@@afn_mFzE1b*T_ahBaNc5{_edwJXVAB+5rzdg!Lc($HLrRSeRCQi>5q#f z(yHni^j&F$!9e4Y5$RF&4EjDZ!f+ri27T9g7muzLjPTUsTNL{PDV}N!^#uA3FhVdA z7eS;S)HCQ;)(FFgN<0#D>#Uwezqm$dmg9mP`%LMUT0M<^wTsZ0jq%V#uYHx}0{(;m OFybd0=iO;y-hTn$C;7kt literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/Api_2_Prh_Cpai_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/Api_2_Prh_Cpai_1.java new file mode 100644 index 0000000..d1b368c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/Api_2_Prh_Cpai_1.java @@ -0,0 +1,715 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Cpai_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_cpai; + +import uicc.test.util.*; +import uicc.toolkit.*; +import javacard.framework.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_cpai + * + * @version 0.0.1 - 22 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Cpai_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + + private byte[] dstBuffer5 = new byte[5] ; + private byte[] dstBuffer6 = new byte[6] ; + private byte[] dstBuffer7 = new byte[7] ; + private byte[] dstBuffer9 = new byte[9] ; + private byte[] dstBuffer10 = new byte[10] ; + private byte[] dstBuffer20 = new byte[20] ; + private byte[] dstBufferF2 = new byte[0xF2] ; + + private byte[] src = new byte[256] ; + public final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Cpai_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Cpai_1 thisApplet = new Api_2_Prh_Cpai_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + ProactiveResponseHandler proRespHdlr = null ; + + short result = (short) 0 ; + + // -------------------------------------------- + // Test Case 1 : NULL as parameter to dstBuffer + + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + // copyAdditionalInformation() with null buffer + proRespHdlr.copyAdditionalInformation(null, (short)0, (short)1) ; + + } catch (NullPointerException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : dstOffset > dstBuffer.length + + testCaseNb = (byte) 2 ; + bRes = false ; + try { + proRespHdlr.copyAdditionalInformation(dstBuffer10, (short)11, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + proRespHdlr.copyAdditionalInformation(dstBuffer10, (short)-1, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBuffer.length + + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + proRespHdlr.copyAdditionalInformation(dstBuffer10, (short)0, (short)11) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + proRespHdlr.copyAdditionalInformation(dstBuffer10, (short)6, (short)5) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + proRespHdlr.copyAdditionalInformation(dstBuffer10, (short)6, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successfull call, dstBuffer is the whole buffer + + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Successfull call, dstBuffer is the whole buffer + result = proRespHdlr.copyAdditionalInformation(dstBuffer5, (short)0, (short)5) ; + + // Verify the result + bRes = (result == (short)5) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Compare dstBuffer + + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + // Response from the mobile + src[0] = (byte) 0x01 ; + src[1] = (byte) 0x23 ; + src[2] = (byte) 0x45 ; + src[3] = (byte) 0x67 ; + src[4] = (byte) 0x89 ; + + // Compare the buffer + result = Util.arrayCompare(src, (short)0, dstBuffer5, (short)0, (short)5) ; + + bRes = (result == (short) 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Verify the selected TLV + + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + // Verify the TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short) 0x06) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successfull call, dstBuffer is part of a buffer + + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Successfull call, dstBuffer is the whole buffer + result = proRespHdlr.copyAdditionalInformation(dstBuffer7, (short)2, (short)5) ; + + // Verify the result + bRes = (result == (short)7) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Compare dstBuffer + + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + // Response from the mobile + src[0] = (byte) 0xAB ; + src[1] = (byte) 0xCD ; + src[2] = (byte) 0xEF ; + src[3] = (byte) 0xFE ; + src[4] = (byte) 0xDC ; + + // Compare the buffer + result = Util.arrayCompare(src, (short)0, dstBuffer7, (short)2, (short)5) ; + + bRes = (result == (short) 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call, dstBuffer is part of a buffer + + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Successfull call, dstBuffer is the whole buffer + result = proRespHdlr.copyAdditionalInformation(dstBuffer7, (short)0, (short)5) ; + + // Verify the result + bRes = (result == (short)5) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare dstBuffer + + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + + // Response from the mobile + src[0] = (byte) 0xFE ; + src[1] = (byte) 0xDC ; + src[2] = (byte) 0xBA ; + src[3] = (byte) 0x98 ; + src[4] = (byte) 0x76 ; + + // Compare the buffer + result = Util.arrayCompare(src, (short)0, dstBuffer7, (short)0, (short)5) ; + + bRes = (result == (short) 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successfull call, dstBuffer is part of a buffer + + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Successfull call, dstBuffer is the whole buffer + result = proRespHdlr.copyAdditionalInformation(dstBuffer9, (short)2, (short)5) ; + + // Verify the result + bRes = (result == (short)7) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Compare dstBuffer + + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + + // Response from the mobile + src[0] = (byte) 0x00 ; + src[1] = (byte) 0x11 ; + src[2] = (byte) 0x22 ; + src[3] = (byte) 0x33 ; + src[4] = (byte) 0x44 ; + + // Compare the buffer + result = Util.arrayCompare(src, (short)0, dstBuffer9, (short)2, (short)5) ; + + bRes = (result == (short) 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Successfull call, F2h bytes in the response + + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Successfull call, dstBuffer is the whole buffer + result = proRespHdlr.copyAdditionalInformation(dstBufferF2, (short)0, (short)0xF2) ; + + // Verify the result + bRes = (result == (short)0xF2) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Compare dstBuffer + + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + + // Response from the mobile + for (short i=(short)0; i<(short)dstBufferF2.length; i++) { + src[i] = (byte)i ; + } + + // Compare the buffer + result = Util.arrayCompare(src, (short)0, dstBufferF2, (short)0, (short)0xF2) ; + + bRes = (result == (short) 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : Verify the selected TLV + + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + + // Verify the TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short) 0xF3) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 19 : dstLength > data available + + testCaseNb = (byte) 19 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response (5 additional bytes) + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + // dstLength > data available ==> ToolkitException.OUT_OF_TLV_BOUNDARIES + proRespHdlr.copyAdditionalInformation(dstBuffer6, (short)0, (short)6) ; + + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) { + bRes = true ; + } + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 20 : Verify whole dstBuffer + + testCaseNb = (byte) 20 ; + bRes = false ; + + try { + + // Initialise dstBuffer + for (short i=(short)0; i<(short)dstBuffer20.length; i++) { + dstBuffer20[i] = (byte)i ; + } + + // Response from the mobile + for (short i=(short)0; i<(short)dstBuffer20.length; i++) { + src[i] = (byte)i ; + } + + src[5] = (byte) 0x00 ; + src[6] = (byte) 0x11 ; + src[7] = (byte) 0x22 ; + src[8] = (byte) 0x33 ; + src[9] = (byte) 0x44 ; + + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Successfull call + proRespHdlr.copyAdditionalInformation(dstBuffer20, (short)5, (short)5) ; + + // Compare the buffer + result = Util.arrayCompare(src, (short)0, dstBuffer20, (short)0, (short)20) ; + + bRes = (result == (short) 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 21 : Successfull call, Terminal Response with 2 Result TLV + + testCaseNb = (byte) 21 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Clear the buffer + for (short i=0; i<(short)5; i++) { + dstBuffer5[i] = 0 ; + } + + result = proRespHdlr.copyAdditionalInformation(dstBuffer5, (short)0, (short)5) ; + + // Verify the result + bRes = (result == (short)5) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 22 : Compare dstBuffer + + testCaseNb = (byte) 22 ; + bRes = false ; + + try { + + // Response from the mobile + src[0] = (byte) 0x01 ; + src[1] = (byte) 0x23 ; + src[2] = (byte) 0x45 ; + src[3] = (byte) 0x67 ; + src[4] = (byte) 0x89 ; + + // Compare the buffer + result = Util.arrayCompare(src, (short)0, dstBuffer5, (short)0, (short)5) ; + + bRes = (result == (short) 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 23 : Verify the selected TLV + + testCaseNb = (byte) 23 ; + bRes = false ; + + try { + + // Verify the TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short) 0x06) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 24 : No Result TLV in Response + + testCaseNb = (byte) 24 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // An exception is thrown by send() as there is no General Result TLV + try { + proHdlr.send() ; + } + catch (Exception e) { + } + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + result = proRespHdlr.copyAdditionalInformation(dstBuffer5, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/Test_Api_2_Prh_Cpai.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/Test_Api_2_Prh_Cpai.java new file mode 100644 index 0000000..2ca0e89 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/Test_Api_2_Prh_Cpai.java @@ -0,0 +1,251 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Cpai.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_cpai; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_cpai + * + * @version 0.0.1 - 22 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Cpai extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_cpai"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Cpai() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 6 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + // Terminal response with 11 additional bytes + response = test.terminalResponse("81030121 00020282 81030C01 01234567" + + "89ABCDEF 012345"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 7 to 9 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 5 additional bytes + response = test.terminalResponse("81030121 00020282 81030601 01234567" + + "89"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 10 & 11 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 6 additional bytes + response = test.terminalResponse("81030121 00020282 81030701 ABCDEFFE" + + "DCBA"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 12 & 13 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 7 additional bytes + response = test.terminalResponse("81030121 00020282 81030801 FEDCBA98" + + "765432"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 14 & 15 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 8 additional bytes + response = test.terminalResponse("81030121 00020282 81030901 00112233" + + "44556677"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 16 to 18 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with F2 additional bytes + response = test.terminalResponse("81030121 00020282 810381F3 01000102" + + "03040506 0708090A 0B0C0D0E 0F101112" + + "13141516 1718191A 1B1C1D1E 1F202122" + + "23242526 2728292A 2B2C2D2E 2F303132" + + "33343536 3738393A 3B3C3D3E 3F404142" + + "43444546 4748494A 4B4C4D4E 4F505152" + + "53545556 5758595A 5B5C5D5E 5F606162" + + "63646566 6768696A 6B6C6D6E 6F707172" + + "73747576 7778797A 7B7C7D7E 7F808182" + + "83848586 8788898A 8B8C8D8E 8F909192" + + "93949596 9798999A 9B9C9D9E 9FA0A1A2" + + "A3A4A5A6 A7A8A9AA ABACADAE AFB0B1B2" + + "B3B4B5B6 B7B8B9BA BBBCBDBE BFC0C1C2" + + "C3C4C5C6 C7C8C9CA CBCCCDCE CFD0D1D2" + + "D3D4D5D6 D7D8D9DA DBDCDDDE DFE0E1E2" + + "E3E4E5E6 E7E8E9EA EBECEDEE EFF0F1"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 19 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 5 additional bytes + response = test.terminalResponse("81030121 00020282 81030601 00112233" + + "44"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 20 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 5 additional bytes + response = test.terminalResponse("81030121 00020282 81030601 00112233" + + "44"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 21 to 23 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 2 results TLV + response = test.terminalResponse("81030121 00020282 81030601 01234567" + + "89030100"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 24 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no result TLV + response = test.terminalResponse("81030121 00020282 81"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "18CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/applet.opt new file mode 100644 index 0000000..785b92b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_cpai.Api_2_Prh_Cpai_1 +uicc.test.toolkit.api_2_prh_cpai +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/javacard/api_2_prh_cpai.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpai/javacard/api_2_prh_cpai.cap new file mode 100644 index 0000000000000000000000000000000000000000..1db5b136c628d3c9176a8a86f1822ecf57c7af26 GIT binary patch literal 5107 zcmbtX4Nz3q6+ZXf_uhTGZx=2uEDK0LQx(*R{5T-UMv9`SI4H!ZNvkVv1VPxs>IiD) zxoQ0=N{z;e$=FdRi8Gq4V_ThCX;NdF8gWcwthI^6R%%n5Nk&_mG1Jay&s~rWF9_`9 zzWMHX=e@hyWZM!C#9t`>RspKhu_RRY`M_+-sJY(>Q8GcJLXLJ@9if$E2nR%|M;~- zH=F6U%mCEjnS{{XuQ1s)gb~b(A zhP4FXLm8kPx6T^cFtK&#I}7uZQ4`2PtgWf4%J6%e{2Bg+hPv7se}>0bvn*?wud#Yr zmCsX?vD&lFQ{`z~nK9ezS?O(@RORszNW9*0|4SmtK=?s4Vgcnoj_s*P*`Llgg=`v) zD+F>8!>5~3)99`8H#9a2MhQ|N5fKXounwH;2w34SXznHghfGYg&v%bK5RWeeB8#%f z=d1Jj1t*2rZ$(E)ZU6Y{Gup1XkwhReqS7_KhQ<()31#=H~BsF{&M^bMED9OI#~kH5dfP~Og@ho5g@*G1*2nBUJsDUVy3d$IiD&Sg+x|stF*i8W)%srKmfK~;v z5fKDb=V@vZk*MG-Ho!(KR&^%zL~~PPVRey0SH94m1SOkb;C+Q#n_Qi zN4!)E;u9xHYpBbC1%*9B-AH>UCKv&f?=1Yqh5~s zGStga_oBWI^`D@=4)s>l_Z!*LC6rx87IlJyjx%CuA^|6&x(nh-I@-t^$qy2xSY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h_Cprv_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cprv/Api_2_Prh_Cprv_1.java new file mode 100644 index 0000000..b84fcf6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cprv/Api_2_Prh_Cprv_1.java @@ -0,0 +1,540 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Cprv_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_cprv; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_cprv + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Cprv_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + + private byte[] compareBuffer5 = new byte[5] ; + private byte[] compareBuffer15 = new byte[15] ; + private byte[] compareBuffer17 = new byte[17] ; + private byte[] compareBuffer20 = new byte[20] ; + + public final byte DCS_8_BIT_DATA = (byte)0x04; + /** + * Constructor of the applet + */ + public Api_2_Prh_Cprv_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Cprv_1 thisApplet = new Api_2_Prh_Cprv_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + ProactiveResponseHandler proRespHdlr = null ; + + // Result of method + short result = 0 ; + + short valueOffset = 0 ; + short compareOffset = 0 ; + short compareLength = 0 ; + + + // -------------------------------------------- + // Test Case 1 : Null as compareBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Select Text String TLV + proRespHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + proRespHdlr.compareValue(valueOffset, null, compareOffset, compareLength) ; + + } catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : compareOffset >= compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + valueOffset = (short)0 ; + compareOffset = (short)6 ; + compareLength = (short)0 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + valueOffset = (short)0 ; + compareOffset = (short)-1 ; + compareLength = (short)1 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : compareLength > compareBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)6 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : compareOffset + compareLength > compareBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + valueOffset = (short)0 ; + compareOffset = (short)3 ; + compareLength = (short)3 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : compareLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)-1 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + valueOffset = (short)7 ; + compareOffset = (short)0 ; + compareLength = (short)0 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + valueOffset = (short)-1 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : compareLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)7 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + compareLength > Text String length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + valueOffset = (short)2 ; + compareOffset = (short)0 ; + compareLength = (short)5 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Unavailable element + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + try { + proRespHdlr.compareValue(valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------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Vi6jjZ7ic0%i2^!}*A9yeX0#F&uSl z4rFw|>j6mr*LX9If6xvav8_VU@x_M|B-|@M7IYuN4ea8avezEs6j_nEvah&S$V8Dt zTxZkGFKl1x2v3Cjd?lQMBGiRfK*}^nwlK9u{F`we_wdaO zhc9JXqMX}?oC_GdMR#sdEV^?GQ7pRi`+DUfUae7H?dX+tTD_JKuUP3a*9t39tRcR$ z>9*jsA%<6MijCKDWFv}=+ME7{>x=&h)Dq4Me~-M_qaaj=*ma0qgV>3Ju5}32AylC{ zgc5~nkPt8Mt`IMBuKVJmQss!^Idq;w=Q%WO5)k<-$wy*y1=zD@sYiXe(2Hztc+J-uLh!Hkm9l9}wJeAzzMDckwPDY892 z*CLP4vB>efb`>us!V*!scN5Au3n!T;i@aG?)6~?k#+Z}S%*jK4lSDq*tWHfynV(ve zTA8vebw%pPDURL6Pdb6q)8s;pz6e?1X?6P=yjZhpGc?07EZneW!b20go(W1=ggDS& zfYqug0tH$@#Xx~pQ?XE>l~o)RXq6QY1z47V5MV^?!~hHH;Tl$R^U(rgA{j6T#%tFy zA&a1jpAKngsF07P%Tqcu|8| z#pY8|!j#rj5+(tw?coz&^m#%%@r`WvI{#^2Utx=_*{(;c9~iDfn;A9gjBy!OZfGk)?g@3*v<5d0UpJ2*T5 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/Api_2_Prh_Cpts_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/Api_2_Prh_Cpts_1.java new file mode 100644 index 0000000..bcd25c2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/Api_2_Prh_Cpts_1.java @@ -0,0 +1,641 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Cpts_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_cpts; + +import javacard.framework.*; +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_cpts + * + * @version 0.0.1 - 23 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Cpts_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + private byte[] ARRAY04 = new byte[0x04] ; + private byte[] ARRAY7E = new byte[0x7E] ; + private byte[] ARRAYFF = new byte[0xFF] ; + + private byte[] dstBuffer = null ; + private byte[] src = new byte[0x100] ; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Cpts_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Cpts_1 thisApplet = new Api_2_Prh_Cpts_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + ProactiveResponseHandler proRespHdlr = null ; + + short result = (short) 0 ; + + + // -------------------------------------------- + // Test Case 1 : Null dstBuffer + + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Build and send a GET INPUT command + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + // CopyTextString() with a null dstBuffer + proRespHdlr.copyTextString(null, (short)0) ; + + } catch (NullPointerException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : dstOffset + text length > dstBuffer.length + + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Build and send a GET INPUT command + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + // CopyTextString() with a dstOffset + text length > dstBuffer.length + proRespHdlr.copyTextString(ARRAY04, (short)2) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + // CopyTextString() with dstOffset < 0 + proRespHdlr.copyTextString(ARRAY04, (short)-1) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + + + // -------------------------------------------- + // Test Case 4 : unavailable Text String TLV + + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + // Build and send a DISPLAY TEXT command + proHdlr.initDisplayText((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + proRespHdlr.copyTextString(ARRAY04, (short)0) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : successfull call with null Text String TLV + + testCaseNb = (byte) 5 ; + bRes = false ; + + // Initialise dstBuffer and src + dstBuffer = ARRAY04 ; + + for (short i=0; i<4; i++) { + dstBuffer[i] = (byte)(i+0xF0) ; + src[i] = (byte)(i+0xF0) ; + } + + try { + + // Build and send a GET INPUT command + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Copy text string + result = proRespHdlr.copyTextString(dstBuffer, (short)02) ; + + bRes = (result == (short)2) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : compare buffer + + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + result = Util.arrayCompare(src, (short)0, dstBuffer, (short)0, (short)4) ; + + bRes = (result == 0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + + // -------------------------------------------- + // Test Case 7 : successfull call with text length = 1 + + testCaseNb = (byte) 7 ; + bRes = false ; + + // Initialise dstBuffer + dstBuffer = ARRAY04 ; + + for (short i=0; i<4; i++) { + dstBuffer[i] = (byte)i ; + } + + try { + + // Build and send a GET INPUT command + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Copy text string + result = proRespHdlr.copyTextString(dstBuffer, (short)00) ; + + bRes = (result == (short)1) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : compare buffer + + // Initialise src + src[0] = (byte) 0x41 ; + for (short i=1; i<4; i++) { + src[i] = (byte)i ; + } + + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + result = Util.arrayCompare(src, (short)0, dstBuffer, (short)0, (short)4) ; + + bRes = (result == 0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : successfull call with text length = 2 + + testCaseNb = (byte) 9 ; + bRes = false ; + + // Initialise dstBuffer + dstBuffer = ARRAY04 ; + + for (short i=0; i<4; i++) { + dstBuffer[i] = (byte)i ; + } + + try { + + // Build and send a GET INPUT command + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Copy text string + result = proRespHdlr.copyTextString(dstBuffer, (short)2) ; + + bRes = (result == (short)4) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : compare buffer + + // Initialise src + src[2] = (byte) 0x42 ; + src[3] = (byte) 0x43 ; + for (short i=0; i<2; i++) { + src[i] = (byte)i ; + } + + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + result = Util.arrayCompare(src, (short)0, dstBuffer, (short)0, (short)4) ; + + bRes = (result == 0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : verify the TLV selected + + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x03) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : successfull call with text length = 7Eh + + testCaseNb = (byte) 12 ; + bRes = false ; + + // Initialise dstBuffer + dstBuffer = ARRAY7E ; + + for (short i=0; i<(short)0x7E; i++) { + dstBuffer[i] = 0 ; + } + + try { + + // Build and send a GET INPUT command + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Copy text string + result = proRespHdlr.copyTextString(dstBuffer, (short)0) ; + + bRes = (result == (short)0x7E) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : compare buffer + + // Initialise src + for (short i=0; i<(short)0x7E; i++) { + src[i] = (byte)(i+1) ; + } + + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + + result = Util.arrayCompare(src, (short)0, dstBuffer, (short)0, (short)0x7E) ; + + bRes = (result == 0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : verify the TLV selected + + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x7F) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : successfull call with text length = 7Fh + + testCaseNb = (byte) 15 ; + bRes = false ; + + // Initialise dstBuffer + dstBuffer = ARRAYFF ; + + for (short i=0; i<(short)0xFF; i++) { + dstBuffer[i] = (byte)i ; + } + + try { + + // Build and send a GET INPUT command. + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Copy text string + result = proRespHdlr.copyTextString(dstBuffer, (short)0x10) ; + + bRes = (result == (short)0x8F) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : compare buffer + + // Initialise src + for (short i=0; i<(short)0xFF; i++) { + src[i] = (byte)i ; + } + + for (short i=1; i<(short)0x80; i++) { + src[(short)(i+0x0F)] = (byte)i; + } + + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + + result = Util.arrayCompare(src, (short)0, dstBuffer, (short)0, (short)0xFF) ; + + bRes = (result == 0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : successfull call with text length = EFh + + testCaseNb = (byte) 17 ; + bRes = false ; + + // Initialise dstBuffer + dstBuffer = ARRAYFF ; + + for (short i=0; i<(short)0xFF; i++) { + dstBuffer[i] = 0 ; + } + + try { + + // Build and send a GET INPUT command. + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Copy text string + result = proRespHdlr.copyTextString(dstBuffer, (short)0) ; + + bRes = (result == (short)0xEF) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : compare buffer + + // Initialise src + for (short i=0; i<(short)0xFF; i++) { + src[i] = 0 ; + } + for (short i=0; i<(short)0xEF; i++) { + src[i] = (byte)(i+1) ; + } + + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + + result = Util.arrayCompare(src, (short)0, dstBuffer, (short)0, (short)0xFF) ; + + bRes = (result == 0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // --------------------------------------------------------------------------- + // Test Case 19 : successfull call with text length = 2 and 2 text string TLV + + testCaseNb = (byte) 19 ; + bRes = false ; + + // Initialise dstBuffer + dstBuffer = ARRAY04 ; + + for (short i=0; i<4; i++) { + dstBuffer[i] = (byte)i ; + } + + try { + + // Build and send a GET INPUT command + proHdlr.initGetInput((byte)0, (byte)4, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + proHdlr.send() ; + + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Copy text string + result = proRespHdlr.copyTextString(dstBuffer, (short)2) ; + + bRes = (result == (short)4) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 20 : compare buffer + + // Initialise src + src[2] = (byte) 0x42 ; + src[3] = (byte) 0x43 ; + for (short i=0; i<2; i++) { + src[i] = (byte)i ; + } + + testCaseNb = (byte) 20 ; + bRes = false ; + + try { + + result = Util.arrayCompare(src, (short)0, dstBuffer, (short)0, (short)4) ; + + bRes = (result == 0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 21 : verify the TLV selected + + testCaseNb = (byte) 21 ; + bRes = false ; + + try { + + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x03) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/Test_Api_2_Prh_Cpts.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/Test_Api_2_Prh_Cpts.java new file mode 100644 index 0000000..2b8e331 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/Test_Api_2_Prh_Cpts.java @@ -0,0 +1,253 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Cpts.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_cpts; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_cpts + * + * @version 0.0.1 - 23 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Cpts extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_cpts"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Cpts() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9116"); + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 2 & 3 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + response = test.terminalResponse("81030123 00020282 81030100 0D040441" + + "4243"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Fetch the display text proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 5 & 6 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + response = test.terminalResponse("81030123 00020282 81030100 0D00"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 7 & 8 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + // Terminal response with Text String Length = 01h + response = test.terminalResponse("81030123 00020282 81030100 0D020041"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 9 to 11 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + // Terminal response with Text String Length = 02h + response = test.terminalResponse("81030123 00020282 81030100 0D030042" + + "43"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 12 to 14 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + // Terminal response with Text String Length = 7Eh + response = test.terminalResponse("81030123 00020282 81030100 0D7F0401" + + "02030405 06070809 0A0B0C0D 0E0F1011" + + "12131415 16171819 1A1B1C1D 1E1F2021" + + "22232425 26272829 2A2B2C2D 2E2F3031" + + "32333435 36373839 3A3B3C3D 3E3F4041" + + "42434445 46474849 4A4B4C4D 4E4F5051" + + "52535455 56575859 5A5B5C5D 5E5F6061" + + "62636465 66676869 6A6B6C6D 6E6F7071" + + "72737475 76777879 7A7B7C7D 7E"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 15 to 16 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + // Terminal response with Text String Length = 7Fh + response = test.terminalResponse("81030123 00020282 81030100 0D818004" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 17 to 18 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + // Terminal response with Text String Length = EFh + response = test.terminalResponse("81030123 00020282 81030100 0D81F004" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F80" + + "81828384 85868788 898A8B8C 8D8E8F90" + + "91929394 95969798 999A9B9C 9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAABAC ADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABBBC BDBEBFC0" + + "C1C2C3C4 C5C6C7C8 C9CACBCC CDCECFD0" + + "D1D2D3D4 D5D6D7D8 D9DADBDC DDDEDFE0" + + "E1E2E3E4 E5E6E7E8 E9EAEBEC EDEEEF"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 19 to 21 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + // Terminal response with 2 Text String TLV + response = test.terminalResponse("81030123 00020282 81030100 0D030042" + + "430D0204 44"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "15CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/applet.opt new file mode 100644 index 0000000..b3d145d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_cpts.Api_2_Prh_Cpts_1 +uicc.test.toolkit.api_2_prh_cpts +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/javacard/api_2_prh_cpts.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpts/javacard/api_2_prh_cpts.cap new file mode 100644 index 0000000000000000000000000000000000000000..e60f9154629be08da83215af455f8aa4d16c6681 GIT binary patch literal 4969 zcmbtX3v?7$8UF9QcV{27*`3KQ+W-v(vQQHe=(3Op34!nk;Y1Sbp;Sp+0)zyzCff+9 z#bHrW4Ww;AJykqy1)|cfrH6PLq2c>3oA(e5xjeu@#q8>mPt99cmQzu(a9-K$s_N{Dvi}?h zh%c&WicRt!+%_<(?VRJVHlzFX+-}Q>b3dDMpiB6AL-q0bx&OZM@VV;Z&1>J;{la_e zKYH!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N!6?-<4T8~z0ZP2g{FN?DQ-Cx!YL7uYz@id(@;7uMdiEqNVv^QLK1#Ezy(nzS^u zL?W6bHvVlmrrZbuW#9}`EQTp)g;EmY0v1#+XcoMcaGpn8P{=5AJ64Hb&Tu+o~a z(yCcejg@HDVOnVfOf;;N4T`wHD>E@2f>Ih{19HMvS(A}OCYsEnt=4NKLIB~-HkcOpq{ z&7DY+n`mxS(D)Z6?ViSa484jwVSM6r@g(B!(L5Lj579jT&~v;1#nn;7HsYs#{ zO{Fh~=eD(X9ygkyNKtX!C%+s+R<$J;I}In#zG}xBfnr)pwL(?2Hd-GptFLQJ{EbUk zPTszfIlP&Nvyb8&MQR+2>Q*dh3L{U`T3RYtuwZ@oS0e;b;-rjBwuJSM9nYrcFe3it z`p2{57}3M}GiCMGoq)Fs7}3r8v%Ks=M$}mUg!BeWPE_S(H^C}eLje*2xiTq-8q5R-hee-e)G%ks(hO%{1u#>~V-#tdUVIXZ*e z&%SyHBSR5F48K~NRo4=3u8&}WPlF>vA6B_oTw>YAZe(H-R%=*e0t9Kat z_+%kS>rW1XJPICySb&0{Gg!ufsI#yUjzIy;qQ52<;>6PYetK^uBo7t|Qxlb?4=cXl zkWXlE5PwsID4>nZjSEWf>1@P2SO5#jB(j%ZHTr3ya6P$rQ;Dcy^Au7n^z@W6C6(ob z@nC~;t4SW(g3%^9`MO)nOtn~V?#54Q*9aR~-%E+a=+4Xx=0?n5kl9q+FxoORgSoXb7`~GdgSpW%^O!pzgXdA)MZ-@>>8*aq zOki$&41yym5g2WdnZbN88w^j{QgOj_Oq*%UXR|@`=agtnC$*Wze8?FzR!1t{Bp-Q| S dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + try { + dstOffset = (short)6 ; + dstLength = (short)0 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + dstOffset = (short)-1 ; + dstLength = (short)1 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + dstOffset = (short)0 ; + dstLength = (short)6 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + dstOffset = (short)3 ; + dstLength = (short)3 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + try { + dstOffset = (short)0 ; + dstLength = (short)-1 ; + proRespHdlr.copy(dstBuffer5, dstOffset, dstLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : dstLength > length of the simple TLV list + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + try { + dstOffset = (short)0 ; + dstLength = (short)13 ; + proRespHdlr.copy(dstBuffer13, dstOffset, dstLength) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successful call, whole buffer + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + dstOffset = (short)0 ; + dstLength = (short)12 ; + result = proRespHdlr.copy(dstBuffer12, dstOffset, dstLength) ; + + bRes = (result == (short)(dstOffset + dstLength)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Compare the buffer + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + // Initialise the buffer + compareBuffer[0] = (byte)0x81 ; compareBuffer[1] = (byte)0x03 ; + compareBuffer[2] = (byte)0x01 ; compareBuffer[3] = (byte)0x21 ; compareBuffer[4] = (byte)0x00 ; + compareBuffer[5] = (byte)0x02 ; compareBuffer[6] = (byte)0x02 ; + compareBuffer[7] = (byte)0x82 ; compareBuffer[8] = (byte)0x81 ; + compareBuffer[9] = (byte)0x03 ; compareBuffer[10] = (byte)0x01 ; compareBuffer[11] = (byte)0x00 ; + + // Compare buffers + result = Util.arrayCompare(compareBuffer, (short)0, + dstBuffer12, (short)0, (short)12) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successful call, part of a buffer + testCaseNb = (byte) 10 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)20; i++) { + dstBuffer20[i] = (byte)i ; + compareBuffer[i] = (byte)i ; + } + + try { + + dstOffset = (short)3 ; + dstLength = (short)12 ; + result = proRespHdlr.copy(dstBuffer20, dstOffset, dstLength) ; + + bRes = (result == (short)(dstOffset + dstLength)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Compare the buffer + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + // Initialise the buffer + compareBuffer[3] = (byte)0x81 ; compareBuffer[4] = (byte)0x03 ; + compareBuffer[5] = (byte)0x01 ; compareBuffer[6] = (byte)0x21 ; compareBuffer[7] = (byte)0x00 ; + compareBuffer[8] = (byte)0x02 ; compareBuffer[9] = (byte)0x02 ; + compareBuffer[10] = (byte)0x82 ; compareBuffer[11] = (byte)0x81 ; + compareBuffer[12] = (byte)0x03 ; compareBuffer[13] = (byte)0x01 ; compareBuffer[14] = (byte)0x00 ; + + // Compare buffers + result = Util.arrayCompare(compareBuffer, (short)0, + dstBuffer20, (short)0, (short)20) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successful call, part of a buffer + testCaseNb = (byte)12 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)20; i++) { + dstBuffer20[i] = (byte)i ; + compareBuffer[i] = (byte)i ; + } + + try { + + dstOffset = (short)3 ; + dstLength = (short)9 ; + result = proRespHdlr.copy(dstBuffer20, dstOffset, dstLength) ; + + bRes = (result == (short)(dstOffset + dstLength)) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare the buffer + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + // Initialise the buffer + compareBuffer[3] = (byte)0x81 ; compareBuffer[4] = (byte)0x03 ; + compareBuffer[5] = (byte)0x01 ; compareBuffer[6] = (byte)0x21 ; compareBuffer[7] = (byte)0x00 ; + compareBuffer[8] = (byte)0x02 ; compareBuffer[9] = (byte)0x02 ; + compareBuffer[10] = (byte)0x82 ; compareBuffer[11] = (byte)0x81 ; + + // Compare buffers + result = Util.arrayCompare(compareBuffer, (short)0, + dstBuffer20, (short)0, (short)20) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/Test_Api_2_Prh_Cpyv.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/Test_Api_2_Prh_Cpyv.java new file mode 100644 index 0000000..635caa3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/Test_Api_2_Prh_Cpyv.java @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Cpyv.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_cpyv; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_cpyv + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Cpyv extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_cpyv"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Cpyv() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 13 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the DISPLAY TEXT proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response (No additional information) + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0DCCCCCC CCCCCCCC CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/applet.opt new file mode 100644 index 0000000..f2ae0a4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_cpyv.Api_2_Prh_Cpyv_1 +uicc.test.toolkit.api_2_prh_cpyv +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/javacard/api_2_prh_cpyv.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_cpyv/javacard/api_2_prh_cpyv.cap new file mode 100644 index 0000000000000000000000000000000000000000..fbe8323f6d0620867738bf61e4e8166d59922a69 GIT binary patch literal 4413 zcmbtX4^ULc9scdx_wVjN7C6p>E2m@vN~j(=>O} zz5Cwp{odQ%Z@=9)`@UCIK}9R5_*>dpJ|89(D~M3Jw5E7Y`O31q%HoyfWlO7Tax2UJ za|$4|rm`(K*Z#AeV>3E0O#7wnp~1KE2Ti}eaB}XO1M)M?HT6GW|Gt^idf&{F!`FXP z_0iF%E?)7j^g4gM;`oBBf|pK+_4MlVbL_jmy!GarAN}gsvBhuD1?!yM3lmBQZWN3> zkm~=#u_I^aKlaT*M_JLC?me^4HoKp@_gczs_w((S{$BmpzbIFSM_*sIwyL2zaml8g zS$kjgH@>#FLe4+*q9Tkwdr$Bu`!=uWt1H?24|;y~n%!^b=dNDear9Kvtj#~ShP2`3 zW@kZh(a`=6`u})5weH}~WrJNqTKCo=sb)*<+BD%ExB0NezkcM|rl;~&Rowc0&Zj4T zTAxAYT^o7ffpZtH?5lm+vQEB#)%vldFY+FF_$19={QV_iX=zrCT(>wj`f zUXy2w$Lnd|khk3D+2Cu>^?LjS(k`C5b%O{Z5Vi+9F@bao%XeoY-Z2wK4=Wq}#+0fW;BEFv+`R=@Y*$J6l!M{FvK{r(nT zfOAr?-l2}b^{M(=^ZL#&MiP$Lh|0h2Z)?|yL|9~;$T93rAj%#L>j^Q;auQyJ@tc6l zJ$ZTGue~~JGv4NKA)=q}lD5{4fTuN3g^vN3FX2Qx1OOF55CVcCM1+Kp5g=#?07V9P znQ9;)R2i?4pb1E~f)EfA=J6m0rvW}6crM|2B1RdozKI6oiQL5uE7^IFUw$Gi`$!mE%Z^lA4AZ(#mgEmQae7){pJ(GHCJwM_ah#y@Kwu@acL zRm&8IFrLs>Nh!c2X5RtvcDfzxO25TTSxuo^WWGYT#J*AJmRX>18?meXmTiKa#bcm$ z7KcH!Gb;uu9Avw)UFnqazXw+L4lw6B?CD~$Jw3ArERG(Cb9Adhp8(UKQ=Z)m$#Y09 z%@%34M6+ePh{SZeDUB*2LPKPrPllA#v_1kU_C>v5<2A)>$w6$QP3jY2I$7j5&sMOR z$uH<<*w`=Fhhf;%19rObD*-j3(6T)m!H&epRaFEC-MNg-O+uG9gRW2deOK zs`@a)x|lAEg_W6fW#+IlOITT)t}I?}GA*o3qRe_1Wp{ALO(;`!WvWfpmFe+OmDtn? zWhTC0U!crnR2Kh#Dx;y#(P3cfocgwEKK;AH@wmBjER1QBuMT(ujoz|GUyHu~s^|x9 zm#G|2FW%R~Z30JZ9BX_VSG0MNr>&Lm@g{T}z5CN-1&f&eB~hX|W=T*)bCMoR;V?N< zMg5{Gnw?k$gG1#(kR^%#6-Ab1nyg<_)YQmLe*Ft>>dj!GqTX5Lhs8KiRWf8L(V6B< z9fu>%>Bw9=V`1iFh>96g=VujL8~y0h_!L>-G@2Fk3FruE zmk?C(Wt)ioX_Pw%0xoVM1aNU5LBYkXga|I~CM0liLm`7p!TO3Os2Eg@LKnOYOQ0Mx zASSpDrI5kT&4eVtSH%=`ga8g4v}@9@5FUggY*mU_!i{OTz%m}80v=&>Utdt)MrIBp|@(OgFuEHoAw5vy%vFxuq^ z!wWGn7|pYh$LMAwJR9&Sihe;#CcLeYz-VG41ZQF*h*(-9gK@8pFqGro8@&X>&TXVI rZr2f-P)sz2&D%(0-0>nb?^ compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + try { + tag = TAG_TEXT_STRING ; + compareOffset = (short)21 ; + proRespHdlr.findAndCompareValue(tag, compareBuffer20, compareOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + tag = TAG_TEXT_STRING ; + compareOffset = (short)-1 ; + proRespHdlr.findAndCompareValue(tag, compareBuffer20, compareOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : length > compareBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + tag = TAG_TEXT_STRING ; + compareOffset = (short)0 ; + proRespHdlr.findAndCompareValue(tag, compareBuffer15, compareOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : compareOffset + length > compareBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + tag = TAG_TEXT_STRING ; + compareOffset = (short)5 ; + proRespHdlr.findAndCompareValue(tag, compareBuffer20, compareOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Unavailable element + testCaseNb = (byte) 6 ; + bRes = false ; + bRes2 = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Select a TLV + proRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + try { + tag = (byte)04 ; + compareOffset = (short)0 ; + proRespHdlr.findAndCompareValue(tag, compareBuffer20, compareOffset) ; + + } catch (ToolkitException e) { + bRes2 = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + // Verify there is no current TLV + try { + proRespHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (bRes2) && (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + // Initialise compareBuffer + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=1; is-$M>teI8QAFCf-Q}yLJ zfMi`wwBsTF=^efK?bn>Is~20MXUB$j@7divuWtW|Dq-%Xi$D7PYX@mgqIo4#9u=Cp+Ho>W@ z!`1QUxBO?>sYOcV)n|r7Pq1job4%ao{p_7#OJ^K)RX%wrckNK$r8l|{&l=kE!U11w z(F3kCb;EQp-ld&ctq(POg@uIbi(xo(fJ^QpPtT}t1g&+ZXU{ABSrUjA}ob-eFy zf!lALXe7jQd)1__BMTQFn!Db%cf;7N!+LL3YwO_)IZtUNPfTn8&;B3oIM8;yYH#w> z9m$J(d)~cKckI->KOcGisBq=Kzdq1->{rEu4mSsuy+3jK+~E434-bsobt0PI^V-Y1 z$qiaF%8mUyHo5sj~6R0{bp1jUOJHG?W%0xR6aDNmzd;)wwrd~mHi2pgD~ zU+vUbtTmEgTn@ZnStWtbv)8$zr1R<|1TirWo4Gs|jq5NT%8f?t#VIL~_F=Y&5QD{Y z@F@&50?F1%xp{eI3pO)hdYQ9*WpqVbBD^9|i${Z*K|rGqrT`KOL7^xd3XdY70M$?c zL=oU6P6LV}i};LmSb(gRP$-IkbqC-%0kOl0WdUO%x8qRHSj6gp&L?T`#-rgz`1Bk$q@n3&(jnn+?vbTPw8;w6Onpd^xl+d33ZBuVnCF557ZkamRD3~+4NTJe z8Y!knQd0w^^gvvePUP;3D5nR?rijXbu3YKY8_&lJd?yDgEtl??F~b_3V%djA^NY&_ zKE`pSG3w*d^eR^#^P`FL8XcL<_b|9Ju>2&?Ng+Nc$6QHXl~tLqd_1&3CaRp|x3_-G z_9JB+e!w_E!LJHo9gTBai!JOlWNf7}V4ne{^zMqgU)Q@2u=E?03tD1!T&G3(PH2IJ zsFoz%-uh{h3Q|Z6T2Vo&T2-sa6toi6s(4yINm9kFD4|R>Q>RAf(hRK4sHZiBwdq(J z!`g^y8^CfRV(mKCuG)31ov3z(y(f>);5m#uTZ-q?s(#v$}Jg4f^c}}7_ zQ#`?N)QsEUGUDthoJ+^K7|umhS0+x;af+(wIEAPR!+rhfWQ+fQ%D9cnI8w^Eb!FU4 z88=bgnabqo%H*gyx-vOL&FSA_k=Hl)uFT90_86hg6x5?bJq+q0swWfb)uCS1t3$m+ z_4Y&YTscB`ymAJP*IntE+pS-jnXiGXpPr=p3+B@~KGmncU_PSy?!(es({EqavCeq= z)a*sKXL}gS&j00i4*V!HsWAO7Av@}(#ny%B-a7 z|B_v>dUAYs%6S>Z{(h{7$_-0bJW9HcM;aJQQ+)tk_`4->8gJ)i&qz`5C1fzv3MWCu%3v4^Wp{pK(L0-nW2T@?VxdPWL1kYb z%s{DzS>z#dR9I55jT8`t|7|H2Yf&1xF$$SNr`A>z>cwCp72IZqO)R+0PWK9R*(}z9 zgL}6SD?Q7rXe@IEPX}B^iZQB6Q@)7?Hb=>dv5X*N43!3TnFggJDkH@hJf$fC&g^p1 zp_Gwg42RN`Bc>_F;K;}_MlESp0#BB?4XRAVFh+!n}(!A7bC@Z$EPW7yV<1} wZhRxkc+IC#t4yN|m%b5Yyb9B(SMg(JZiBKf#@cFuU2kB+-+bJMt4>z?A8=!n;s5{u literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrbbs_bss/Api_2_Prh_Facrbbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrbbs_bss/Api_2_Prh_Facrbbs_Bss_1.java new file mode 100644 index 0000000..28286e0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facrbbs_bss/Api_2_Prh_Facrbbs_Bss_1.java @@ -0,0 +1,774 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Facrbbs_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_facrbbs_bss; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_facrbbs_bss + * + * @version 0.0.1 - 27 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Facrbbs_Bss_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + + private byte[] compareBuffer5 = new byte[5] ; + private byte[] compareBuffer15 = new byte[15] ; + private byte[] compareBuffer17 = new byte[17] ; + private byte[] compareBuffer20 = new byte[20] ; + private byte[] compareBuffer = new byte[20] ; + + public final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Facrbbs_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Facrbbs_Bss_1 thisApplet = new Api_2_Prh_Facrbbs_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes2 = false ; + + // Number of tests + testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + ProactiveResponseHandler proRespHdlr = null ; + + // Result of method + short result = 0 ; + + byte tag = (byte)0 ; + byte occurence = (byte)0; + short valueOffset = (short)0 ; + short compareOffset = (short)0 ; + short compareLength = (short)0 ; + + // -------------------------------------------- + // Test Case 1 : Null as compareBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + tag = TAG_COMMAND_DETAILS ; + occurence = (byte) 1 ; + valueOffset = (short) 0 ; + compareOffset = (short) 0 ; + compareLength = (short) 1 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, null, compareOffset, compareLength) ; + + } catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : compareOffset >= compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)6 ; + compareLength = (short)0 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)-1 ; + compareLength = (short)1 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : compareLength > compareBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)6 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : compareOffset + compareLength > compareBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)3 ; + compareLength = (short)3 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : compareLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)-1 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)7 ; + compareOffset = (short)0 ; + compareLength = (short)0 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)-1 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : compareLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)7 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + compareLength > Text String Length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)2 ; + compareOffset = (short)0 ; + compareLength = (short)5 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Invalid parameter + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)0 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.BAD_INPUT_PARAMETER) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Unavailable Element + testCaseNb = (byte) 12 ; + bRes = false ; + bRes2 = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Select a TLV + proRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)2 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + // FindAndCompareValue + try { + proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes2 = (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + // Verify there is no selected TLV + try { + proRespHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (bRes2) && (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successful call + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=1; i<(short)compareBuffer17.length; i++) { + compareBuffer17[i] = (byte)(i-1) ; + } + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)17 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer17, compareOffset, compareLength) ; + + bRes = (result == (short)00) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Verify current TLV + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)17) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Successful call + testCaseNb = (byte) 15; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=1; i<(short)compareBuffer17.length; i++) { + compareBuffer17[i] = (byte)(i-1) ; + } + compareBuffer17[16] = 0x10 ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)17 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer17, compareOffset, compareLength) ; + + bRes = (result == (short)-1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Successful call + testCaseNb = (byte) 16; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=1; i<(short)compareBuffer17.length; i++) { + compareBuffer17[i] = (byte)(i-1) ; + } + compareBuffer17[0] = 0x03 ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)17 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer17, compareOffset, compareLength) ; + + bRes = (result == (short)+1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Successful call + testCaseNb = (byte) 17; + bRes = false ; + + try { + + // Initialise buffers + for (short i=0; i<(short)20; i++) { + compareBuffer20[i]=(byte)0x55 ; + } + for (short i=(short)3; i<(short)15; i++) { + compareBuffer20[i] = (byte)(i-2) ; + } + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)2 ; + compareOffset = (short)3 ; + compareLength = (short)12 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer20, compareOffset, compareLength) ; + + bRes = (result == (short)0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : Successful call + testCaseNb = (byte) 18; + bRes = false ; + + try { + + // Initialise buffers + for (short i=0; i<(short)20; i++) { + compareBuffer20[i]=(byte)0x55 ; + } + for (short i=(short)3; i<(short)15; i++) { + compareBuffer20[i] = (byte)(i-2) ; + } + compareBuffer20[3] = (byte)0x02 ; + compareBuffer20[4] = (byte)0x01 ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)2 ; + compareOffset = (short)3 ; + compareLength = (short)12 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer20, compareOffset, compareLength) ; + + bRes = (result == (short)-1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 19 : Successful call + testCaseNb = (byte) 19; + bRes = false ; + + try { + + // Initialise buffers + for (short i=0; i<(short)20; i++) { + compareBuffer20[i]=(byte)0x55 ; + } + for (short i=(short)3; i<(short)15; i++) { + compareBuffer20[i] = (byte)(i-2) ; + } + compareBuffer20[13] = (byte)0x0A ; + compareBuffer20[14] = (byte)0x0D ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)2 ; + compareOffset = (short)3 ; + compareLength = (short)12 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer20, compareOffset, compareLength) ; + + bRes = (result == (short)+1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 20 : Successful call + testCaseNb = (byte)20 ; + bRes = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Initialise buffers + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=1; i<(short)compareBuffer17.length; i++) { + compareBuffer17[i] = (byte)(i-1) ; + } + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)17 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer17, compareOffset, compareLength) ; + + bRes = (result == (short)0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 21 : Successful call + testCaseNb = (byte)21 ; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer[0] = (byte)0x00 ; + compareBuffer[1] = (byte)0x11 ; + compareBuffer[2] = (byte)0x22 ; + compareBuffer[3] = (byte)0x33 ; + compareBuffer[4] = (byte)0x44 ; + compareBuffer[5] = (byte)0x55 ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)2 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)6 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer, compareOffset, compareLength) ; + + bRes = (result == (short)0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 22 : Successful call + testCaseNb = (byte)22 ; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer[0] = (byte)0x00 ; + compareBuffer[1] = (byte)0x11 ; + compareBuffer[2] = (byte)0x22 ; + compareBuffer[3] = (byte)0x33 ; + compareBuffer[4] = (byte)0x44 ; + compareBuffer[5] = (byte)0x66 ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)2 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)6 ; + + result = proRespHdlr.findAndCompareValue(tag, occurence, valueOffset, compareBuffer, compareOffset, compareLength) ; + + bRes = (result == (short)-1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 23 : Successful call : search tag 8Dh + testCaseNb = (byte) 23 ; + bRes = false ; + + // Initialise TEXT and compare buffer + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=1; iF@BEia7DHMq@emYj@*v6zZDm%|k;`ogQ z$CGxg^Ugc(9-r^rbMC$G-BUY{GAk(fo4c{%`!J$efk9Pyed&~n>bV6~rPUR4%NNw= zSIzyV4CjPVe9ZSw$YyGx7^DmuQ+a}IhTAsCE&YE~>vg`QI&(@`u+{=A-%5rP# z%*SuloNu{4?guv-T63O%>isjD_L=)y?_8ah_u*T=?aX+zaD!=D$#d#O>-yYD2WI{F zX;OOgVCC5-mOa|@rzcL{dUnUZ+k%H1PUnfai{6$#8+h~Z^14sMyB&%l4}) zhrZa|`kmXSD%bn>uiT#L+oH8dfxVJDZxi8k)Mg3RX9+YxFjDHWxhQYi#y)=6f3h1Trr7-T#sZ z3e>doR&_XH|XztUIP|j9AqF_aRjTuZafc0 zQj1nkAz@=ghdy=1Y?6*08YML5(mYkVGU22?P}hK$d{yP!$9uMZ#yK+W=&Xj3gk5C?|o`oeVg4@Lt4w z3vvli-$1*QbYn?bG}HA6YHBnCY3yTZYwYUM1|fmH3?YbQL}apavjE)+F?P$k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.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facyb_bs/Api_2_Prh_Facyb_Bs_1.java new file mode 100644 index 0000000..f651fc6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_facyb_bs/Api_2_Prh_Facyb_Bs_1.java @@ -0,0 +1,434 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Facyb_Bs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_facyb_bs; + +import uicc.test.util.*; +import uicc.toolkit.*; +import javacard.framework.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_facyb_bs + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Facyb_Bs_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + + private byte[] dstBuffer20 = new byte[20] ; + private byte[] dstBuffer15 = new byte[15] ; + private byte[] dstBuffer17 = new byte[17] ; + private byte[] compareBuffer = new byte[20] ; + + public final byte DCS_8_BIT_DATA = (byte)0x04; + /** + * Constructor of the applet + */ + public Api_2_Prh_Facyb_Bs_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Facyb_Bs_1 thisApplet = new Api_2_Prh_Facyb_Bs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes = false ; + boolean bRes2 = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + ProactiveResponseHandler proRespHdlr = null ; + + // Result of method + short result = 0 ; + + byte tag = 0 ; + short dstOffset = 0 ; + + + // -------------------------------------------- + // Test Case 1 : Null as dstBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + tag = TAG_COMMAND_DETAILS ; + dstOffset = (short)0 ; + proRespHdlr.findAndCopyValue(tag, null, dstOffset) ; + + } catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : dstOffset > dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + try { + tag = TAG_TEXT_STRING ; + dstOffset = (short)21 ; + proRespHdlr.findAndCopyValue(tag, dstBuffer20, dstOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + tag = TAG_TEXT_STRING ; + dstOffset = (short)-1 ; + proRespHdlr.findAndCopyValue(tag, dstBuffer20, dstOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : length > dstBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + tag = TAG_TEXT_STRING ; + dstOffset = (short)0 ; + proRespHdlr.findAndCopyValue(tag, dstBuffer15, dstOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + length > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + tag = TAG_TEXT_STRING ; + dstOffset = (short)5 ; + proRespHdlr.findAndCopyValue(tag, dstBuffer20, dstOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Unavailable element + testCaseNb = (byte) 6 ; + bRes = false ; + bRes2 = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Select a TLV + proRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + try { + tag = (byte)04 ; + dstOffset = (short)0 ; + proRespHdlr.findAndCopyValue(tag, dstBuffer20, dstOffset) ; + + } catch (ToolkitException e) { + bRes2 = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + // Verify there is no current TLV + try { + proRespHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (bRes2) && (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + dstOffset = (short)0 ; + result = proRespHdlr.findAndCopyValue(tag, dstBuffer17, dstOffset) ; + + bRes = (result == (short)17) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Compare buffer + testCaseNb = (byte) 8 ; + bRes = false ; + + // Initialise compareBuffer + compareBuffer[0] = DCS_8_BIT_DATA ; + for (short i=1; iLZHSUd07D2}AyqQzOtK^!6AA2+ ztQ8`bO|T6T5(9`8i;7h{4a^Dx);OKEsn$_&N@814Qj{T1J9U&`D@BwU({q=E-F>KG z@0)MVJNLeOzVq|uzVmz)l(&Npuk!Zt0!SEk;GuF!RY`97%BAkgl9lC4m#nUuU%B+F zlK|0GHNnn2=Yw<4-+pQ11KGdbwC}$^UtxRfm0kYJ%jenO{mr9$*Iqhzc%VPRzkl?h z1&dF;``MFk?VO$S>wOPhtZLXfR~;1pTCmJFtC@e}>gckeLDCNQ|MaOynn4)4yzjYR z8VAao&VKyF3%~C(y|nn$t4F@`&ic#~U$np8(DhtS-nObOyhs0ecipa!Mr>!M{adk? z+`p&w&f!h7f4pnX&zvJ;&kDo6GYl7e7o1Oi@a1D8)=x&)Joxusf5(oGKMdT}HMizq zlW>VYcXYdKSTOI9@yzu7M+=ItHlz<2y~_ux7dPMY{PW)(Ty!9G3>NMR_n-d!v*Vvy z{_ytDetmj%-MzP8-Sg#0SI#>pL#KB1H7+8DpW&PM(79Jj{|EPs4s|>{e4za8@7Fy0 z=IJXZPB#r*{-m|P`u$r!y1U{%?!s5A?>us5)uV>Hj`iGE_tdOI_SaVatzhr+voAk# z`A-Eue5J5>pzu^@#LA- zy?cab+6ll}9>9n7lVeq5^*eF4_y?J&F?bR8HP_d>!-2N2I~)wQtZNRt{h{XC{Mt}! zQ*EQae)HPewQcTu{Xg;7`&%2_cLe+mf!6u;{t$um4^EC>ARG@wIe>=rAdKU9cm~oY zQyQyFHqOE)7>W?7QI<8g2I|AX*3FESgDgl#*wIiUs6sBtumw#HB5?3TL%sE-iy61z z0z>N2mV`nrfiUBxV80ZgBVh<2EE>NS&;FeJI!(Bjce+o77LyBuAtJDAp39 z$@ny!g^5KV$vy>h{`_<^E;BH{Qpf01|>AI0QxT2mt|H z1Q$?>0R1!q96~3uxlTQhZ4!b*2&kJt>@=ekP+C!nfY0h_r-_Iiil&Mkch7aFp;d;3 zh!lfp@wc@x??q5c(H|nn=pwOpaL}nEa;KzWJCqrz%o6|@QZHj=AlwveV04m@>mWX` zkpP%UUZjYu2MgH>D)|K{WNTzPc^dT>!9m_c{l!Qo8Ag2+^)FB#jbw5JESwD-+&oY? z8|wL}Zv;En1y=5H&~d*)xhxXo25|nZ$V_ewEHo>k(uFANA~WeWlqXO>kMdHagvWWl zDWdWblzUJ=4HiL)s6rM>#kmuVPP!eOQlFuiDplTMUI}=M1!a@BSX9E^F5*<|eTFX1 zsaQ}@r(#9HUz-%1(sr?3@H_&#;+>$MpW)2pOPrZ=xXN8SM_qc}#Z!+%pi-33DA`S|Fy5;JTZTjEC17(F^?*HF9VT~SDvE%Tlb$0SARRQc)Mcrq|^ipix@94gwCspwhSsLK#CVoV0*N8V}!Q4LXUcgufRfdx%6V@}!PP8kzz z$=7Td(UzbZnJptx@g8kO1wrzPE>p}^lWG!~t0tnF6kE$h<|#)N`wgC&6RjJV^{I-* ze4cz`zA2GOR*lT+L?X>G@64(>mPj*E&EK9#OQL(Gn{uybYWI??niJf!#N4x}mY91M zqGH*?qb@n{a(3^PF7q&&^wL zjUjcORe{D8!FuEhZeT~g9-EQ8qv;Y3J~M|_c|4w6np<_c9??SjDG<1C=yb0EO4D1>hYY z$33?p7O^Jt+JF+AU4kfw6|j=zkt0IWj6S09$31xCL)6iHg)A12A1~!fd=-SVW8*ma zBa_%7vmcq{@lC%q%!)kmHho= dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)5 ; + dstLength = (short)1 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer5, dstOffset, dstLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)-1 ; + dstLength = (short)1 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer5, dstOffset, dstLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)0 ; + dstLength = (short)6 ; + + try { + + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer5, dstOffset, dstLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)3 ; + dstLength = (short)3 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer5, dstOffset, dstLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)0 ; + dstLength = (short)-1 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer5, dstOffset, dstLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)7 ; + dstOffset = (short)0 ; + dstLength = (short)0 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer15, dstOffset, dstLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)-1 ; + dstOffset = (short)0 ; + dstLength = (short)1 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer15, dstOffset, dstLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : dstLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)0 ; + dstLength = (short)7 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer15, dstOffset, dstLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + dstLength > Text String Length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)2 ; + dstOffset = (short)0 ; + dstLength = (short)5 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer15, dstOffset, dstLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Unavailable Element + testCaseNb = (byte) 11 ; + bRes = false ; + bRes2 = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Select a TLV + proRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)2 ; + valueOffset = (short)0 ; + dstOffset = (short)0 ; + dstLength = (short)1 ; + + try { + proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer15, dstOffset, dstLength) ; + + } catch (ToolkitException e) { + bRes2 = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + // Verify there is no current TLV + try { + proRespHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (bRes2) && (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successful call + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)0 ; + dstLength = (short)17 ; + + result = proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer17, dstOffset, dstLength) ; + + bRes = (result == (short)17) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare buffer + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + + // Initialise compare buffer + compareBuffer[0] = DCS_8_BIT_DATA ; + for (short i=0; i<(short)16; i++) { + compareBuffer[(short)(i+1)] = (byte)i ; + } + + result = Util.arrayCompare(compareBuffer, (short)0, dstBuffer17, (short)0, (short)17) ; + + bRes = (result == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successful call + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + + for (short i=0; i<(short)20; i++) { + dstBuffer20[i] = (byte)0x55 ; + } + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)2 ; + dstOffset = (short)3; + dstLength = (short)12 ; + + result = proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer20, dstOffset, dstLength) ; + + bRes = (result == (short)15) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Compare buffer + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + + // Initialise compare buffer + for (short i=0; i<(short)20; i++) { + compareBuffer[i] = (byte)0x55 ; + } + for (short i=3; i<(short)15; i++) { + compareBuffer[i] = (byte)(i-2) ; + } + + result = Util.arrayCompare(compareBuffer, (short)0, dstBuffer20, (short)0, (short)20) ; + + bRes = (result == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Successful call with 2 Text String TLV + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)0; + dstLength = (short)17 ; + + result = proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer17, dstOffset, dstLength) ; + + bRes = (result == (short)17) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Compare buffer + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + + // Initialise compare buffer + compareBuffer[0] = DCS_8_BIT_DATA ; + for (short i=0; i<(short)16; i++) { + compareBuffer[(short)(i+1)] = (byte)i ; + } + + result = Util.arrayCompare(compareBuffer, (short)0, dstBuffer17, (short)0, (short)17) ; + + bRes = (result == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : Successful call with 2 Text String TLV + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + + tag = TAG_TEXT_STRING ; + occurence = (byte)2 ; + valueOffset = (short)0 ; + dstOffset = (short)0; + dstLength = (short)6 ; + + result = proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer17, dstOffset, dstLength) ; + + bRes = (result == (short)6) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 19 : Compare buffer + testCaseNb = (byte) 19 ; + bRes = false ; + + try { + + compareBuffer[0] = (byte) 0x00 ; + compareBuffer[1] = (byte) 0x11 ; + compareBuffer[2] = (byte) 0x22 ; + compareBuffer[3] = (byte) 0x33 ; + compareBuffer[4] = (byte) 0x44 ; + compareBuffer[5] = (byte) 0x55 ; + + result = Util.arrayCompare(compareBuffer, (short)0, dstBuffer17, (short)0, (short)6) ; + + bRes = (result == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + // -------------------------------------------- + // Test Case 20 : Successful call, tag = 8Dh + testCaseNb = (byte) 20 ; + bRes = false ; + + try { + + // Send a GET INPUT command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + tag = (byte)0x8D ; + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)0; + dstLength = (short)17 ; + + result = proRespHdlr.findAndCopyValue(tag, occurence, valueOffset, dstBuffer17, dstOffset, dstLength) ; + + bRes = (result == (short)17) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 21 : Compare buffer + testCaseNb = (byte) 21 ; + bRes = false ; + + // Initialise compareBuffer + compareBuffer[0] = DCS_8_BIT_DATA ; + for (short i=1; i z&e{9UyZ3$HJwNxocW!kh&M+o^tfQH+ZJ`(!?qG@ASP?zp{Jg!bRP;Z`wbSGReU!XREIr z{ode5-dWxZ_sc`lj?G(k!j;VPA6J%7dj8G9ski>v?o%^P^d8@IV&{f=ufB1%CGeZ< z#NMaQzZQ7>NF(2}TAAFxCh)T#ESPY(_00FB)@=jtX6_wYJ9++zS+4V)KVM|LS@VaX zre1m1#Hyx4FPTL5_3}CVp7b*Qlj@Uyczq5Vc&dHb7?z^7& zyQ-}#-+Xap(aT-eHa&9A^~+!P&puS{9nT+3`rsD_|GN9?H^19)F7TKBEX(VGw(3er z-aPKv6Ke^;Wgeg!V`vOUPK)7N7m7UTsA*D&vZ~qZ&GR>O`1Aa2Z7s{2{dsl1=Guw1 zzV@ct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i3t320IO*cCzY+!k3Jo+4L)M5SV~`;#yTCqwbz{Vh%)$)F)taR_mvTq^2F1IkaZeFo)qQHNiK zhBAsK%7U^Gc*+fGs!%jii?Q8+@*v7H*#9&3pTYKDprN(m5ZZ)tlBlC+qO8DnJ<46! zK8o@uF^cX04Py|an6aQ?1w#$+26`zNRI48MC7?B=tbi~Rtj`hfvV*YE@+Ec#!cgBH|17i zudim<2|JnP(BHsz&WsZqT#}J-pc$Ux>e*0rROl$8o*c z*Qcj6{)GRt*+RbuJU#8|lP9zXPoL`APIX~X&<2Hdjr8_5vX6sY=^qG-PoDiW6yukK zu|WmGX&#%$Y0q>zN_;Vj$I$ek_;Vy&Zd$et-$@9LBiB(l*=0u_SE&>SL-5wkUmw93 zA7NPfNi|EUm?6CM)cKxroo7tg!!wbn!!yQ*>XHuc)8~C-yX#TDe(4EmDqdN*Sf(Gt zt714-=r?3gOlXV*LwK|{)M)TMVze;^#9;jS+g`#iJi89 z(=||!7ct(4nDEk7l$XbgCLHGzY3X((5Z`%6QZ)9_A`Mlr8j|1%Yyk;@7QA|5q&nVJ z7a@Z#2I&?b0I?8{7!HZ3I|`8`xQP-bE>!Ooxv= sLength) + { + bRes = true; + } + else + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/Test_Api_2_Prh_Gcap.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/Test_Api_2_Prh_Gcap.java new file mode 100644 index 0000000..af1ac35 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/Test_Api_2_Prh_Gcap.java @@ -0,0 +1,109 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Gcap.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gcap; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gcap + * + * @version 0.0.1 - 27 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gcap extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gcap"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gcap() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 3 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "03CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/applet.opt new file mode 100644 index 0000000..c442c25 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gcap.Api_2_Prh_Gcap_1 +uicc.test.toolkit.api_2_prh_gcap +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/javacard/api_2_prh_gcap.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcap/javacard/api_2_prh_gcap.cap new file mode 100644 index 0000000000000000000000000000000000000000..c5af320bad9458a7b8f4133173641cd48910100b GIT binary patch literal 3066 zcmb7_drVVT9LIm>zWM}9tys%=h{ySW#yMYXQ{x=$cN?yu)_ z&hK~5?`JKc85M}}dalkq37%*wV8BvTS}@)`r&wnxm}4$3nqR856!)J32+p&(0=eoV z9d}dfdgD**|9R(O{Z85G-Y;_xwsTEYrHkLw{P|#9O?F!0fnUyA`wqQ!`MUk6GU3;< zFD7ff8#7glWu0rs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zAwZa|!+;$z0m8XkNDwBnFyRIp%Mt`>O^6ZZvM|Pil{0!z2{M}yBg|D{%=a;2A~Tn@ SgvEaY$neTVzwZ_CZ+`)ysy-k9 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/Api_2_Prh_Gcid_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/Api_2_Prh_Gcid_1.java new file mode 100644 index 0000000..eead202 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/Api_2_Prh_Gcid_1.java @@ -0,0 +1,223 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Gcid_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gcid; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gcid + * + * @version 0.0.1 - 27 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Gcid_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private final byte[] ADDRESS = {(byte)0x91, (byte)0x11, (byte)0x22, (byte)0x33, (byte)0x44} ; + private final byte[] BEARER_DESC = {(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00}; + private final byte textBuffer[] = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'}; + + private static final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Gcid_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Gcid_1 thisApplet = new Api_2_Prh_Gcid_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Miscelaneous + byte bChannelNb; + + // Get the system instance of handlers + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler(); + ProactiveResponseHandler proRespHdlr = null ; + + // Send a Display Text proactive command and get the handler + // init Display Text command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, textBuffer, (short)0, (short)textBuffer.length); + // send proactive command + proHdlr.send(); + + // Get the proactive response handler + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler(); + + // Test Case 1 : getChannelIdentifier(), Channel status TLV is not present + // ----------------------------------------------------------------------- + testCaseNb = (byte) 1 ; + bRes = false ; + try { + proRespHdlr.getChannelIdentifier(); + bRes = false ; + } + catch (ToolkitException e){ + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) + { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // Test Case 2 : getChannelIdentifier(), Channel status TLV with a length equal to 0 + // --------------------------------------------------------------------------------- + testCaseNb = (byte) 2 ; + bRes = false ; + // build an open channel command + proHdlr.init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + proHdlr.appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + // Send the command + proHdlr.send(); + + // Get the proactive response handler + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler(); + // Get the Channel Id + try { + proRespHdlr.getChannelIdentifier(); + bRes = false ; + } + catch (ToolkitException e){ + if (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES ) + { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // Test Case 3 : getChannelIdentifier(), normal test + // ------------------------------------------------- + testCaseNb = (byte) 3 ; + bRes = false ; + // build an open channel command + proHdlr.init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + proHdlr.appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + // Send the command + proHdlr.send(); + + // Get the proactive response handler + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler(); + // Get the Channel Id + try { + if (proRespHdlr.getChannelIdentifier() == 0x01) + { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + // build an close channel command + proHdlr.initCloseChannel((byte)0x01); + // Send the command + proHdlr.send(); + reportTestOutcome(testCaseNb, bRes) ; + + // Test Case 4 : getChannelIdentifier(), with 2 TLV channel id + // ----------------------------------------------------------- + testCaseNb = (byte) 4 ; + bRes = false ; + // build an open channel command + proHdlr.init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + proHdlr.appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + // Send the command + proHdlr.send(); + + // Get the proactive response handler + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler(); + // Get the Channel Id + try { + if (proRespHdlr.getChannelIdentifier() == 0x01) + { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + // build an close channel command + proHdlr.initCloseChannel((byte)0x01); + // Send the command + proHdlr.send(); + reportTestOutcome(testCaseNb, bRes) ; + + // Test Case 5 : getChannelIdentifier(), Channel status TLV is currently selected TLV + // ---------------------------------------------------------------------------------- + testCaseNb = (byte) 5 ; + bRes = false ; + // build an open channel command + proHdlr.init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + proHdlr.appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + // Send the command + proHdlr.send(); + + // Get the proactive response handler + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler(); + // check the currently selected TLV + try { + proRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte) 0x01); + if ((proRespHdlr.getChannelIdentifier() == (byte) 0x03) && + (proRespHdlr.getChannelIdentifier() == proRespHdlr.getValueByte((byte)0x00))) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/Test_Api_2_Prh_Gcid.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/Test_Api_2_Prh_Gcid.java new file mode 100644 index 0000000..b2d3740 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/Test_Api_2_Prh_Gcid.java @@ -0,0 +1,182 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Gcid.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gcid; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gcid + * + * @version 0.0.1 - 27 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gcid extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gcid"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gcid() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch Display Text + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Open channel proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Terminal response with channel status TLV length set to 00 + response = test.terminalResponse("81030140 01820282 81030220 00380035" + + "04010000 00390200 80"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + + // Open channel proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Terminal response OK on channel 01 + response = test.terminalResponse("81030140 01820282 81030100 38028100" + + "35040100 00003902 0080"); + result &= response.checkSw("910B"); + + // Close channel proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028121"); + + // Terminal response OK + response = test.terminalResponse("81030141 00820282 81030100"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Open channel proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Terminal response with 2 Channel Id TLV + response = test.terminalResponse("81030140 01820282 81030100 38028100" + + "38028200 35040100 00003902 0080"); + result &= response.checkSw("910B"); + + // Close channel proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028121"); + + // Terminal response OK + response = test.terminalResponse("81030141 00820282 81030100"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 5 */ + /*********************************************************************/ + + // Open channel proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Terminal response + response = test.terminalResponse("81030140 01820282 81030100 38020305" + + "35040100 00003902 0080"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/applet.opt new file mode 100644 index 0000000..931c720 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gcid.Api_2_Prh_Gcid_1 +uicc.test.toolkit.api_2_prh_gcid +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/javacard/api_2_prh_gcid.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcid/javacard/api_2_prh_gcid.cap new file mode 100644 index 0000000000000000000000000000000000000000..75a72c3cc9f30595cd80ce935aed30eb8b743b62 GIT binary patch literal 3688 zcmc(h3rtg27{|YJU%j+YZcD{NWg;5{k+oWR6tRm4qKIgx5OuO>Ep;GBYg>G0DrD8kej(jjzqeHl2xc51onGqRy#HG+9&xH%*9xeYXO&*O}17Was9e``vTy zJ-_pP_dGsJDa~kr$E&olBpaS68epJoLV3Z8`^k9dHT?wyN-|ArTG5JnUP1Exu)9kc{>yTc{rjzBf0SK?F*L9V=J!SvYk|` z?pJ=3t9Nfn)67$BUHxL-jIq9@mv2lwcanU`&g{-0ajLUfzu#;!xUZ#s+^{HdSH}-(HPEf_Mt`shPV zTTG#5k>!r|g%e%n?XsN3pBWC?ENwTsmTkRQ(vtnl0d=GC_4R8@<%ty)tLtL@r+q`s zDe-#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SourceCode/uicc/test/toolkit/api_2_prh_gcst/Api_2_Prh_Gcst_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/Api_2_Prh_Gcst_1.java new file mode 100644 index 0000000..0f37a5a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/Api_2_Prh_Gcst_1.java @@ -0,0 +1,281 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Gcst_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gcst; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gcst + * + * @version 0.0.1 - 27 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Gcst_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + private byte[] ADDRESS = {(byte)0x91, (byte)0x11, (byte)0x22, (byte)0x33, (byte)0x44} ; + private byte[] BEARER_DESC = {(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00}; + private byte[] menuEntry = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)' ',(byte)'1'}; + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + + public final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Gcst_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Gcst_1 thisApplet = new Api_2_Prh_Gcst_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Miscelaneous + short ChannelStatusValue; + + // Get the system instance of handlers + ProactiveResponseHandler ProRespHdlr = ProactiveResponseHandlerSystem.getTheHandler(); + + // ---------------------------------------------------------------- + // Test Case 1 : Get channel Status TLV is not present + testCaseNb = (byte)1; + bRes = false ; + try { + (ProactiveHandlerSystem.getTheHandler()).initDisplayText((byte)00,DCS_8_BIT_DATA,TEXT,(short)0,(short)TEXT.length); + (ProactiveHandlerSystem.getTheHandler()).send(); + try{ + ProRespHdlr.getChannelStatus((byte)0x01); + bRes = false; + } + catch(ToolkitException e) + { + if(e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true; + } + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------------------------------- + // Test Case 2 : Channel status TLV with the identifier is not present + testCaseNb = (byte)2; + bRes = false; + + // Send an OPEN CHANNEL proactive command + (ProactiveHandlerSystem.getTheHandler()).init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + (ProactiveHandlerSystem.getTheHandler()).send() ; + + try{ + ProRespHdlr.getChannelStatus((byte)0x02); + } + catch(ToolkitException e){ + if(e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + // Send a CLOSE CHANNEL proactive command + (ProactiveHandlerSystem.getTheHandler()).initCloseChannel((byte)0x01); + (ProactiveHandlerSystem.getTheHandler()).send(); + + reportTestOutcome(testCaseNb, bRes) ; + + // ------------------------------------------------------ + // Test Case 3 : Channel status TLV with length set to 0. + testCaseNb = (byte)3; + bRes = false; + + // Send an OPEN CHANNEL proactive command + (ProactiveHandlerSystem.getTheHandler()).init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + (ProactiveHandlerSystem.getTheHandler()).send() ; + + try{ + ProRespHdlr.getChannelStatus((byte)0x01); + } + catch(ToolkitException e){ + if(e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes) ; + + // ------------------------------------------------------ + // Test Case 4 : Channel status TLV with length set to 1. + testCaseNb = (byte)4; + bRes = false; + + // Send an OPEN CHANNEL proactive command + (ProactiveHandlerSystem.getTheHandler()).init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + (ProactiveHandlerSystem.getTheHandler()).send() ; + + try{ + ProRespHdlr.getChannelStatus((byte)0x01); + } + catch(ToolkitException e){ + if(e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes) ; + + // ------------------------------------------------------ + // Test Case 5 : Get channel status value + testCaseNb = (byte)5; + bRes = false; + + // Send an OPEN CHANNEL proactive command + (ProactiveHandlerSystem.getTheHandler()).init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + (ProactiveHandlerSystem.getTheHandler()).send() ; + + try{ + ChannelStatusValue = ProRespHdlr.getChannelStatus((byte)0x01); + bRes = (ChannelStatusValue == (short)0x8100); + } + catch (Exception e) + { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes) ; + + // ------------------------------------------------------ + // Test Case 6 : Get channel status value with 2 TLVs + testCaseNb = (byte)6; + bRes = false; + + // Send an GET_CHANNEL_STATUS proactive command + (ProactiveHandlerSystem.getTheHandler()).init(PRO_CMD_GET_CHANNEL_STATUS, (byte)0x00, DEV_ID_TERMINAL); + (ProactiveHandlerSystem.getTheHandler()).send() ; + + try{ + ChannelStatusValue = ProRespHdlr.getChannelStatus((byte)0x01); + bRes = (ChannelStatusValue == (short)0x8100); + } + catch (Exception e) + { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes) ; + + // ------------------------------------------------------ + // Test Case 7 : Get channel status value with 2 TLVs + testCaseNb = (byte)7; + bRes = false; + + // Send an GET_CHANNEL_STATUS proactive command + (ProactiveHandlerSystem.getTheHandler()).init(PRO_CMD_GET_CHANNEL_STATUS, (byte)0x00, DEV_ID_TERMINAL); + (ProactiveHandlerSystem.getTheHandler()).send() ; + + try{ + ChannelStatusValue = ProRespHdlr.getChannelStatus((byte)0x01); + bRes = (ChannelStatusValue == (short)0x8100); + } + catch (Exception e) + { + bRes = false; + } + + // Send a CLOSE CHANNEL proactive command + (ProactiveHandlerSystem.getTheHandler()).initCloseChannel((byte)0x01); + (ProactiveHandlerSystem.getTheHandler()).send(); + + reportTestOutcome(testCaseNb, bRes) ; + + // --------------------------------------------------------------- + // Test Case 8 : Channel Status TLV is the currently selected TLV + testCaseNb = (byte)8; + bRes = false; + + // Send an OPEN CHANNEL proactive command + (ProactiveHandlerSystem.getTheHandler()).init(PRO_CMD_OPEN_CHANNEL, (byte)0x01, DEV_ID_TERMINAL); + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_ADDRESS, ADDRESS, (short)0x00, (short)ADDRESS.length); + // CSD Bearer Description + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BEARER_DESCRIPTION, BEARER_DESC, (short)0x00, (short)BEARER_DESC.length); + // Buffer size + (ProactiveHandlerSystem.getTheHandler()).appendTLV(TAG_BUFFER_SIZE, (byte)0x00, (byte)0x80); + (ProactiveHandlerSystem.getTheHandler()).send() ; + + try{ + // Select the device identities TLV + ProRespHdlr.findTLV(TAG_DEVICE_IDENTITIES,(byte)0x01); + ChannelStatusValue = ProRespHdlr.getChannelStatus((byte)0x03); + bRes = (ChannelStatusValue == (short)0x8304); + bRes &= (ChannelStatusValue == ProRespHdlr.getValueShort((short)0)); + } + catch (Exception e) + { + bRes = false; + } + + // Send a CLOSE CHANNEL proactive command + (ProactiveHandlerSystem.getTheHandler()).initCloseChannel((byte)0x03); + (ProactiveHandlerSystem.getTheHandler()).send(); + + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/Test_Api_2_Prh_Gcst.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/Test_Api_2_Prh_Gcst.java new file mode 100644 index 0000000..e3c285e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/Test_Api_2_Prh_Gcst.java @@ -0,0 +1,231 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Gcst.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gcst; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gcst + * + * @version 0.0.1 - 27 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gcst extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gcst"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gcst() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the DISPLAY TEXT proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no CHANNEL STATUS TLV + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Fetch the OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Successful terminal response with channel status value set to 0x8100 + response = test.terminalResponse("81030140 01820282 81830100 38028100" + + "35020300 3902000A"); + result &= response.checkSw("910B"); + + // Fetch the CLOSE CHANNEL proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028121"); + + // Successful terminal response + response = test.terminalResponse("81030141 00820282 81830100"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + + // Fetch the OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Unsuccessful terminal response with channel status TLV length set to 0 + response = test.terminalResponse("81030140 01820282 81830130 38003502" + + "03003902 000A"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Fetch the OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Unsuccessful terminal response with channel status TLV length set to 1 + response = test.terminalResponse("81030140 01820282 81830130 38018135" + + "02030039 02000A"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 5 */ + /*********************************************************************/ + + // Fetch the OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Successful terminal response with channel status TLV value set to 0x8100 + response = test.terminalResponse("81030140 01820282 81830100 38028100" + + "35020300 3902000A"); + result &= response.checkSw("910B"); + + /*********************************************************************/ + /** Testcase 6 */ + /*********************************************************************/ + + // Fetch the GET CHANNEL STATUS proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01440082 028182"); + + // Successful terminal response with 2 channel status TLVs + response = test.terminalResponse("81030144 01820282 81830100 38028100" + + "38028101 35020300 3902000A"); + result &= response.checkSw("910B"); + + /*********************************************************************/ + /** Testcase 7 */ + /*********************************************************************/ + + // Fetch the GET CHANNEL STATUS proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01440082 028182"); + + // Successful terminal response with 2 channel status TLVs + response = test.terminalResponse("81030144 01820282 81830100 38028200" + + "38028100 35020300 3902000A"); + result &= response.checkSw("910B"); + + // Fetch the CLOSE CHANNEL proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028121"); + + // Successful terminal response + response = test.terminalResponse("81030141 00820282 81830100"); + result &= response.checkSw("911C"); + + /*********************************************************************/ + /** Testcase 8 */ + /*********************************************************************/ + + // Fetch the OPEN CHANNEL proactive command + response = test.fetch("1C"); + result &= response.checkData("D01A8103 01400182 02818206 05911122" + + "33443504 01000000 39020080"); + + // Successful terminal response with 1 channel status TLVs + response = test.terminalResponse("81030140 01820282 81830100 38028304" + + "35020300 3902000A"); + result &= response.checkSw("910B"); + + // Fetch the CLOSE CHANNEL proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028123"); + + // Successful terminal response + response = test.terminalResponse("81030141 00820282 81830100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "08CCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/applet.opt new file mode 100644 index 0000000..ca79892 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gcst.Api_2_Prh_Gcst_1 +uicc.test.toolkit.api_2_prh_gcst +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/javacard/api_2_prh_gcst.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gcst/javacard/api_2_prh_gcst.cap new file mode 100644 index 0000000000000000000000000000000000000000..557a299d6e356fe02eca74d6d1c44545207ff1ba GIT binary patch literal 4203 zcmb_f4Qx}_6+ZXf`+ocr=h-;169a{+lt`qG6JWS89%KojAq1rjEL{s_#_<|AAvU(d ze^$q&3ne5J225I4mQtaCilKdJnq(M?67>V(=3Y3=AXmF(R7_{DGS z7E9cx&+ndl?>XPS=U$(CUSmCFc2MwHzO`;XOel6>(6D4>)qQmL-2sp?&6+=&ToZUA(!mdEsZJQxChM1;?8_AMUmP z)7{*DfR^!J6{U@Jr_Wuwu`4k&FWqzA z?wUTg?n2$FGxxsLJLP=K(mm~_X0pxTFdhB)_?da^z4gM+SDrfi*rJCYf9lDbPn|n? zwxyg*`Ka8v;E(S3@8%2@l?gxIWnZ||IB31lmFj)-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1ySflw@PBgmctf$dOHI2q)%4Id#F|M(me>?z~@bRGEXYqIh{{f(&^vnPN literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/Api_2_Prh_Glen_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/Api_2_Prh_Glen_1.java new file mode 100644 index 0000000..6ea8924 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/Api_2_Prh_Glen_1.java @@ -0,0 +1,120 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Glen_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_glen; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_glen + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Glen_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + public final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Glen_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Glen_1 thisApplet = new Api_2_Prh_Glen_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // Response handler + ProactiveResponseHandler proRespHdlr ; + + // -------------------------------------------- + // Test Case 1 : length = 12 + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify length of the response + bRes = (proRespHdlr.getLength() == (short)12) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : length = FFh + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify length of the response + bRes = (proRespHdlr.getLength() == (short)0xFF) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/Test_Api_2_Prh_Glen.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/Test_Api_2_Prh_Glen.java new file mode 100644 index 0000000..1dcc940 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/Test_Api_2_Prh_Glen.java @@ -0,0 +1,139 @@ +//----------------------------------------------------------------------------- +//Test_Api_Prh_Glen.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_glen; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_glen + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Glen extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_glen"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Glen() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the DISPLAY TEXT proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no additional information + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response (F2h additional bytes) + response = test.terminalResponse("81030121 00020282 810381F3 01000102" + + "03040506 0708090A 0B0C0D0E 0F101112" + + "13141516 1718191A 1B1C1D1E 1F202122" + + "23242526 2728292A 2B2C2D2E 2F303132" + + "33343536 3738393A 3B3C3D3E 3F404142" + + "43444546 4748494A 4B4C4D4E 4F505152" + + "53545556 5758595A 5B5C5D5E 5F606162" + + "63646566 6768696A 6B6C6D6E 6F707172" + + "73747576 7778797A 7B7C7D7E 7F808182" + + "83848586 8788898A 8B8C8D8E 8F909192" + + "93949596 9798999A 9B9C9D9E 9FA0A1A2" + + "A3A4A5A6 A7A8A9AA ABACADAE AFB0B1B2" + + "B3B4B5B6 B7B8B9BA BBBCBDBE BFC0C1C2" + + "C3C4C5C6 C7C8C9CA CBCCCDCE CFD0D1D2" + + "D3D4D5D6 D7D8D9DA DBDCDDDE DFE0E1E2" + + "E3E4E5E6 E7E8E9EA EBECEDEE EFF0F1"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "02CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/applet.opt new file mode 100644 index 0000000..d008ee5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_glen.Api_2_Prh_Glen_1 +uicc.test.toolkit.api_2_prh_glen +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/javacard/api_2_prh_glen.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_glen/javacard/api_2_prh_glen.cap new file mode 100644 index 0000000000000000000000000000000000000000..93eb1b6f290989d687386338c6a1a43e179291d9 GIT binary patch literal 3045 zcmb7_e^69a6vxkd_r3kWg6`si3y6p#%9yh5YJ$RM$d5o=Ta~md!gX0;VclJKw?+VyHksKl<94p2J@;iZyZ6oa-Fx4C z?|$w*=e~1HMTAp>3@>AK;nVO~Q3D6YyyEQ1h4b>Y#_V~8`FRVA(~SA|djL8XlssQM zMZIpqDrT##c&Mw3+fl+c=XUO0GVoOAx3lhjc}bD>V!??s)pzy{9z8hfLXYd@Y2OVS zyNk$sxu26yT9!5V41dO+$gS|s`9`<6?aYOHJs0lH=xaN5wCwrTXxkb#HI8>bB1LY5)2~*LNHob$oHd-}^s&BcpZSnTyP2GP*^z*fa3! zo5Rix-QMXMSiAD;+JWYr5eKT0Ohr=JZ+9y{Sj7PJasVduUc>{RQSaS97RXG*9@R9| zYc`8T>$Q5kTCdY-ud;cyW|ys0U+QvKl$P7A4sE6Rb+g6nF4GoR&1F`1n#Js5ApTNM zV31)sV3e&mi5&OJCTgVr&Q^v&~dpox7Ffxx>r*o3rP@ZMEqYSHc(U|?qO{v6tdAD=-8Rd}Gn6)vay z0f>W4u_15cbSxun#cCOY*dQxM<5PGz2u$#L^zU!mmxsetGf|=2JICqpc+C#436BBY zK97c0vH%3dpn&yZ18WI@iuiy<$t3idUk*$y3lje@Z1Y&Fu$BOh%Yzr^*smIj!x^Zi zqQY35-R$wuRY@Q=$A|uABIr^|YFO~gmH)B1ck#1nCdEI8< z4E4aLC1?`4Y)xWH9Y_-DK$=iX*ajB=m}*H1(Qg7pD#z)GE`}r04u*6v?>0yvGA@Q| zU?5VHxe20D`4}EM!$28X#d9t~bS_z{1n;aSX>=V7=R^Bi1%W4iULEYBseqZC{+e3^v&g3Jr=jkh2e;D6;Mw@0T9f7 zq=xm&@cgN8J|Ce!3IpTtj=u{_up&MJH8?sECSVU3IsTTDAepxD2$x{*EugO}(H!GY z;{ySFcM@tM4XL0-O+}?MQpCGTM$JvF-9E11WY!j$IvY$3TR@CIA95w&%?q5hc8nRk6!~Q@S1{lZ;{g8Kjj@k AR{#J2 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/Api_2_Prh_Gtcs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/Api_2_Prh_Gtcs_1.java new file mode 100644 index 0000000..13b88e2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/Api_2_Prh_Gtcs_1.java @@ -0,0 +1,406 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Gtcs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gtcs; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gtcs + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Gtcs_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + public final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Gtcs_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Gtcs_1 thisApplet = new Api_2_Prh_Gtcs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + ProactiveResponseHandler proRespHdlr = null ; + + short result = (short) 0 ; + + // -------------------------------------------- + // Test Case 1 : Unavailable Text String TLV + + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + // getTextStringCodingScheme() with unavailable Text String TLV + result = proRespHdlr.getTextStringCodingScheme() ; + + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true ; + } + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Null Text String TLV + + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + // getTextStringCodingScheme() with null Text String TLV + result = proRespHdlr.getTextStringCodingScheme() ; + + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) { + bRes = true ; + } + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Successfull call + + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringCodingScheme() ; + + bRes = (result == (short)0x04) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Verify the TLV selected + + testCaseNb = (byte) 4 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x02) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Successfull call + + testCaseNb = (byte) 5 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringCodingScheme() ; + + bRes = (result == (short)0x00) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Verify the TLV selected + + testCaseNb = (byte) 6 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x03) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successfull call + + testCaseNb = (byte) 7 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringCodingScheme() ; + + bRes = (result == (short)0x08) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Verify the TLV selected + + testCaseNb = (byte) 8 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x7F) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Successfull call + + testCaseNb = (byte) 9 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringCodingScheme() ; + + bRes = (result == (short)0x04) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Verify the TLV selected + + testCaseNb = (byte) 10 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x80) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Successfull call + + testCaseNb = (byte) 11 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringCodingScheme() ; + + bRes = (result == (short)0x08) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Verify the TLV selected + + testCaseNb = (byte) 12 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0xF0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successfull call + // Terminal Response with 2 Text String TLV + + testCaseNb = (byte) 13 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringCodingScheme() ; + + bRes = (result == (short)0x04) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 14 : Verify the TLV selected + + testCaseNb = (byte) 14 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x02) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/Test_Api_2_Prh_Gtcs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/Test_Api_2_Prh_Gtcs.java new file mode 100644 index 0000000..26c3961 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/Test_Api_2_Prh_Gtcs.java @@ -0,0 +1,235 @@ +//----------------------------------------------------------------------------- +//Test_Api_Prh_Gtcs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gtcs; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gtcs + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gtcs extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gtcs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gtcs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no additional information + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string TLV is null) + response = test.terminalResponse("81030123 00020282 81030100 0D00"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 3 & 4 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = 01h) + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 5 & 6 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = 02h) + response = test.terminalResponse("81030123 00020282 81030100 0D030042" + + "42"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 7 & 8 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = 7Eh) + response = test.terminalResponse("81030123 00020282 81030100 0D7F0801" + + "02030405 06070809 0A0B0C0D 0E0F1011" + + "12131415 16171819 1A1B1C1D 1E1F2021" + + "22232425 26272829 2A2B2C2D 2E2F3031" + + "32333435 36373839 3A3B3C3D 3E3F4041" + + "42434445 46474849 4A4B4C4D 4E4F5051" + + "52535455 56575859 5A5B5C5D 5E5F6061" + + "62636465 66676869 6A6B6C6D 6E6F7071" + + "72737475 76777879 7A7B7C7D 7E"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 9 & 10 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = 7Fh) + response = test.terminalResponse("81030123 00020282 81030100 0D818004" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 11 & 12 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = EFh) + response = test.terminalResponse("81030123 00020282 81030100 0D81F008" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F80" + + "81828384 85868788 898A8B8C 8D8E8F90" + + "91929394 95969798 999A9B9C 9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAABAC ADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABBBC BDBEBFC0" + + "C1C2C3C4 C5C6C7C8 C9CACBCC CDCECFD0" + + "D1D2D3D4 D5D6D7D8 D9DADBDC DDDEDFE0" + + "E1E2E3E4 E5E6E7E8 E9EAEBEC EDEEEF"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 13 & 14 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (2 Text string TLVs) + response = test.terminalResponse("81030123 00020282 81030100 0D020441" + + "0D030842 43"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0ECCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/applet.opt new file mode 100644 index 0000000..5ffb6f0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gtcs.Api_2_Prh_Gtcs_1 +uicc.test.toolkit.api_2_prh_gtcs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/javacard/api_2_prh_gtcs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtcs/javacard/api_2_prh_gtcs.cap new file mode 100644 index 0000000000000000000000000000000000000000..60d1635fe2ce4f0dcfe830b8ab9df1595cfc797d GIT binary patch literal 4111 zcmb7GeNa?Y6hHUf_jVtJ^lK( z+tMKeA~{9*QknF;e7Y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test/toolkit/api_2_prh_gtii/Api_2_Prh_Gtii_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/Api_2_Prh_Gtii_1.java new file mode 100644 index 0000000..eec56ec --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/Api_2_Prh_Gtii_1.java @@ -0,0 +1,349 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Gtii_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gtii; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gtii + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Gtii_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + + private byte[] ITEM1 = {(byte)'I',(byte)'t',(byte)'e',(byte)'m',(byte)'1'} ; + private byte[] ITEM2 = {(byte)'I',(byte)'t',(byte)'e',(byte)'m',(byte)'2'} ; + private byte[] ITEM3 = {(byte)'I',(byte)'t',(byte)'e',(byte)'m',(byte)'3'} ; + private byte[] ITEM5 = {(byte)'I',(byte)'t',(byte)'e',(byte)'m',(byte)'5'} ; + private byte[] ITEM7 = {(byte)'I',(byte)'t',(byte)'e',(byte)'m',(byte)'7'} ; + private byte[] ITEMFD = {(byte)'I',(byte)'t',(byte)'e',(byte)'m',(byte)'D'} ; + private byte[] ITEMFE = {(byte)'I',(byte)'t',(byte)'e',(byte)'m',(byte)'E'} ; + private byte[] ITEMFF = {(byte)'I',(byte)'t',(byte)'e',(byte)'m',(byte)'F'} ; + + private static final byte ITEM1_ID = (byte) 1 ; + private static final byte ITEM2_ID = (byte) 2 ; + private static final byte ITEM3_ID = (byte) 3 ; + private static final byte ITEM5_ID = (byte) 5 ; + private static final byte ITEM7_ID = (byte) 7 ; + private static final byte ITEMFD_ID = (byte) 0xFD ; + private static final byte ITEMFE_ID = (byte) 0xFE ; + private static final byte ITEMFF_ID = (byte) 0xFF ; + + private static final byte TAG_ITEM_CR = (byte)(TAG_ITEM | TAG_SET_CR) ; + public final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Gtii_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Gtii_1 thisApplet = new Api_2_Prh_Gtii_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + ProactiveResponseHandler proRespHdlr = null ; + + short result = (short) 0 ; + + // -------------------------------------------- + // Test Case 1 : Unavailable Item Identifier TLV + + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + // getItemIdentifier() with unavailable Item Identifier TLV + result = proRespHdlr.getItemIdentifier() ; + + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true ; + } + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Successfull call + + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + + // Build and send a SELECT ITEM proactive command + proHdlr.init(PRO_CMD_SELECT_ITEM, (byte)0, DEV_ID_TERMINAL) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEM1_ID, ITEM1, (short)0, (short)ITEM1.length) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEM2_ID, ITEM2, (short)0, (short)ITEM2.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getItemIdentifier() ; + + bRes = (result == ITEM1_ID) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Verify the TLV selected + + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + + // Get 1st byte of the current TLV + result = proRespHdlr.getValueByte((short)0x00) ; + + bRes = (result == ITEM1_ID) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Successfull call + + testCaseNb = (byte) 4 ; + + bRes = false ; + try { + + // Build and send a SELECT ITEM proactive command + proHdlr.init(PRO_CMD_SELECT_ITEM, (byte)0, DEV_ID_TERMINAL) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEM3_ID, ITEM3, (short)0, (short)ITEM3.length) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEM5_ID, ITEM5, (short)0, (short)ITEM5.length) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEM7_ID, ITEM7, (short)0, (short)ITEM7.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getItemIdentifier() ; + + bRes = (result == ITEM5_ID) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Verify the TLV selected + + testCaseNb = (byte) 5 ; + + bRes = false ; + try { + + // Get 1st byte of the current TLV + result = proRespHdlr.getValueByte((short)0x00) ; + + bRes = (result == ITEM5_ID) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Successfull call + + testCaseNb = (byte) 6 ; + + bRes = false ; + try { + + // Build and send a SELECT ITEM proactive command + proHdlr.init(PRO_CMD_SELECT_ITEM, (byte)0, DEV_ID_TERMINAL) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEMFD_ID, ITEMFD, (short)0, (short)ITEMFD.length) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEMFE_ID, ITEMFE, (short)0, (short)ITEMFE.length) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEMFF_ID, ITEMFF, (short)0, (short)ITEMFF.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getItemIdentifier() ; + + bRes = (result == ITEMFF_ID) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Verify the TLV selected + + testCaseNb = (byte) 7 ; + + bRes = false ; + try { + + // Get 1st byte of the current TLV + result = proRespHdlr.getValueByte((short)0x00) ; + + bRes = (result == ITEMFF_ID) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successfull call (Response with 2 Item Identifier TLV) + + testCaseNb = (byte) 8 ; + + bRes = false ; + try { + + // Build and send a SELECT ITEM proactive command + proHdlr.init(PRO_CMD_SELECT_ITEM, (byte)0, DEV_ID_TERMINAL) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEMFD_ID, ITEMFD, (short)0, (short)ITEMFD.length) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEMFE_ID, ITEMFE, (short)0, (short)ITEMFE.length) ; + proHdlr.appendTLV(TAG_ITEM_CR, ITEMFF_ID, ITEMFF, (short)0, (short)ITEMFF.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getItemIdentifier() ; + + bRes = (result == ITEMFF_ID) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Verify the TLV selected + + testCaseNb = (byte) 9 ; + + bRes = false ; + try { + + // Get 1st byte of the current TLV + result = proRespHdlr.getValueByte((short)0x00) ; + + bRes = (result == ITEMFF_ID) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + // -------------------------------------------- + // Test Case 10 : No value in Item Identifier Simple TLV + + testCaseNb = (byte) 10 ; + + bRes = false ; + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + // getItemIdentifier() without item identifier byte + result = proRespHdlr.getItemIdentifier() ; + + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) { + bRes = true ; + } + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/Test_Api_2_Prh_Gtii.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/Test_Api_2_Prh_Gtii.java new file mode 100644 index 0000000..0c04bcd --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/Test_Api_2_Prh_Gtii.java @@ -0,0 +1,181 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Gtii.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gtii; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gtii + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gtii extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gtii"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gtii() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no additional information + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("911B"); + + + /*********************************************************************/ + /** Testcase 2 & 3 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("1B"); + result &= response.checkData("D0198103 01240082 0281828F 06014974" + + "656D318F 06024974 656D32"); + + // Terminal response (SELECT ITEM) + response = test.terminalResponse("81030124 00020282 81030100 100101"); + result &= response.checkSw("9123"); + + /*********************************************************************/ + /** Testcase 4 & 5 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("23"); + result &= response.checkData("D0218103 01240082 0281828F 06034974" + + "656D338F 06054974 656D358F 06074974" + + "656D37"); + + // Terminal response (SELECT ITEM) + response = test.terminalResponse("81030124 00020282 81030100 100105"); + result &= response.checkSw("9123"); + + /*********************************************************************/ + /** Testcase 6 & 7 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("23"); + result &= response.checkData("D0218103 01240082 0281828F 06FD4974" + + "656D448F 06FE4974 656D458F 06FF4974" + + "656D46"); + + // Terminal response (SELECT ITEM) + response = test.terminalResponse("81030124 00020282 81030100 1001FF"); + result &= response.checkSw("9123"); + + /*********************************************************************/ + /** Testcase 8 & 9 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("23"); + result &= response.checkData("D0218103 01240082 0281828F 06FD4974" + + "656D448F 06FE4974 656D458F 06FF4974" + + "656D46"); + + // Terminal response (SELECT ITEM) + response = test.terminalResponse("81030124 00020282 81030100 1001FF10" + + "01FE"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 10 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no item identifier + response = test.terminalResponse("81030121 00020282 81030100 1000"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0ACCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/applet.opt new file mode 100644 index 0000000..9063916 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gtii.Api_2_Prh_Gtii_1 +uicc.test.toolkit.api_2_prh_gtii +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/javacard/api_2_prh_gtii.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtii/javacard/api_2_prh_gtii.cap new file mode 100644 index 0000000000000000000000000000000000000000..f27b1e22ac99e627dfd7fb920af277027e7932a3 GIT binary patch literal 4308 zcmcgveQ;D)6+idg`#yHFAuq`$ELqYJ3IkNg213hY(+K$>Z47}egh^9WSi+Vp3E7uq zVG6doEY?NS1gfBQ03jlF7BaW1*%kqf|+S&=qMUT+Tu7Np1W*W_Jyvy z|9Id0_I{lE?(d#+@1Ap>r=Bu9DEN4`)IALM6gx0zSkzcKt8PiHtD$m9UG1XfjU^4W zw+8`?WnTz{OYP518(MI)^Gnl@-d98*mKXb{*@nf z(R082_)7Pi`!4R9HnVAX_nEytyP&=JZGGy&Z=4$5)b!}hnG?V7)box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?Do${5(GDvqA zoD?;2Fx-Fg>GJ(HBpHkv?CypXL!^dyx2wvAL=7p~29+cmRK{*F*>p9gP(gyp)Dc6b zh8*A1Z9}1kamDs*?U;0r*4Rn^&wHF3yT_{X z=@)rRq8DyE_s5@SqW9&PpOzP19`pwNEwz4Md(=TH7_je_M2>a+BL|M5j3YgcWxl5u z2U?IP(7~Os1yh1Gm;l8JE6isionaLPnPpQOovQFwUi6puGw&HuSPu5@%u%9q?l&UR zhj2A`OjhDW8ZBlvrpQi7lx)tNtSqdH#}#8kz0=B7)#zAOalDn!Cr?Z?!;YQJd4y26U?sRxsdY<9Z>=qc{OK599*4c`T>k=HZ-y zn@4mJ+&rjD;O22%1~(7w3b=W6w}6`;pfx09V3iS~uob*eMT)Qo#6rSQ1I4^;CFBq^ z(n-h;;6zQ_V;&72g@sUsZ&X1Q&l^Wa;j!p%J+_v@6Qqi+0 zkj_zsN>4oz?3f9D@;!2IuFJni63eH3o$ytxu}gWsyg0tfYiP{W4n;FchaGYTl z8aQ=^gv8iPVorSHBtJ-tB%TJF8O#}PoFS8@qeeXcH8YrV*f_(!v>418t(nK1V#ax% z##@y7fmDBzaGD9snPr@Sf0w0B5YIEs3}*ivXZV{X9R`!PHq)40bezV6ULkcwOb**j hV|IaYnkMu*snaAnL{GhlpCstC@F_*R_i@hz{{<3vA*KKT literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/Api_2_Prh_Gtil_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/Api_2_Prh_Gtil_1.java new file mode 100644 index 0000000..199c031 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/Api_2_Prh_Gtil_1.java @@ -0,0 +1,418 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Gtil_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gtil; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gtil + * + * @version 0.0.1 - 23 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Gtil_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + public final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Gtil_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Gtil_1 thisApplet = new Api_2_Prh_Gtil_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // System instance of the ProactiveResponseHandler class + ProactiveResponseHandler proRespHdlr = null ; + + + // -------------------------------------------- + // Test Case 1 : Build and send a DISPLAY TEXT command + // get the result + + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Build the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // Send + proHdlr.send() ; + + // Get the result + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify the additional information length + bRes = (proRespHdlr.getAdditionalInformationLength() == (short)0x0000) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Verify the Result TLV is selected + + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + bRes = (proRespHdlr.getValueLength() == (short) 0x0001) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Build and send a DISPLAY TEXT command + // get the result + + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + // Build the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // Send + proHdlr.send() ; + + // Get the result + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify the additional information length + bRes = (proRespHdlr.getAdditionalInformationLength() == (short)0x0001) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Verify the Result TLV is selected + + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + bRes = (proRespHdlr.getValueLength() == (short) 0x0002) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Build and send a DISPLAY TEXT command + // get the result + + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + // Build the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // Send + proHdlr.send() ; + + // Get the result + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify the additional information length + bRes = (proRespHdlr.getAdditionalInformationLength() == (short)0x007E) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Verify the Result TLV is selected + + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + bRes = (proRespHdlr.getValueLength() == (short) 0x007F) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Build and send a DISPLAY TEXT command + // get the result + + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Build the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // Send + proHdlr.send() ; + + // Get the result + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify the additional information length + bRes = (proRespHdlr.getAdditionalInformationLength() == (short)0x007F) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Verify the Result TLV is selected + + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + bRes = (proRespHdlr.getValueLength() == (short) 0x0080) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Build and send a DISPLAY TEXT command + // get the result + + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + // Build the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // Send + proHdlr.send() ; + + // Get the result + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify the additional information length + bRes = (proRespHdlr.getAdditionalInformationLength() == (short)0x0080) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Verify the Result TLV is selected + + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + bRes = (proRespHdlr.getValueLength() == (short) 0x0081) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Build and send a DISPLAY TEXT command + // get the result + + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + // Build the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // Send + proHdlr.send() ; + + // Get the result + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify the additional information length + bRes = (proRespHdlr.getAdditionalInformationLength() == (short)0x00F2) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Verify the Result TLV is selected + + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + + bRes = (proRespHdlr.getValueLength() == (short) 0x00F3) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Build and send a DISPLAY TEXT command + // get the result (with 2 Result TLV) + + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + + // Build the command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // Send + proHdlr.send() ; + + // Get the result + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Verify the additional information length + bRes = (proRespHdlr.getAdditionalInformationLength() == (short)0x0002) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Verify the Result TLV is selected + + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + + bRes = (proRespHdlr.getValueLength() == (short) 0x0003) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : ToolkitException.UNAVAILABLE_ELEMENT is thrown if there is no + // General Result TLV in Terminal Response + + testCaseNb = 15 ; + bRes = false ; + + try { + + // Build a DISPLAY TEXT command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + // Send the command (no General Result TLV in Response) + try { + proHdlr.send() ; + } + catch (ToolkitException e) {} + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Get Additional Information length + try { + + proRespHdlr.getAdditionalInformationLength() ; + + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true ; + } + + } + + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/Test_Api_2_Prh_Gtil.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/Test_Api_2_Prh_Gtil.java new file mode 100644 index 0000000..bd7a785 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/Test_Api_2_Prh_Gtil.java @@ -0,0 +1,243 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Gtil.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gtil; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gtil + * + * @version 0.0.1 - 23 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gtil extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gtil"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gtil() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 & 2 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no additional information + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9112"); + + + /*********************************************************************/ + /** Testcase 3 & 4 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 1 additional byte + response = test.terminalResponse("81030121 00020282 81030202 55"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 5 & 6 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 7Eh additional bytes + response = test.terminalResponse("81030121 00020282 81037F02 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 5555"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 7 & 8 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 7Fh additional bytes + response = test.terminalResponse("81030121 00020282 81038180 02555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 9 & 10 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 80h additional bytes + response = test.terminalResponse("81030121 00020282 81038181 02555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 11 & 12 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with F2h additional bytes + response = test.terminalResponse("81030121 00020282 810381F3 02555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 55555555" + + "55555555 55555555 55555555 555555"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 13 & 14 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with 2 result TLVs + response = test.terminalResponse("81030121 00020282 81030302 01230301" + + "00"); + result &= response.checkSw("9112"); + + /*********************************************************************/ + /** Testcase 15 */ + /*********************************************************************/ + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no result TLV + response = test.terminalResponse("81030121 00020282 81"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0FCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/applet.opt new file mode 100644 index 0000000..b84f89d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gtil.Api_2_Prh_Gtil_1 +uicc.test.toolkit.api_2_prh_gtil +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gtil/javacard/api_2_prh_gtil.cap b/source/Annex_E_SourceCode/uicc/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GBH2_! za6f&$GP>!38wp)~UN%NY9ft^_S7wspU!Y>~GQc;AA1Z>*4_b6%q>eT%OBz-w!* zyK~*W*RJ&biMtE`KRK^!?(Sf>f(``l5-Q&Y@!IxkX_jex%foTS3jPhT6( zMn=+nI+GUAIn<2TYzjFFrL6Eqwg;9(V6e?gnM8hDg0Z~B{#6myu9+Q6?jAOdoZG&MT7!grjUHEM*B3d*hSW7@8 zB9dV&i6xC(Vc$(e%N~lu8xvv5u?4&t zE-A`!oB-b^P_kcg1-ZwP6o%n6`mW&Nxa1;oM#j=(ixAt$oG*gu9qzpUFD+%tZU6uP literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/Api_2_Prh_Gttl_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/Api_2_Prh_Gttl_1.java new file mode 100644 index 0000000..83a1ecc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/Api_2_Prh_Gttl_1.java @@ -0,0 +1,423 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Gttl_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gttl; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gttl + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Gttl_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + public final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Gttl_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Gttl_1 thisApplet = new Api_2_Prh_Gttl_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + ProactiveResponseHandler proRespHdlr = null ; + + short result = (short) 0 ; + + // -------------------------------------------- + // Test Case 1 : Unavailable Text String TLV + + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + + // Build and send a proactive command + proHdlr.initDisplayText((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + + // getTextStringLength() with unavailable Text String TLV + result = proRespHdlr.getTextStringLength() ; + + } catch (ToolkitException e) { + + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true ; + } + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Successfull call (Null Text String) + + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringLength() ; + + bRes = (result == (short)0x00) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Verify the TLV selected + + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x00) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Successfull call + + testCaseNb = (byte) 4 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringLength() ; + + bRes = (result == (short)0x01) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Verify the TLV selected + + testCaseNb = (byte) 5 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x02) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Successfull call + + testCaseNb = (byte) 6 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringLength() ; + + bRes = (result == (short)0x02) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Verify the TLV selected + + testCaseNb = (byte) 7 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x03) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successfull call + + testCaseNb = (byte) 8 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringLength() ; + + bRes = (result == (short)0x7E) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Verify the TLV selected + + testCaseNb = (byte) 9 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x7F) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successfull call + + testCaseNb = (byte) 10 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringLength() ; + + bRes = (result == (short)0x7F) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Verify the TLV selected + + testCaseNb = (byte) 11 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x80) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + + testCaseNb = (byte) 12 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringLength() ; + + bRes = (result == (short)0xEF) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Verify the TLV selected + + testCaseNb = (byte) 13 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0xF0) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successfull call, 2 Text String TLV + + testCaseNb = (byte) 14 ; + + bRes = false ; + try { + + // Build and send a GET INPUT proactive command + proHdlr.initGetInput((byte)0x00, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0x00, (short)0xFF) ; + + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + result = proRespHdlr.getTextStringLength() ; + + bRes = (result == (short)0x01) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Verify the TLV selected + + testCaseNb = (byte) 15 ; + + bRes = false ; + try { + + // Get length of current TLV + result = proRespHdlr.getValueLength() ; + + bRes = (result == (short)0x02) ; + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/Test_Api_2_Prh_Gttl.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/Test_Api_2_Prh_Gttl.java new file mode 100644 index 0000000..5ed5ea2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/Test_Api_2_Prh_Gttl.java @@ -0,0 +1,235 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Gttl.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gttl; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gttl + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gttl extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gttl"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gttl() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9112"); + + // Fetch the proactive command + response = test.fetch("12"); + result &= response.checkData("D0108103 01210082 0281028D 05045465" + + "7874"); + + // Terminal response with no additional information + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 2 & 3 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string TLV is null) + response = test.terminalResponse("81030123 00020282 81030100 0D00"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 4 & 5 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = 01h) + response = test.terminalResponse("81030123 00020282 81030100 0D020441"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 6 & 7 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = 02h) + response = test.terminalResponse("81030123 00020282 81030100 0D030042" + + "42"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 8 & 9 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = 7Eh) + response = test.terminalResponse("81030123 00020282 81030100 0D7F0801" + + "02030405 06070809 0A0B0C0D 0E0F1011" + + "12131415 16171819 1A1B1C1D 1E1F2021" + + "22232425 26272829 2A2B2C2D 2E2F3031" + + "32333435 36373839 3A3B3C3D 3E3F4041" + + "42434445 46474849 4A4B4C4D 4E4F5051" + + "52535455 56575859 5A5B5C5D 5E5F6061" + + "62636465 66676869 6A6B6C6D 6E6F7071" + + "72737475 76777879 7A7B7C7D 7E"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 10 & 11 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = 7Fh) + response = test.terminalResponse("81030123 00020282 81030100 0D818004" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 12 & 14 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text string length = EFh) + response = test.terminalResponse("81030123 00020282 81030100 0D81F004" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F80" + + "81828384 85868788 898A8B8C 8D8E8F90" + + "91929394 95969798 999A9B9C 9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAABAC ADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABBBC BDBEBFC0" + + "C1C2C3C4 C5C6C7C8 C9CACBCC CDCECFD0" + + "D1D2D3D4 D5D6D7D8 D9DADBDC DDDEDFE0" + + "E1E2E3E4 E5E6E7E8 E9EAEBEC EDEEEF"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 14 & 15 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (2 Text string TLVs) + response = test.terminalResponse("81030123 00020282 81030100 0D020441" + + "0D030842 43"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0FCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/applet.opt new file mode 100644 index 0000000..5d7f1b7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gttl.Api_2_Prh_Gttl_1 +uicc.test.toolkit.api_2_prh_gttl +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/javacard/api_2_prh_gttl.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gttl/javacard/api_2_prh_gttl.cap new file mode 100644 index 0000000000000000000000000000000000000000..50fc2db9156e05667352a140998ccdb136ad8c02 GIT binary patch literal 3953 zcmb7`4Nw$i7{{M?-`%}05BA`|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R}8t+)W8FJPdAQxcSQT7WPJmoapLtZGw2lvP;(vOO$Fphi;?l;v1} zpvPkn`ZNN?nUbI^umXgwVG)$&mXf2akpi4Y@f3wVlbnAlCM7^w8U+A*!vX{fB_%0Gg literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/Api_2_Prh_Gvby_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/Api_2_Prh_Gvby_1.java new file mode 100644 index 0000000..f10ca00 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/Api_2_Prh_Gvby_1.java @@ -0,0 +1,263 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Gvby_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gvby; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gvby + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Gvby_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + + public final byte DCS_8_BIT_DATA = (byte)0x04; + /** + * Constructor of the applet + */ + public Api_2_Prh_Gvby_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Gvby_1 thisApplet = new Api_2_Prh_Gvby_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + ProactiveResponseHandler proRespHdlr = null ; + + // Result of method + short result = 0 ; + short valueOffset = 0 ; + byte tag = 0 ; + byte occurence = 0 ; + + // -------------------------------------------- + // Test Case 1 : Unavailable Element + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Build and send a PRO command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + valueOffset = (short)0 ; + proHdlr.getValueByte(valueOffset) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 2 : Out of Tlv Boundaries + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Search Command Details TLV + tag = TAG_COMMAND_DETAILS ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + try { + valueOffset = (short)3 ; + result = proRespHdlr.getValueByte(valueOffset) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 3 : Successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + // Search Command Details TLV + tag = TAG_COMMAND_DETAILS ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + // Get value + valueOffset = (short)2 ; + result = proRespHdlr.getValueByte(valueOffset) ; + + bRes = (result == (byte)0x00) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 4 : Successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + // Search Command Details TLV + tag = TAG_DEVICE_IDENTITIES ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + // Get value + valueOffset = (short)0 ; + result = proRespHdlr.getValueByte(valueOffset) ; + + bRes = (result == (byte)0x82) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : Successful call + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + // Search Command Details TLV + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + // Get value + valueOffset = (short)0x7E ; + result = proRespHdlr.getValueByte(valueOffset) ; + + bRes = (result == (byte)0x7E) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 6 : Successful call + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + // Build and send a PRO command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Search Command Details TLV + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + // Get value + valueOffset = (short)0x7E ; + result = proRespHdlr.getValueByte(valueOffset) ; + + bRes = (result == (byte)0x7E) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Get value + valueOffset = (short)0x7F ; + result = proRespHdlr.getValueByte(valueOffset) ; + + bRes = (result == (byte)0x7F) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : Successful call + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + // Get value + valueOffset = (short)0xEF ; + result = proRespHdlr.getValueByte(valueOffset) ; + + bRes = (result == (byte)0xEF) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/Test_Api_2_Prh_Gvby.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/Test_Api_2_Prh_Gvby.java new file mode 100644 index 0000000..5b5a50a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/Test_Api_2_Prh_Gvby.java @@ -0,0 +1,147 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Gvby.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gvby; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gvby + * + * @version 0.0.1 - 24 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gvby extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gvby"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gvby() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 5 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9116"); + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text String Length = 7Eh) + response = test.terminalResponse("81030123 00020282 81030100 0D7F0801" + + "02030405 06070809 0A0B0C0D 0E0F1011" + + "12131415 16171819 1A1B1C1D 1E1F2021" + + "22232425 26272829 2A2B2C2D 2E2F3031" + + "32333435 36373839 3A3B3C3D 3E3F4041" + + "42434445 46474849 4A4B4C4D 4E4F5051" + + "52535455 56575859 5A5B5C5D 5E5F6061" + + "62636465 66676869 6A6B6C6D 6E6F7071" + + "72737475 76777879 7A7B7C7D 7E"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 6 to 8 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + + // Terminal response (Text String Length = EFh) + response = test.terminalResponse("81030123 00020282 81030100 0D81F004" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F80" + + "81828384 85868788 898A8B8C 8D8E8F90" + + "91929394 95969798 999A9B9C 9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAABAC ADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABBBC BDBEBFC0" + + "C1C2C3C4 C5C6C7C8 C9CACBCC CDCECFD0" + + "D1D2D3D4 D5D6D7D8 D9DADBDC DDDEDFE0" + + "E1E2E3E4 E5E6E7E8 E9EAEBEC EDEEEF"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "08CCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/applet.opt new file mode 100644 index 0000000..f21a8d0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gvby.Api_2_Prh_Gvby_1 +uicc.test.toolkit.api_2_prh_gvby +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/javacard/api_2_prh_gvby.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvby/javacard/api_2_prh_gvby.cap new file mode 100644 index 0000000000000000000000000000000000000000..3a8879702972e0de9d18a83e165ab9424712fa71 GIT binary patch literal 3675 zcmbtW3rv$&6h8NVQz*9B)~=O@9SYS!5mC_&6-5;Bfv8&`aaggAN2R4y<7-+Na)0=5)~|lKBepvAOA7+~%?w@iCp#*qy(EwZD_l?6%*%_kVrgIp_ZO z{3j=yW>g^HFL!=ce|V;;fPrx%C#NT5jn6cVOCO(=IdanE#BrIAn*o|~r%tF!QoR*- zb?DuR(arhyejIr0Mm*Y!y;kFp;x(nQPr`RtSg)P{dBCdys7lSz0ntzx$F7# zQCo{6*T!z^xjOPg=asvYZvAQ+u+u#C;1<1XR`220x3^@dREhFB*U^|Ibrsq0eQw4X zP54fv@s+||lzT9$T z%8@s|K2G&E_eqeGnd=~~&bIOV{oA`+yA1jKetoDWB56<5p{$A<$)olp*WWQT=0#L( z8AhdW`zEwjyOthVKeu9f_k)vaA8gsUIJNP>x6R}#9koIEdifRG z+xJdAY;AB{Sy=wfmsjdXL~bpO&dKJ5ysws(&m{n77=RpHJ(+LK#MOJe*K3Z%BM~Wx z*~Nv0CYQCsWpdf=w$fsk$>Jz3NG@{ zew zhI#-pC_%b91U809WDP$r|Fauj5D}c0=?;g@>Jl|+P)WQaKwy5Le`TiHOG8jZL~ue` zvmAD(Ply4tG?1-GM-jdehv@`m1EL&(XQAyPkU)FRm2Y1)5ig4vjOcv4N7&0MT$VCd z4!#DW`z!{!D+NF!2m&ZK0{0gkKOdg@ago88^1>k!H+w97!y($%2lSA?d~ipi;IjKZ3l#wzBfrf~{a z>QbWRtEu^H-}gYCwhY)ry*83b*GBfN0Zv~7yuOO2YAM`(^M$zO5SBm^X(K}$S=z|a zMqbMxGhNN-XugTiO=Kml1aGYX;d)&yfpD#PIds7XSe=GNl5ocCP{#{ewN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z08(fxPzbRI=ZH;$@By-!0+G!ZeZD77gd&*(b`?St^X> zJQYXPaL@}J^x?*P$C?6z;01qK!-*8UNVHW=N>Q%0&Lh1j`>m;zH+WGoD9gc%mC3h* zSWY*AoNMz+rDcW5sfL_x5gVvugDR>r>Rqp4kQdF!p4p;3!G#wz~ENH9RFUJ7Nx zgBg}qN?D3y!o_^g(z7RI;)I-oQjGJw1SKbSG*K+$&4{@O5i9ZzmvNCHB38mhIr?Zv zKQ)w}nd)kO#KxsR??KafBqQ7pEAw^LTC?7S8Hcyt3)=Z;4>VRd^d`zC#<1d#`m8h` z3kk$yj}eigQP5TzHledrFdeUeNT3V@O%y-I$kYh)$=?_`00JQv;t?|-0iR7osQ9dD zw?mSnSK}xR(n$h2%vMCUkw_wAKADBXe8dX!BCV29>G?T?3c@^izZ`ow)AQw+YkN|0 z#%qyIY=XyC1x_trp%dJ9qO(R2G6)L+CxZfA={|!?Ss)}4rhO;L0gp(WMSze&nD3no zzPJ_KUxqXL3mJqN+{w`C5rZ(F3weYI*va!U?jrYBl5syB3kigI*GX{1BLZg@7BUFq zp_5@fo;UZGAc&4a8evFu(p>b2Mi3x{G{Vs3r0EoUvKrSwmY>67!3J2actHaCy+y)b F{STmDkZb?| literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/Api_2_Prh_Gvsh_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/Api_2_Prh_Gvsh_1.java new file mode 100644 index 0000000..971c1ff --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/Api_2_Prh_Gvsh_1.java @@ -0,0 +1,270 @@ +//----------------------------------------------------------------------------- +//Api_2_Prh_Gvsh_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gvsh; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gvsh + * + * @version 0.0.1 - 27 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Prh_Gvsh_1 extends TestToolkitApplet +{ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t'} ; + private static final byte DCS_8_BIT_DATA = (byte)0x04; + + /** + * Constructor of the applet + */ + public Api_2_Prh_Gvsh_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Prh_Gvsh_1 thisApplet = new Api_2_Prh_Gvsh_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + ProactiveResponseHandler proRespHdlr = null ; + + // Result of method + short result = 0 ; + short valueOffset = 0 ; + byte tag = 0 ; + byte occurence = 0 ; + + // -------------------------------------------- + // Test Case 1 : Unavailable Element + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Build and send a PRO command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + try { + valueOffset = (short)0 ; + proHdlr.getValueShort(valueOffset) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Out of Tlv Boundaries + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Search Command Details TLV + tag = TAG_COMMAND_DETAILS ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + try { + valueOffset = (short)3 ; + result = proRespHdlr.getValueShort(valueOffset) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + // Search Command Details TLV + tag = TAG_COMMAND_DETAILS ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + // Get value + valueOffset = (short)1 ; + result = proRespHdlr.getValueShort(valueOffset) ; + + bRes = (result == (short)0x2300) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + // Search Command Details TLV + tag = TAG_DEVICE_IDENTITIES ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + // Get value + valueOffset = (short)0 ; + result = proRespHdlr.getValueShort(valueOffset) ; + + bRes = (result == (short)0x8281) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Successful call + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + // Search Command Details TLV + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + // Get value + valueOffset = (short)0x7D ; + result = proRespHdlr.getValueShort(valueOffset) ; + + bRes = (result == (short)0x7D7E) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Successful call + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + // Build and send a PRO command + proHdlr.initGetInput((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)TEXT.length, (short)0, (short)0xFF) ; + proHdlr.send() ; + + // Get the response + proRespHdlr = ProactiveResponseHandlerSystem.getTheHandler() ; + + // Search Command Details TLV + tag = TAG_TEXT_STRING ; + occurence = (byte)1 ; + proRespHdlr.findTLV(tag, occurence) ; + + // Get value + valueOffset = (short)0x7D ; + result = proRespHdlr.getValueShort(valueOffset) ; + + bRes = (result == (short)0x7D7E) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Get value + valueOffset = (short)0x7F ; + result = proRespHdlr.getValueShort(valueOffset) ; + + bRes = (result == (short)0x7F80) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successful call + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + // Get value + valueOffset = (short)0xEE ; + result = proRespHdlr.getValueShort(valueOffset) ; + + bRes = (result == (short)0xEEEF) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/Test_Api_2_Prh_Gvsh.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/Test_Api_2_Prh_Gvsh.java new file mode 100644 index 0000000..4a4572b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/Test_Api_2_Prh_Gvsh.java @@ -0,0 +1,145 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Prh_Gvsh.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_prh_gvsh; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_prh_gvsh + * + * @version 0.0.1 - 27 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Prh_Gvsh extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_prh_gvsh"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Prh_Gvsh() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 5 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9116"); + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + // Terminal Response (Text String length = 7Eh) + response = test.terminalResponse("81030123 00020282 81030100 0D7F0401" + + "02030405 06070809 0A0B0C0D 0E0F1011" + + "12131415 16171819 1A1B1C1D 1E1F2021" + + "22232425 26272829 2A2B2C2D 2E2F3031" + + "32333435 36373839 3A3B3C3D 3E3F4041" + + "42434445 46474849 4A4B4C4D 4E4F5051" + + "52535455 56575859 5A5B5C5D 5E5F6061" + + "62636465 66676869 6A6B6C6D 6E6F7071" + + "72737475 76777879 7A7B7C7D 7E"); + result &= response.checkSw("9116"); + + /*********************************************************************/ + /** Testcase 6 to 8 */ + /*********************************************************************/ + + // Fetch the GET INPUT proactive command + response = test.fetch("16"); + result &= response.checkData("D0148103 01230082 0281828D 05045465" + + "78749102 00FF"); + // Terminal Response (Text String length = EFh) + response = test.terminalResponse("81030123 00020282 81030100 0D81F004" + + "01020304 05060708 090A0B0C 0D0E0F10" + + "11121314 15161718 191A1B1C 1D1E1F20" + + "21222324 25262728 292A2B2C 2D2E2F30" + + "31323334 35363738 393A3B3C 3D3E3F40" + + "41424344 45464748 494A4B4C 4D4E4F50" + + "51525354 55565758 595A5B5C 5D5E5F60" + + "61626364 65666768 696A6B6C 6D6E6F70" + + "71727374 75767778 797A7B7C 7D7E7F80" + + "81828384 85868788 898A8B8C 8D8E8F90" + + "91929394 95969798 999A9B9C 9D9E9FA0" + + "A1A2A3A4 A5A6A7A8 A9AAABAC ADAEAFB0" + + "B1B2B3B4 B5B6B7B8 B9BABBBC BDBEBFC0" + + "C1C2C3C4 C5C6C7C8 C9CACBCC CDCECFD0" + + "D1D2D3D4 D5D6D7D8 D9DADBDC DDDEDFE0" + + "E1E2E3E4 E5E6E7E8 E9EAEBEC EDEEEF"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "08CCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/applet.opt new file mode 100644 index 0000000..a5c4569 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_prh_gvsh.Api_2_Prh_Gvsh_1 +uicc.test.toolkit.api_2_prh_gvsh +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/javacard/api_2_prh_gvsh.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_prh_gvsh/javacard/api_2_prh_gvsh.cap new file mode 100644 index 0000000000000000000000000000000000000000..82a09a8cbcb23c1f2fb3411fc08e0996e7df0c36 GIT binary patch literal 3665 zcmbtW3rtg282-<~Qb1auBZ^Z?F;jz} z&Ie-D;j&F#lx+rI$>y9+jV3rBo4Pm`Ni@a>>XvOJbJG2{fVFp%(CplP=bWB%@AsYm zKllFUH)Yd|0(iV~tFp$xOGN<;7^mcBBxKE;nrO_JnKgCF++3}3YUc%jgL5vIx^;>b zBidsAI%ZHT_|Ew3>~?K@h5GcPt;wdA+0|Po{r=?58@c)YZXIffEWG&jz1XmV~zDT+;WfnX8Or3YlgHQJ)ZwC>R49c+Yfg%8?KH~ zH{CYh*jzM!)~EN2&RaJWr0Z&O;@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!#tP-HTVfY7@AU?-;eFa zqT-1MLIOBEFf?@uw~Lqm)b4v023h468>6dvS^m^=NX62A2OjQ%NtH=M(Z@ zelGXY#e|X<+1+UZZQ(K@3GE?-%nvnm8bTYk3~3JuBHK4jpq*MKXmKio4@35Cnm~K6 zOxPb1fp%h=L))s%NyJqYd?eW~OqK@FZYl$Ig#?hjl_t>MBojUoLJ5I#DjGxElZ?^e mX%>8@D6^t5v>VA7JQ72|1bS0(fq-A*L4a2Z=6&{{HT?_GCMyvD literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/Api_2_Tep_Chec_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/Api_2_Tep_Chec_Bss_1.java new file mode 100644 index 0000000..3dad6ee --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/Api_2_Tep_Chec_Bss_1.java @@ -0,0 +1,226 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tep_chec_bss; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, TerminalProfile class, check(byte[], short, short) method + * applet 1 + */ +public class Api_2_Tep_Chec_Bss_1 extends TestToolkitApplet { + + private static final byte[] COMPARE = {(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xA9, + (byte)0x77}; + + /** + * Constructor of the applet + */ + public Api_2_Tep_Chec_Bss_1() { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tep_Chec_Bss_1 thisApplet = new Api_2_Tep_Chec_Bss_1(); + + // Register the new applet instance to the JCRE. + thisApplet.register(bArray, (short)(bOffset+1), (byte)bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // Register to unrecognized envelope + thisApplet.obReg.requestPollInterval(POLL_SYSTEM_DURATION); + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + byte testCaseNb = (byte)0x00 ; + // Result of tests + boolean bRes = false; + + if (event == EVENT_STATUS_COMMAND) { + /** Test Case 1: ToolkitException ME_PROFILE_NOT_AVAILABLE is sent */ + testCaseNb = (byte)1; + bRes = false; + + try { + TerminalProfile.check(COMPARE, (short)0, (short)16); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.TERMINAL_PROFILE_NOT_AVAILABLE); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + /** Test Case 2: NULL as parameter to check */ + testCaseNb = (byte)2; + bRes = false; + + try { + TerminalProfile.check(null, (short)0, (short)1); + } + catch (NullPointerException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 3: Offset > COMPARE.length */ + testCaseNb = (byte)3; + bRes = false; + + try { + TerminalProfile.check(COMPARE, (short)17, (short)1); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 4: Offset < 0 */ + testCaseNb = (byte)4; + bRes = false; + + try { + TerminalProfile.check(COMPARE, (short)-1, (short)1); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 5: Length > COMPARE.length */ + testCaseNb = (byte)5; + bRes = false; + + try { + TerminalProfile.check(COMPARE, (short)0, (short)18); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 6: Offset+Length > COMPARE.length */ + testCaseNb = (byte)6; + bRes = false; + + try { + TerminalProfile.check(COMPARE, (short)9, (short)9); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 7: length < 0 */ + testCaseNb = (byte)7; + bRes = false; + + try { + TerminalProfile.check(COMPARE, (short)0, (short)-1); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 8: length = 0 */ + testCaseNb = (byte)8; + bRes = false; + + try { + bRes = TerminalProfile.check(COMPARE, (short)0, (short)0); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 9: Check all the Terminal Profile */ + testCaseNb = (byte)9; + bRes = false; + + try { + if (TerminalProfile.check(COMPARE, (short)0, (short)16) == false) { + bRes = true; + } else { + bRes = false; + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 10: Check 2 first bytes of the Terminal Profile */ + testCaseNb = (byte)10; + bRes = false; + + try { + bRes = TerminalProfile.check(COMPARE,(short)15, (short)2); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 11: Check facility 15 of the Terminal Profile */ + testCaseNb = (byte)11; + bRes = false; + byte[] COMPARE2 = {(byte)0x00,(byte)0x80}; + + try { + if (TerminalProfile.check(COMPARE2, (short)0, (short)2) == false) { + bRes = true; + } else { + bRes = false; + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/Test_Api_2_Tep_Chec_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/Test_Api_2_Tep_Chec_Bss.java new file mode 100644 index 0000000..971f2f4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/Test_Api_2_Tep_Chec_Bss.java @@ -0,0 +1,79 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for TerminalProfile class + * check(byte[], short, short) method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tep_chec_bss; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tep_Chec_Bss extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tep_chec_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tep_Chec_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // test script + test.reset(); + + // test case 1: send a status command to trigger the applet without terminal profile + test.status("00","00","04"); + + // test case 2 to 11 + test.reset(); + test.terminalProfileSession("A977FFF1 FFFFFFFF FFFFFFFF FFFFFFFF"); + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "0BCCCCCC CCCCCCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/applet.opt new file mode 100644 index 0000000..d2987ec --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tep_chec_bss.Api_2_Tep_Chec_Bss_1 +uicc.test.toolkit.api_2_tep_chec_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/javacard/api_2_tep_chec_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_chec_bss/javacard/api_2_tep_chec_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..f373cc3c7421d5102212a3fdb0d2104cc28f7e89 GIT binary patch literal 5248 zcmb7H3w)E+75|?vU!HAg`jR3PTGq1C(grF|q0qEY=xAxB6%{rhO~2CEki;ZB+Ug7i z91H|h-0+296<<)91LUDH0d=Avf&zl*Hg(DrSKKB}lzML4nC2VoM?N^sJ?EZ#{^y?i zI;Uc?Moxr*|6OR9KMdWzM93(cP-V?2nNn;ivrZ`~o={npTULDOAh2cXE3W1O^Go-& z#Wp!(S8RREu`BJpC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{^P(D*+2cgn$^E>Rt4#nBAI}Lm*irbJhh!Yogx9{l%Y+Q9H zKDzUhXA4;>D01wnN^Pmz&iHPZI2lI1kEK5vF-mVxe>$BUEgOu9I#W_?f?k)P*NVRe zeS$&D|6>fgM1wBon#AzHl&yR8ULQLqXbe+iff=v(>|Te5pAX?%6!>l9i%Y|QG>fEW zL$kj9TDFOSScH4{eG-=y$cS|qfGpAG+vEVQqeh4uHWsPv?W{F`DLoWZ9-WO`4A$1A zt|7C$Z3u0Zw-r)>CeJKc!zZ(G|H}_wU=Tr(Uw7k`>Und-JfiuvOS`(47^AK#VAhVr zpo$ZNB9Ryr`h2s7AT=~}p5NiLRBio9&xNjBdeRZ!GG zc?%!3ff$S=mh-Wc_*C}9^e$*>B<9#GHAFQ?G?dK` z0S5@-_pyl0)DK--K@0=t66Ui?q|K< z;rFU4jb_m{)rY|-Sc=H zU*iH}e~a(%G%n(MJcA!dk1f36jd+es6osu6O>uah;wcf^DT%JZ4(ds1*hT#*1G{Me z4aAF-McLR(gD3}oqFhe!_R&xpj#p^}jl^p-ipJv&nn1;PlP1z6yhSB61&67eZooS< zm9LPaR7JnSF`7xWI8JluR-B-Ea^Zb)lLsHrZJZRIAs;QoN7O(K_-n;vk`no-1k3gA zm7pls!@nyP@4||Sx0LuUS2c#L?4?Mb+fWUuMp4&*A(WeV&tKJb{nLXIRuQU!)b(Bn z=-r5cLe-xdMP2BHP^_9rrxPms)F|rGErjx3#3;enGg!!}vDB4V2+PYmE3ySD3f5(6 z5Ow(#0{L6SAfaMRjiSz_Lnux9NT;I8tkqEJ)HwuoAz~<1BCUo}C&D49wfw9`wm{)& ju^LI8rG}7f#>kPna@LB;T22AL?|d{~;>F$)E4Uv4>ON%a literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/Api_2_Tep_Checb_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/Api_2_Tep_Checb_1.java new file mode 100644 index 0000000..dcca271 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/Api_2_Tep_Checb_1.java @@ -0,0 +1,133 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tep_checb; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, TerminalProfile class, check(byte) method + * applet 1 + */ +public class Api_2_Tep_Checb_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Tep_Checb_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tep_Checb_1 thisApplet = new Api_2_Tep_Checb_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_STATUS_COMMAND and EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.requestPollInterval(POLL_SYSTEM_DURATION); + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + // Result of tests + boolean bRes = false; + + if (event == EVENT_STATUS_COMMAND) { + /** Test Case 1: ToolkitException TERMINAL_PROFILE_NOT_AVAILABLE is sent */ + testCaseNb = (byte) 1; + bRes = false; + try { + TerminalProfile.check((byte)1); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.TERMINAL_PROFILE_NOT_AVAILABLE); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + /** Test Case 2: Facility is supported */ + testCaseNb = (byte)2; + bRes = false; + try { + bRes = TerminalProfile.check((byte)0); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 3: Facility is not supported */ + testCaseNb = (byte)3; + bRes = false; + + try { + if (TerminalProfile.check((byte)15) == false) { + bRes = true; + } else { + bRes = false; + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 4: Facility index is outside TerminalProfile data */ + testCaseNb = (byte)4; + bRes = false; + + try { + if (TerminalProfile.check((byte)0x7F) == false) { + bRes = true; + } else { + bRes = false; + } + } + catch (Exception e) { + bRes =false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 5: ToolkitException BAD_INPUT_PARAMETER is sent */ + testCaseNb = (byte)5; + bRes = false; + try { + TerminalProfile.check((byte)0x80); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) { + bRes = true; + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/Test_Api_2_Tep_Checb.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/Test_Api_2_Tep_Checb.java new file mode 100644 index 0000000..655b854 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/Test_Api_2_Tep_Checb.java @@ -0,0 +1,79 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for TerminalProfile class + * check(byte) method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tep_checb; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tep_Checb extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tep_checb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tep_Checb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // test script + test.reset(); + + // test case 1: send a status command to trigger the applet without terminal profile + test.status("00","00","04"); + + // test case 2 to 4 + test.reset(); + test.terminalProfileSession("010160"); + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "05CCCCCC CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/applet.opt new file mode 100644 index 0000000..f7f40ad --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tep_checb.Api_2_Tep_Checb_1 +uicc.test.toolkit.api_2_tep_checb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/javacard/api_2_tep_checb.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checb/javacard/api_2_tep_checb.cap new file mode 100644 index 0000000000000000000000000000000000000000..ad978bce7efcc8f4d3fc13375a338ab9c97863d6 GIT binary patch literal 4326 zcmb7HeN>cH8vnf?^9jg=gNz_b2qhRZJNQuwsl!(yq6DO+7S4<>%)~G=&AhN;wG327 z;zyp6*0i=Gsc6VIRUwE*XsKUrZCQdFnh_!@OKWX;=E|~b9|NbV z2fZDu3>Aru`G-B#m9CT4;WPK0erC{H+ii|J_uEU3H~1y4Lw9WBM~B{R zy)^XmqlN8TMpB+%mU5!2Q#!QM(w@`#^?%;JI`W|S@X#*fp4P0=_lA=Dg2vbPH#emo zv)UW|_Yd~;9{;BI)g;H+(UTwM&;7K@HmmHCVc_5g^B2zk_TcWve)Y-IecEGpZ91*m z+A;9=!P0Mc{-uB5&COr@b9|})a*OMQtgAf_co)`w>iy+gS2Oc$=hqY-I5KKoo$|_y z!>)fF+y48Fez|kgnHir|{N}+`O%11xW`|mI+Gx_{S4zZ>3n{=RGey}eC;JDeo{ark85?0dnp%LDf=-}27! zYX?UU9lyYRHF18w;jdpjcIZIMn-|B*_CI`L{nw{Gsx@6d`jLyWd@xUnficI;Tr=IxLUcTkKAI zV4G#NWZxzQ%uc(XL*d1bC%)o&5uD*QIze=jly^IOHJeyx_EA4EH8x^jAGP<&F}X} zGJ_RhROo;Mhmz=b^jh|QzJgE~#fVhilP zE?S@$kK~LkBQ~P~q8OB3?DGa?yH~CvdtnMtk+u_fP!ACtJ=Juq5CTu6RkOJc9Z>?f zr-;`P2caW@Bc3i=qO;!4p)`_&(PE-lB=XpUK_-eCCZIS3ZUTC;e)!vYbZ9w!hemPp z9qLay=hF&CG2Ta|B)fdu7@CI5(4Y+(?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eDcu9wm&j5Q)Hi a87s_GSyEM@B1M1#ay$;x?Jj0n2>%7A4T{?U literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/Api_2_Tep_Checs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/Api_2_Tep_Checs_1.java new file mode 100644 index 0000000..7d065cf --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/Api_2_Tep_Checs_1.java @@ -0,0 +1,133 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tep_checs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, TerminalProfile class, check(short) method + * applet 1 + */ +public class Api_2_Tep_Checs_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Tep_Checs_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tep_Checs_1 thisApplet = new Api_2_Tep_Checs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_STATUS_COMMAND and EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.requestPollInterval(POLL_SYSTEM_DURATION); + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + // Result of tests + boolean bRes = false; + + if (event == EVENT_STATUS_COMMAND) { + /** Test Case 1: ToolkitException TERMINAL_PROFILE_NOT_AVAILABLE is sent */ + testCaseNb = (byte) 1; + bRes = false; + try { + TerminalProfile.check((short)1); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.TERMINAL_PROFILE_NOT_AVAILABLE); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + /** Test Case 2: Facility is supported */ + testCaseNb = (byte)2; + bRes = false; + try { + bRes = TerminalProfile.check((short)0); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 3: Facility is not supported */ + testCaseNb = (byte)3; + bRes = false; + + try { + if (TerminalProfile.check((short)15) == false) { + bRes = true; + } else { + bRes = false; + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 4: Facility index is outside TerminalProfile data */ + testCaseNb = (byte)4; + bRes = false; + + try { + if (TerminalProfile.check((short)0x0099) == false) { + bRes = true; + } else { + bRes = false; + } + } + catch (Exception e) { + bRes =false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 5: ToolkitException BAD_INPUT_PARAMETER is sent */ + testCaseNb = (byte)5; + bRes = false; + try { + TerminalProfile.check((short)0x8000); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) { + bRes = true; + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/Test_Api_2_Tep_Checs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/Test_Api_2_Tep_Checs.java new file mode 100644 index 0000000..0c39a32 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/Test_Api_2_Tep_Checs.java @@ -0,0 +1,78 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for TerminalProfile class + * check(short) method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tep_checs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tep_Checs extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tep_checs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tep_Checs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + + // test case 1: send a status command to trigger the applet without terminal profile + test.status("00","00","04"); + + // test case 2 to 4 + test.reset(); + test.terminalProfileSession("010160"); + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "05CCCCCC CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/applet.opt new file mode 100644 index 0000000..12bb106 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tep_checs.Api_2_Tep_Checs_1 +uicc.test.toolkit.api_2_tep_checs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/javacard/api_2_tep_checs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_checs/javacard/api_2_tep_checs.cap new file mode 100644 index 0000000000000000000000000000000000000000..101de1ac6dbbdec979ba2597ffa3a119c9843901 GIT binary patch literal 4327 zcmb7H3s6+o8UF5L*#{siEV4onL@)}0%@SXLL6=u0fFdAHq7&F%F0!!hZg(#au~Sx} z9V|p+laUxT#b~276EtZk(>xrNPMT;ltxcUKabjYcnVK0jwoZ%Fq@n*=z;$ox*ga?d zy=TvV&iVfPpZ|5MD+JL14fTI*=~#@rngJrJO6x4y<*Um~RhHG|Wu>)sIaOufodaI2 zIpgYGsek9$n=xCRG5sfBa*UV#a{i)=&$oUu@8i>rOEW75cU=9f^R;!`65ptb%jN#j zeEIG1=Cd^~t{lFZ_1=O0=hA-ndezwAX~S=CTi5@`ldb;r_x*;duJqDV=i{AT!;wAh zZHX_NrKF)_pRfIMZFk)o?Q2i|@S=ToO!=|Y$itm|-VeKM8DoXdnrAH8_e}hmfzqsB zi`N=WT}R%#oV)*%4R5WxvD+;iA1%I=ej(*m@A^YO>)3kmVuC~aLj4!}3>mvEHFACZ z;rI7nF*l68Ki9S=|MS!k}XDS$5?7UzcQkWlO&CgS>BQe*T5@apH5c#-*1=N1cbVZ)Kf7d+VbW8>?$K zUGF_G@A7YkhMQM>wf)V(r*D^cwVcXt8ecm8$L%k?`(Sm2TJz=Kb{v*D;142DO*f|t z+!wpKu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K!q?Vz)6mlvSUy3ltpHf{KEptkc5|+>m`yG z?SpP|hUK;Zt8sc@nI2?JFOCnyIF7OlONdKJEFC#3gUTmP991d?>V+iCJgUXgsar_o z`6wdS%qCaPK`vI|5z4KP(e7oapxrA_g_YFT(ApwYqZs9=A$}FsVKvRx(_B3s$9g8L){HOg%%Hb(FZSfVgT(F z<#*BA-55j{o~PbT>KLLuhj0Wx!Y`=zkfx5(&SMy+ohPVoudd*D_L|e54R@EN?6V=X z-RmQQouZox_y4Pe4W9BQrSto{)g8YN7PLwTWlb7{sN}xH4KU>T}}P?nNGh%@0qOoz|u!cqyOtPq1hwPZ?Ryi4(Py{JS`mW4rt z)8Qcmi$o=avH}W1ETae)#!D#bAtjEo2nymH3=c<95-D+%Wlj)h9#tP= dstBuffer.length */ + testCaseNb = (byte)3; + bRes = false; + try { + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short)dstBuffer.length, (byte)0); + TerminalProfile.copy((short)0, dstBuffer, (short)5, (short)1); + } + catch (ArrayIndexOutOfBoundsException e) { + if (isBufferEmpty(dstBuffer)) + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 4: dstOffset < 0 */ + testCaseNb = (byte)4; + bRes = false; + try { + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short) dstBuffer.length, (byte)0); + TerminalProfile.copy((short)0, dstBuffer, (short)-1, (short)1); + } + catch (ArrayIndexOutOfBoundsException e) { + if (isBufferEmpty(dstBuffer)) + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 5: dstLength < 0 */ + testCaseNb = (byte)5; + bRes = false; + try { + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short)dstBuffer.length, (byte)0); + TerminalProfile.copy((short)0, dstBuffer, (short)0, (short)-1); + } + catch (ArrayIndexOutOfBoundsException e) { + if (isBufferEmpty(dstBuffer)) + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 6: dstLength > dstBuffer.length */ + testCaseNb = (byte)6; + bRes = false; + try { + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short)dstBuffer.length, (byte)0); + TerminalProfile.copy((short)0, dstBuffer, (short)0, (short)6); + } + catch (ArrayIndexOutOfBoundsException e) { + if (isBufferEmpty(dstBuffer)) + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 7: dstOffset + dstLength > dstBuffer.length */ + testCaseNb = (byte)7; + bRes = false; + try { + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short)dstBuffer.length, (byte)0); + TerminalProfile.copy((short)0, dstBuffer, (short)3, (short)3); + } + catch (ArrayIndexOutOfBoundsException e) { + if (isBufferEmpty(dstBuffer)) + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 8: Successful call */ + testCaseNb = (byte)8; + bRes = false; + try { + dstBuffer = new byte[6]; + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short) dstBuffer.length, (byte)0x55); + + if (TerminalProfile.copy((short)0, dstBuffer, (short)0, (short)6) == (short)6) { + if ( ( (dstBuffer[0]&(byte)0xFD) == (byte) 0xA9) + && ( dstBuffer[1] == (byte) 0x01) + && ( dstBuffer[2] == (byte) 0xD2) + && ( dstBuffer[3] == (byte) 0xF0) + && ( dstBuffer[4] == (byte) 0x01) + && ( dstBuffer[5] == (byte) 0x02) + ) { + bRes = true; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 9: Successful call */ + testCaseNb = (byte)9; + bRes = false; + try { + dstBuffer = new byte[20]; + + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short)dstBuffer.length, (byte)0x55); + + if (TerminalProfile.copy((short)1, dstBuffer, (short)3, (short)4) == (short)7) { + if ( ( dstBuffer[3] == (byte) 0x01) + && ( dstBuffer[4] == (byte) 0xD2) + && ( dstBuffer[5] == (byte) 0xF0) + && ( dstBuffer[6] == (byte) 0x01) + ) { + bRes = true; + + for (index = 0; (index < 3)&&bRes; index++) { + bRes = ( dstBuffer[index] == (byte) 0x55 ); + } + for (index = 7; (index < dstBuffer.length)&&bRes; index++) { + bRes = ( dstBuffer[index] == (byte) 0x55 ); + } + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 10: Successful call, copy with length =0 */ + testCaseNb = (byte)10; + bRes = false; + try { + dstBuffer = new byte[20]; + + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short)dstBuffer.length, (byte)0x55); + + if (TerminalProfile.copy((short)0, dstBuffer, (short)20, (short)0) == (short)20) { + bRes = true; + + for (index = 0; (index < dstBuffer.length)&&bRes; index++) { + bRes = (dstBuffer[index] == (byte) 0x55); + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 11: Value outside MEProfile data available */ + testCaseNb = (byte)11; + bRes = false; + try { + dstBuffer = new byte[6]; + + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short)dstBuffer.length, (byte)0x55); + + if (TerminalProfile.copy((short)13, dstBuffer, (short)0, (short)6) == (short)6) { + if ( ( dstBuffer[0] == (byte) 0x8D) + && ( dstBuffer[1] == (byte) 0xFF) + && ( dstBuffer[2] == (byte) 0x00) + && ( dstBuffer[3] == (byte) 0x00) + && ( dstBuffer[4] == (byte) 0x00) + && ( dstBuffer[5] == (byte) 0x00) + ) { + bRes = true; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 12: startOffset < 0 */ + testCaseNb = (byte)12; + bRes = false; + try { + Util.arrayFillNonAtomic(dstBuffer, (short)0, (short)dstBuffer.length, (byte)0); + TerminalProfile.copy((short)-1, dstBuffer, (short)0, (short)6); + } + catch (ToolkitException e) { + if (isBufferEmpty(dstBuffer)) + if (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + } + + boolean isBufferEmpty(byte[] buf) { + for ( byte i = 0; i85(MW8A^?k^O>s};3U^~2W1$S>r6`#by1 zoS8ZQGiSatbIz2{lA0Z6{+(NX+ZgnD?9ecKYE{v-rE{h^XBW*Woi??yYV_=B|2hnG zR@Ag~&Wvn-o9sg#m5I09UM8m zXlV8R9j>93`zR%8!hI`dZa9^j_3qU>S6p)kX#HKJ>aXTr1hySBdOFg;v$XxYEk zPQ7}cR<v-f1D^P8H)$PJ2P?Kta(2y}^o{t;@SuKR z>E9;4IsMG;uScGG;B3cy;|oP=cl>*RlSZ;mfMFrvBTiJNLZ`|7bnFCKfct$LsFiPu&xJ9#FlX6dVU zbS`L1zi{t2Kk&T!MalX$|Efi^SN_4$I{NhID?i$Pe%XdCe|%-TWz4!E<+DuYiq7~0 zegfXmfO1|pYiPC9x}Cjs@1h&HrsxMut)99%XV4u8I)g1Ojb2aC>GF9N7c36CeT(Z_ ze9N87T(`OET>g6J47aP^?H^s|@(~J;AMQRQga*>Lu@DOk-TeG}CYLh@lGtCLQ@hV> z9>K#Djb$2Wbgw>BJbrgwu*JVzsU(nvLMA)^&%scw0#@u`aSxkb;(vZLiZaBurwW#* zaD$@38KTJNYjg({s)Rkt00cr;{~0zr*T4V&vv_Hfuf-n%(oh&}>(5zlL8fi|swIZ) zw-5=;MWhkbU!T-tb2t5nn-z^`x^jz`v@{2TuI6Ale<^DE1~zq~fDlY1+F2j|8G-Gx z9fHYhWFB=`m|{V93nmkj0mcrSCL!8oM=Wta3#oCdblG3g(_7M?NMi*RUB@&CMH^j# zfYQ*2p+HGH7|g1c=D2qKDuE6&SvyQo-^23XzwpgGb{9p1`yOVygG*cL6`V<{u;Vmr z_=;WPbi0joSZO3|l+QGh>tne-1IctVVrWKtGBt92CD$L|`bw^E=Xw{{4{^PV>+f>? zBvPoG>nGb&L@cZ#1Ic0xVnjxJvMA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)%Sr95sD%D8U{=5qT~lyiGIDma;`Ko#TNhgeE+U zN6?HdcoIH5#XIz^*o{3bWiOsb5HH{*wBjIsgWK^kUO^jP#p_ssH}EFoyoI+J=_o#6 zqz~~4@AfD0Deh*Qp2a=*0$<|aIAQpjwK#|Ktj7fc?js@t){&7+SkK>h0ya`2rDGFi zP$nLrEXu)V%B5@Y6S|g0<3Vy#9)3#sG!_rhIGTVhG?8w=qcn+1v5jU@6}Hnnx)G1j zd`>?er^Qr@C#a6<@g%va0Z-8qYQi(rOn!7yfP&abt@LB;qC4nbJWH!-Gj`KYXe;*6 zHrj!`^d#-XKKcdi!+zRNFW{H-BE5oN(W{)k9H7_eFn&$1(;Ik+j?g>!4IQKR@GAYD z{(%3Y_vs@XqCe9a9Hzh1dAvav*kO-w8fnIFg+=IiQ^X4g-V&)|D2|F@A|1y>hPWF4 zBd!r+xjarx!0*IFQHuA(Oi|6{g`x%@ibdikcB-32J^m!z!h;iHnegIc(J1`*s|biY zaZ=nR*5H&_%c1^h&Tuy2jJRJsioc7kVkeh>A$H*l@vP{=Kg4eFD|{)Q6EEVN__cTm z=fy$s-}t9EB;LWd;+Xgd-Qv&UQ{ID4iO-3|S@9JK@wNDdr1(|}(xjATGDwSzA(M=i zab%N2q)st1UZzl-bjaZpFVkc?CCCh!OLjR*j-e#^LphdG3#3gM$L;y+4XZh`uW7Mc}h#5Yy indexLSB + 16 */ + testCaseNb = (byte) 7; + bRes = false; + try { + TerminalProfile.getValue((short)0x0021, (short)0x0010); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 8: indexMSB = indexLSB + 16 */ + testCaseNb = (byte) 8; + bRes = false; + try { + TerminalProfile.getValue((short)0x0020, (short)0x0010); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + /** Test Case 9: indexMSB is outside data available */ + testCaseNb = (byte)9; + bRes = false; + + try { + bRes = (TerminalProfile.getValue((short)121, (short)115) == (short)0x001F); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/Test_Api_2_Tep_Gval.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/Test_Api_2_Tep_Gval.java new file mode 100644 index 0000000..dea080f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/Test_Api_2_Tep_Gval.java @@ -0,0 +1,79 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for TerminalProfile class + * getValue() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tep_gval; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tep_Gval extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tep_gval"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tep_Gval() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // test script + test.reset(); + + // test case 1: send a status command to trigger the applet without terminal profile + test.status("00","00","04"); + + // test case 2 to 9 + test.reset(); + test.terminalProfileSession("A901D2F0 00000000 00000000 008DFF"); + + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "09CCCCCC CCCCCCCC CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/applet.opt new file mode 100644 index 0000000..7383d9c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tep_gval.Api_2_Tep_Gval_1 +uicc.test.toolkit.api_2_tep_gval +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/javacard/api_2_tep_gval.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tep_gval/javacard/api_2_tep_gval.cap new file mode 100644 index 0000000000000000000000000000000000000000..403c805ee107bb119d2327acb3fe2fa8f293adf3 GIT binary patch literal 4815 zcmbVP3s6+o8UD__ci9IISJ+h)kcapP;;v{gD!xELk%vSu@lj)Umy4_{>~?oWF^R70 zBUY@M7~dU(2C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4-OaqkC9svuLqq7?J9Y{Y>A_ zV-O`>lTIif;vW!yy_0Veme`$*8C7Q9De$#c0TTKx87LV83Jo?V65*MgQ z!71WhLPaf5g`gk_X|P#DpsNc(Hr;~Ld|n-s$9*fxLE3eZ5N%fvUoJnP6)W&1e%M4TNNv!)Z4OF4urxz-p^-IVZFTHWAp` zd4db5r$9zN7cT|PfOY=CC|+t39OOjgVuE3gDhO3#l6o^0yCe>IQ;r=}|4@PoFETx+ z$1t2G%v>5@aAajaw3b4eB?`4PjD%6>!+6GP zISb=hr0;nANN9tCOyVCFU}8^{Df>%yuDMd$m?d$I$A8uGk z59vQ1)lm{HgK_(>=EkSx5Y~qwbLc_F`&u0-g0x-nA>`rl4;;a-d69xhTN58hXHX!% zMn#Gs?MZwH8ceys-SBlNQUqzg;X~*M3Sp2m2D=X_jx6<-P?E$=><^FhH#ioFy@TG@Rt+1Mxs?u~z)m!e3E ct`Ef%B+5Vut}NwnAt3pN!e-pqLN6Qt3*fX7nE(I) literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/Api_2_Tke_Thit_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/Api_2_Tke_Thit_1.java new file mode 100644 index 0000000..79c4d04 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/Api_2_Tke_Thit_1.java @@ -0,0 +1,149 @@ +//----------------------------------------------------------------------------- +//Api_4_Aex_Thit_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tke_thit; + +import uicc.test.util.* ; +import uicc.toolkit.*; +import javacard.framework.* ; + + +public class Api_2_Tke_Thit_1 extends TestToolkitApplet +{ + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Tke_Thit_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Api_2_Tke_Thit_1 thisApplet = new Api_2_Tke_Thit_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0,(short) MenuInit.length, (byte) 0, false,(byte) 0, (short) 0); + } + + /** + * Method called by the Cat Re + */ + public void processToolkit(short event) + { + // Number of tests + byte testCaseNb = (byte)0; + // Result of tests + boolean bRes = false; + + /** Test Case 1 : Throws the JCRE instance of ToolkitException with the specified reason 0 */ + testCaseNb = (byte)1; + bRes = false ; + try { + ToolkitException.throwIt((short) 0); + } + catch (ToolkitException ToolEx) { + bRes= (ToolEx.getReason() == (short)0); + } + catch( Exception e ) { + // Error, throw not as a ToolkitException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 2 : Throws the JCRE instance of ToolkitException with the specified reason 1*/ + testCaseNb = (byte)2; + bRes = false ; + + try { + ToolkitException.throwIt((short) 1); + } + catch (ToolkitException ToolEx) { + bRes = (ToolEx.getReason() == (short)1 ); + } + catch( Exception e ) { + // Error, throw not as a ToolkitException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 3 : Throws the JCRE instance of ToolkitException with the specified reason 0xA55A*/ + testCaseNb = (byte)3; + bRes = false ; + + try { + ToolkitException.throwIt((short) 0xA55A); + } + catch (ToolkitException ToolEx) { + bRes = (ToolEx.getReason() == (short)0xA55A ); + } + catch( Exception e ) { + // Error, throw not as a ToolkitException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 4 : ToolkitException extends javacard.framework.CardRuntimeException reason 0*/ + testCaseNb = (byte)4; + bRes = false ; + + try { + ToolkitException.throwIt((short) 0); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)0 ); + } + catch( Exception e ) { + // Error, throw not as a ToolkitException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 5 : ToolkitException extends javacard.framework.CardRuntimeException reason 1*/ + testCaseNb = (byte)5; + bRes = false ; + + try { + ToolkitException.throwIt((short) 1); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)1 ); + } + catch( Exception e ) { + // Error, throw not as a ToolkitException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + /** Test Case 6 : ToolkitException extends javacard.framework.CardRuntimeException reason 0xA55A*/ + testCaseNb = (byte)6; + bRes = false ; + + try { + ToolkitException.throwIt((short) 0xA55A); + } + catch (CardRuntimeException CardEx) { + bRes = (CardEx.getReason() == (short)0xA55A ); + } + catch( Exception e ) { + // Error, throw not as a ToolkitException + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/Test_Api_2_Tke_Thit.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/Test_Api_2_Tke_Thit.java new file mode 100644 index 0000000..496d235 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/Test_Api_2_Tke_Thit.java @@ -0,0 +1,86 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tke_thit; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Api_2_Tke_Thit extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tke_thit"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Tke_Thit() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1-6 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("09030120"); + + // Trigger Applet + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "06" + "CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Delete Applet and package */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/applet.opt new file mode 100644 index 0000000..55d950a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tke_thit.Api_2_Tke_Thit_1 +uicc.test.toolkit.api_2_tke_thit +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/javacard/api_2_tke_thit.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tke_thit/javacard/api_2_tke_thit.cap new file mode 100644 index 0000000000000000000000000000000000000000..facc4168640543973b26c825da2b5062696b06ea GIT binary patch literal 4607 zcmbVPdr*|u75{yYeSmN5_7e^X2l@sd*o2SK@5j4wcwaE+iBwrjK6T`fT2pT?dcs`@_h$w2*1i_3dX@ zJb!5G*e&C3%9)>y-qZQI*&=d9m`ywR~^m%UHHD45e@CL9y@%d;qlpj`QoenJ02>2zkbY)qPf>&k_*Nz zn7r+8u?hbfKGHBcdY^J5YC=lcu?1fHki|cgoM^;Q~dg z8yB*NeRX>3C(q^{jNG*^bx2ZYZ27IQZ#&}*PyYGFyJ>k3R_{Mkb>(c;m8I32<&XaO zL5^)rR&)IO-{okhk`@i^=x9H%f6B4B=MH@E%8>fvh32;s6mHoTC2uS55JZF z=(b7qUoVen{w(b1wr_S1dtmCplmC7E+lw1!B-~7iD1Ftw24%%2b9Y_GF0TZ|yqCuQ_H=DG9Z2RfK~qTgS{<-w zmffS-d@j#QVUmm_WRs%!HxDt=It;~ls%utXh71V?Rnj@aJ8wbE2ucVF&Jnq8w?p#@ zR0UBw2S~(n^xvV=vgxls&f`T5ZkNXoq#|4I>ua=ImP|YOuSOzlzk?XcS@gby)Zd=t z$+zYg@U@@^NCWqHzRT(LS)INz-W0KY16>^{)4y^H(fHp8Sd|vYB(sro2CA3ZLP+6| z*76)$4KTKaONyWtgea{BopDvOUpyVhRf4ieK^W(-dcDFbBVvI37D(L)WeDJfRvB$( zDYVU`y8-{Zg|79K5ER@EDAjy*t|bD@B&`d>9&Y?K2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/Api_2_Tkr_Asid_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_1.java new file mode 100644 index 0000000..868af27 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_1.java @@ -0,0 +1,213 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_asid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.system.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, ToolkitRegistry interface, allocateServiceIdentifier() method + * applet 1 + */ +public class Api_2_Tkr_Asid_1 extends TestToolkitApplet { + + private byte testCaseNb = 0; + private static boolean bRes; + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'1'}; + + // Service ID value range + private static short MIN_SERVICE_ID = 0; + private static short MAX_SERVICE_ID = 7; + + // Service expiration counter + short serviceExpiration = (short)(MAX_SERVICE_ID + 1); + + // Service ID array : initially all at '8' which is not a correct Service ID + public static byte[] Services = {(byte)8,(byte)8,(byte)8,(byte)8, + (byte)8,(byte)8,(byte)8,(byte)8}; + + private static byte[] abServiceRecord = {(byte)0x00, (byte)0x00, (byte)0x00}; + + // Constructor of the applet + public Api_2_Tkr_Asid_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Asid_1 thisApplet = new Api_2_Tkr_Asid_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short)0, + (short)MenuInit.length, (byte)0, false, + (byte)0, (short)0); + } + + /** + * Method called by the processToolkit() method to know if short + * has already been added to array + */ + public static boolean isInArray(short temp, byte[] Array) { + boolean isInArray = false; + + for (byte i = 0; (i < (byte)Array.length) && (!isInArray); i++) { + isInArray = (Array[i] == temp); + } + return isInArray; + } + + /** + * Method called by the processToolkit() method to know if an ID + * belongs to the Service ID interval + */ + public static boolean isServiceID(byte ID) { + boolean isServiceID; + + isServiceID = (ID > (byte)(MIN_SERVICE_ID - 1)) && (ID < (byte)(MAX_SERVICE_ID + 1)); + return isServiceID; + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + byte temp = 0; + byte TLV; + byte ServiceID; + short i; + + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler(); + + if (event == EVENT_MENU_SELECTION) { + switch (testCaseNb) { + case (byte)0x00: + // ----------------------------------------------------------------- + // Test Case 1: Allocates up to 8 services + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + bRes = true; + + try { + for (i=(short)0; (i<(short)8) && (bRes);i++) { + temp = obReg.allocateServiceIdentifier(); + bRes = (isServiceID(temp)) && (!this.isInArray(temp,Services)); + Services[i] = temp; + + // DECLARE SERVICE proactive command + abServiceRecord[1] = temp; + proHdlr.init(PRO_CMD_DECLARE_SERVICE, (byte)0x00 /*Add*/, (byte)DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_SERVICE_RECORD, abServiceRecord, (short)0x00, (short)abServiceRecord.length); + proHdlr.send(); + + bRes &= obReg.isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION); + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + case (byte)0x09: + // ----------------------------------------------------------------- + // Test Case 3: Allocates up to 5 services + // ----------------------------------------------------------------- + testCaseNb = (byte)0x0A; + bRes = true; + + // re-initialize Services[] array, for comparison of service id + for (byte k = 0; k<(byte)Services.length; k++) { + Services[k] = (byte)8; + } + + // allocate 5 Service ID. Check there are not already allocated. + try { + for (i=(short)0; (i<(short)5) && (bRes);i++) { + temp = obReg.allocateServiceIdentifier(); + bRes = (isServiceID(temp)) && (!this.isInArray(temp,Services)); + Services[i] = temp; + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + case (byte)0x0A: + // ----------------------------------------------------------------- + // Second triggering: Release all 5 services + // ----------------------------------------------------------------- + testCaseNb = (byte)0x0B; + try { + for (i=(short)0; i<(short)5; i++) { + obReg.releaseServiceIdentifier(Services[i]); + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + break; + } + } + + /** Test Case 2: Check applet is triggered by envelope + * (EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) command + * release all Service ID. + */ + if (event == EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) { + + //testCaseNb 0x02...0x09 + testCaseNb++; + + bRes = true; + // Get the system instance of the ProactiveHandler class + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + // find Service ID + TLV = envHdlr.findTLV(TAG_SERVICE_RECORD, (byte)1); + if(TLV != TLV_NOT_FOUND){ + // get the Service ID + ServiceID = envHdlr.getValueByte((short)1); + + try { + obReg.releaseServiceIdentifier((byte)ServiceID); + } + catch (Exception e) { + bRes = false; + } + if (--serviceExpiration == 0) { + //testCaseNb 0x09 + bRes = bRes & !obReg.isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION); + reportTestOutcome(testCaseNb, bRes); + } else { + //testCaseNb 0x02...0x08 + reportTestOutcome(testCaseNb, bRes); + } + } else { + reportTestOutcome(testCaseNb, false); + } + + + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_2.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_2.java new file mode 100644 index 0000000..9b1fb2f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_2.java @@ -0,0 +1,104 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_asid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.system.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * uicc.toolkit package, ToolkitRegistry interface, allocateServiceIdentifier() method + * applet 2 + */ +public class Api_2_Tkr_Asid_2 extends TestToolkitApplet { + + private byte testCaseNb; + private static boolean bRes; + + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'2'}; + + // Constructor of the applet + public Api_2_Tkr_Asid_2() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Asid_2 thisApplet = new Api_2_Tkr_Asid_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, (short) MenuInit.length, (byte) 0, + false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + byte temp = 0; + short i; + + switch (testCaseNb) { + case 0: + // ----------------------------------------------------------------- + // Test Case 4: call 3 times allocateServiceIdentifier() method + // ----------------------------------------------------------------- + testCaseNb = (byte) 1; + bRes = true; + + try { + for (i=(short)5; (i<(short)8) && (bRes); i++) { + temp = obReg.allocateServiceIdentifier(); + bRes = (!Api_2_Tkr_Asid_1.isInArray(temp,Api_2_Tkr_Asid_1.Services)); + Api_2_Tkr_Asid_1.Services[i] = temp; + } + + // call 1 more allocateServiceIdentifier() method + obReg.allocateServiceIdentifier(); + bRes = false; + } + catch (ToolkitException e) { + bRes = bRes && (e.getReason() == ToolkitException.NO_SERVICE_ID_AVAILABLE); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + case 1: + // ----------------------------------------------------------------- + // Test Case 5: Allocate services more than the maximum to this applet + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + bRes = false; + try { + obReg.allocateServiceIdentifier(); + bRes = true; + obReg.allocateServiceIdentifier(); + bRes = false; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.NO_SERVICE_ID_AVAILABLE); + } + reportTestOutcome(testCaseNb, bRes); + break; + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_3.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_3.java new file mode 100644 index 0000000..fcf8f5d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Api_2_Tkr_Asid_3.java @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_asid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.system.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * uicc.toolkit package, ToolkitRegistry interface, allocateServiceIdentifier() method + * applet 3 + */ +public class Api_2_Tkr_Asid_3 extends TestToolkitApplet { + + private byte testCaseNb; + private static boolean bRes; + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'3'}; + + // Constructor of the applet + public Api_2_Tkr_Asid_3() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Asid_3 thisApplet = new Api_2_Tkr_Asid_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, (short) MenuInit.length, (byte) 0, + false, (byte) 0, (short) 0); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + // ----------------------------------------------------------------- + // Test Case 5: Allocate services more than the maximum to this applet + // ----------------------------------------------------------------- + testCaseNb = (byte) 1; + bRes = false; + + try { + obReg.allocateServiceIdentifier(); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.NO_SERVICE_ID_AVAILABLE); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Test_Api_2_Tkr_Asid.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Test_Api_2_Tkr_Asid.java new file mode 100644 index 0000000..6ca3fad --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/Test_Api_2_Tkr_Asid.java @@ -0,0 +1,159 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * allocateServiceIdentifier() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_asid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Asid extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_asid"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 20020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 20020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 20030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 20030102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Asid() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + + public boolean run() { + + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "08"); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0102" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "04"); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0103" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09010000 0040"); + + // test case 1: trigger applet1 + response = test.envelopeMenuSelection("100101",""); + + // fetch 8 DECLARE SERVICE + for (int i=0; i<8 ;i++) { + char serviceID; + String check, data; + + result &= response.checkSw("9110"); + response = test.fetch("10"); + + // check that we received a ADD SERVICE command + data = response.getData(); + serviceID = data.charAt(data.lastIndexOf("4103000") + 7); + check = "D00E8103 01470082 02818241 03000X00".replace('X', serviceID); + result &= response.checkData(check); + + response = test.terminalResponse("81030147 00820282 81830100"); + } + + // test case 2: trigger applet1 with EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION event + response = test.envelopeEventDownloadLocalConnection("41030000 00"); + result &= response.checkSw("9000"); + response = test.envelopeEventDownloadLocalConnection("41030002 00"); + result &= response.checkSw("9000"); + response = test.envelopeEventDownloadLocalConnection("41030006 00"); + result &= response.checkSw("9000"); + response = test.envelopeEventDownloadLocalConnection("41030003 00"); + result &= response.checkSw("9000"); + response = test.envelopeEventDownloadLocalConnection("41030007 00"); + result &= response.checkSw("9000"); + response = test.envelopeEventDownloadLocalConnection("41030005 00"); + result &= response.checkSw("9000"); + response = test.envelopeEventDownloadLocalConnection("41030001 00"); + result &= response.checkSw("9000"); + response = test.envelopeEventDownloadLocalConnection("41030004 00"); + result &= response.checkSw("9000"); + + // test case 3: trigger applet1, applet2 then applet1 + response = test.envelopeMenuSelection("100101",""); + result &= response.checkSw("9000"); + response = test.envelopeMenuSelection("100102",""); + result &= response.checkSw("9000"); + response = test.envelopeMenuSelection("100101",""); + result &= response.checkSw("9000"); + + // test case 4: trigger applet3 then applet2 + response = test.envelopeMenuSelection("100103",""); + result &= response.checkSw("9000"); + response = test.envelopeMenuSelection("100102",""); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "0BCCCCCC CCCCCCCC CCCCCCCC"); + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "02CCCC"); + + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "01CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/applet.opt new file mode 100644 index 0000000..9e4176e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x02:0x00:0x01 uicc.test.toolkit.api_2_tkr_asid.Api_2_Tkr_Asid_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x03:0x00:0x01 uicc.test.toolkit.api_2_tkr_asid.Api_2_Tkr_Asid_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_asid.Api_2_Tkr_Asid_1 +uicc.test.toolkit.api_2_tkr_asid +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/javacard/api_2_tkr_asid.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_asid/javacard/api_2_tkr_asid.cap new file mode 100644 index 0000000000000000000000000000000000000000..3d43f0c38920abeca9016036da26401a8d313942 GIT binary patch literal 4514 zcmb7H3s98T6+ZXB|7#yCySTe9tgy&K7au&

~JQ1tlVAs9+P+DJ<(6K#&y{A4qgr z`p_cS(#dEuHIZTmYlIpb?X(#)CXTi;X{I`DowU)6jfp1KKGJBMHcHRk6?gY>g<)J561vT zs@Js!bB((eUSIs#mYw#~=NH|vw!e7d?ep4`&s<*8(WgFc92(zse!J`VEpu&B>dmg3 zT?ZT+_a6Lo{hK-2?cbketh3gPbl<4>r{#_2vG`=`cWxyDhAQ%OB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$(SZubn}zFf zSbW9^t3sAys5(igx9fvHiZM6Kr^;pdDX8j9YJFlP0gs) z-i;Nl9yF|VGduiL*c@c8mXqsEnl-a@_Qi2hs$NJpiIP#Hu_qeTb91$#HhoT_m;u|R z39Cg}&1-p)SItvROV@}pRZ&SN^MWMEf>te4t!#)7N#k*1kPI@NMm1WE${=e*in}E- z{CbL7#8-8)C`lSwrfLx%l}4r$>v1@fWE$)G%zq1m19*WjDwt9}mU`PgZH+$cl$hrl zvLE{oz_808baO!&FCrD{gZgpo0lDzNhX-|lV?s@UXG45|4}D4j%I-0Ovu-GZI!rE` zs$e~Ah53x + * has already been added to array + */ + private boolean isInArray(short temp, short[] Array) { + boolean isInArray = false; + + for(short i = ((short) (Array.length-1)); ((i > (short) -1) && (!isInArray)); i--) { + isInArray = (Array[i] == temp); + } + return isInArray; + } + + /** + * Method called by the processToolkit() method to know if an ID + * belongs to the timer ID interval + */ + private boolean isTimerID(short ID) { + boolean isTimerID; + + isTimerID = (ID>(short)(MIN_TIMER_ID-1)) && (ID<(short)(MAX_TIMER_ID+1)); + return isTimerID; + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + short temp = 0; + short i; + + byte TLV; + byte TimerID; + + + if (event == EVENT_MENU_SELECTION) { + // ----------------------------------------------------------------- + // Test Case 1: 8 * allocateTimer() + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + bRes = true; + + try { + for (i=(short)0; (i<(short)8) && (bRes);i++) { + temp = obReg.allocateTimer(); + bRes = (isTimerID(temp)) && (!this.isInArray(temp,Timers)); + Timers[i] = temp; + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2: Max timer rushed + // The applet allocates 1 more timer + // Shall throw a ToolkitException + // with reason NO_TIMER_AVAILABLE + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + bRes = false; + + try { + temp = obReg.allocateTimer(); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.NO_TIMER_AVAILABLE); + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3: Initialiation of the test case. + // shall be set at true only if the applet is triggered + // by an 8 EVENT_TIMER_EXPIRATION + // ----------------------------------------------------------------- + testCaseNb = (byte)3; + bRes = true; + } + + // ----------------------------------------------------------------- + // Test Case 3: Call releaseTimer(id) each time a timer expires + // ----------------------------------------------------------------- + if (event == EVENT_TIMER_EXPIRATION) { + // Get the system instance of the EnvelopeHandler class + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + // find timer ID which has expired + TLV = envHdlr.findTLV(TAG_TIMER_IDENTIFIER, (byte)1); + if(TLV != TLV_NOT_FOUND){ + // get the timer ID + TimerID = envHdlr.getValueByte((short)0); + + try { + obReg.releaseTimer((byte) TimerID); + } + catch (Exception e) { + bRes = false; + } + + if (--j==0) { + reportTestOutcome(testCaseNb, bRes); + } + } else { + reportTestOutcome(testCaseNb, false); + } + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_2.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_2.java new file mode 100644 index 0000000..2319279 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_2.java @@ -0,0 +1,122 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_atim; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.system.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * uicc.toolkit package, ToolkitRegistry interface, allocateTimer() method + * applet 2 + */ +public class Api_2_Tkr_Atim_2 extends TestToolkitApplet { + + private byte testCaseNb; + private static boolean bRes; + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'2'}; + + //Timer ID value range + private static short MIN_TIMER_ID = 1; + private static short MAX_TIMER_ID = 8; + + // Timer ID array : initially all at '0' which is not a correct Timer ID + short[] Timers = {(short)0, (short)0, (short)0, (short)0}; + + // Constructor of the applet + public Api_2_Tkr_Atim_2() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Atim_2 thisApplet = new Api_2_Tkr_Atim_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, + (short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + + /** + * Method called by the processToolkit() method to know if short + * has alread been added to an array + */ + private boolean isInArray(short temp, short[] Array) { + boolean isInArray = false; + + for(short i = ((short) (Array.length-1)); ((i > (short) -1) && (!isInArray));i--) { + isInArray = (Array[i] == temp); + } + return isInArray; + } + + /** + * Method called by the processToolkit() method to know if an ID + * belongs to the timer ID interval + */ + private boolean isTimerID(short ID) { + boolean isTimerID; + + isTimerID = (ID>(short)(MIN_TIMER_ID-1)) && (ID<(short)(MAX_TIMER_ID+1)); + return isTimerID; + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + short temp = 0; + short i; + // ----------------------------------------------------------------- + // Test Case 4: 4 * allocateTimer() + // No exception shall be thrown. + // Timer ID returned shall be between + // 0x01 and 0x08 inclusive. + // It shall be different after each call. + // ----------------------------------------------------------------- + testCaseNb = (byte) 1; + bRes = true; + + try { + for (i=(short)0; (i<(short)4) && (bRes); i++) { + temp = obReg.allocateTimer(); + bRes = (isTimerID(temp)) && (!this.isInArray(temp,Timers)); + Timers[i] = temp; + } + } + catch (Exception e) { + bRes = false; + } + + for (i=(short)0; (i<(short)4) && (bRes); i++) { + if (isTimerID(Timers[i])) { + try { + obReg.releaseTimer((byte) Timers[i]); + } + catch (Exception e) { + } + } + } + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_3.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_3.java new file mode 100644 index 0000000..9249d6d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Api_2_Tkr_Atim_3.java @@ -0,0 +1,76 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_atim; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.system.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * uicc.toolkit package, ToolkitRegistry interface, allocateTimer() method + * applet 3 + */ +public class Api_2_Tkr_Atim_3 extends TestToolkitApplet { + + private byte testCaseNb; + private static boolean bRes; + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'3'}; + + // Constructor of the applet + public Api_2_Tkr_Atim_3() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // create a new applet instance + Api_2_Tkr_Atim_3 thisApplet = new Api_2_Tkr_Atim_3(); + + // register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // initialise the data of the test applet + thisApplet.init(); + + // registration to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, + (short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + // ----------------------------------------------------------------- + // Test Case 5: The applet allocates 1 timer + // Shall throw a ToolkitException + // with reason NO_TIMER_AVAILABLE + // ----------------------------------------------------------------- + testCaseNb = (byte)0x01; + bRes = false; + + try { + obReg.allocateTimer(); + } + catch (ToolkitException e) { + bRes = e.getReason() == ToolkitException.NO_TIMER_AVAILABLE; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Test_Api_2_Tkr_Atim.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Test_Api_2_Tkr_Atim.java new file mode 100644 index 0000000..9eb4f32 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/Test_Api_2_Tkr_Atim.java @@ -0,0 +1,140 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * allocateTimer() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_atim; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Atim extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_atim"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 20020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 20020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 20030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 20030102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Atim() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("0101"); + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "04" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0102" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("0101"); + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0103" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09010020"); + + // test case 1 to 3: trigger applet1 + response = test.envelopeMenuSelection("100101",""); + result = response.checkSw("9000"); + + // all timers expire + response = test.envelopeTimerExpiration("240108"); + result &= response.checkSw("9000"); + response = test.envelopeTimerExpiration("240107"); + result &= response.checkSw("9000"); + response = test.envelopeTimerExpiration("240106"); + result &= response.checkSw("9000"); + response = test.envelopeTimerExpiration("240105"); + result &= response.checkSw("9000"); + response = test.envelopeTimerExpiration("240104"); + result &= response.checkSw("9000"); + response = test.envelopeTimerExpiration("240103"); + result &= response.checkSw("9000"); + response = test.envelopeTimerExpiration("240102"); + result &= response.checkSw("9000"); + response = test.envelopeTimerExpiration("240101"); + result &= response.checkSw("9000"); + + // test case 4: trigger applet2 + response = test.envelopeMenuSelection("100102",""); + result &= response.checkSw("9000"); + + // test case 5: trigger applet3 + response = test.envelopeMenuSelection("100103",""); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "03CCCCCC"); + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01CC"); + + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "01CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/applet.opt new file mode 100644 index 0000000..13122a0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x02:0x00:0x01 uicc.test.toolkit.api_2_tkr_atim.Api_2_Tkr_Atim_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x03:0x00:0x01 uicc.test.toolkit.api_2_tkr_atim.Api_2_Tkr_Atim_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_atim.Api_2_Tkr_Atim_1 +uicc.test.toolkit.api_2_tkr_atim +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/javacard/api_2_tkr_atim.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_atim/javacard/api_2_tkr_atim.cap new file mode 100644 index 0000000000000000000000000000000000000000..c82f595a9661875961ef63090ce4514793f3cb64 GIT binary patch literal 4310 zcmbVP4Nz3q6+ZXgx9`3E0Tx)+g>_j#FG`c-^7kupNbO!Qv zzPxwhi7OY!cylVZ1jJ3s& zF9D2hc+TCGW!jVS$DP~VHEu2fX^ z4;`<&T048|?Y7rUN0t}JHs%j+Li+G%Agx$V&(?i#+ z&U5cZK*1~Dt@wB-@vSQZzq>rJdudVL-m9Bqb8GkR{p~Ne#IApPe$2W#f3>GB-fNG( zJ}~^npDxxtI9c|2Y0vQO)?0_(YEF6gU%$CNe7tf|#j`)Klz;4+cjmoISDS5D%Rl?W zp^ECE#$yjW>kkYLE_mm3*FT5Khd({_NMBYW$wwcg_8cMrk2L^gxVXB&lJdoUeA1t1 z!#j?}h-Oz!O{Uk`!LUuXrj6r5s;JOrLJ0tI=8GbvJ&GGg7ca z93mI;;3O2XHIM~f0CEZIRRyF<_1WdFpWA$LT1Mj$pHupm8B~M4=QW9s&uq z=ln+3*lB#sk&BrAsua0*G=JcQiHeNQh8a7Vv?2|)>e!oizOj}8aLg=i);hg)?rq#GiLH_0 zGv5-D4hB*TGAV;FQtXq-HoSk)rzIm`pf2BHdKlX=pMjnS1G8a_QXq`kd@@@K2943u z2lFkvA$&hrjPigXpRuL+0z!ij5fTDb^Nsw*h$S^Tzh7Hv!4nPziWSlGXGl-^Xf?25kT8zm0DMSltno(-jU{|M|GEe>w zK`44UYCkwkPfYP>vCGh=wuu#y{&y+%34y@R!oXXm1U?o6A7|~>w8Lx+{Oqq5c-uta zk9Gz&v=gEDL zRBam7@a}WLu!yOGhw_D*7ubT=aR~6rYpP=M-zV)DCIrbJ|p& zSrXdJ_kjhYQo!Ckk2O6mWKkD*v>9B1r-Ix83wmK;Tj=X~@wL1fzFBZAMNEIwSntK7 zwWiqRtPi}SGM;Aq9AgZm;Q5pNq?hxgw+J<4+z$f?wIuG?A1~}e3pi$GNrkhv)Lnzt zxOec~LW`%Wy)?~MrHc%=>BJP>{1{QAPqbCyeS((S=EsV2p8s3g1G8lMZ?94as~ObQuEJ1?`80io zklI&GqONTflJhenQ7Tbg$h`8Q_K z^gSt>tn$Jm*M*pIK*^a+%LP0gS_WfX=~?MxU{XO5aieS|19CuT&WI#AR!>b+f| d@!^X){dk4$^kpR){4T&<9DiB3umc8u_g}HID(V0L literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/Api_2_Tkr_Cevt_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/Api_2_Tkr_Cevt_1.java new file mode 100644 index 0000000..bc5fe19 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/Api_2_Tkr_Cevt_1.java @@ -0,0 +1,231 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_cevt; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.access.*; +import uicc.toolkit.* ; +import javacard.framework.* ; +import uicc.test.util.* ; + +/** + * uicc.toolkit package, ToolkitRegistry interface, clearEvent() method + * applet 1 + */ +public class Api_2_Tkr_Cevt_1 extends TestToolkitApplet { + + // Not allowed events for the ClearEvent() method + private static short[] NOT_ALLOWED_CLEAR_EVENTS = { EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, + EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND, + EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION}; + + // Not supported events for the setEvent() method + private static short NOT_SUPPORTED_SETEVENT_10 = 10; + private static short NOT_SUPPORTED_SETEVENT_24 = 24; + + // Event value range + private static short MIN_EVENT_NB = 7; + private static short MAX_EVENT_NB = 29; + + // Events allowed and supported for clearEvent() method + private static short MAX_EVENT = 22; // 27 events - 5 not allowed events + private short[] EventList = new short[MAX_EVENT]; + + // Indicate if that applet has already been triggered once + // -->all events have been cleared + private boolean eventsCleared = false; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Cevt_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Cevt_1 thisApplet = new Api_2_Tkr_Cevt_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the processToolkit() method to know if event + * is an allowed event for the clearEvent() method + */ + private boolean isEventAllowed(short event) { + boolean allowed = true; + + for(short i = 0; (i < NOT_ALLOWED_CLEAR_EVENTS.length) && (allowed); i++) { + allowed = (NOT_ALLOWED_CLEAR_EVENTS[i] != event); + } + return allowed; + } + + /** + * Method called by the processToolkit() method to know if event + * is a supported event for the setEvent() method + */ + private boolean isEventSupported(short event) { + return (((event != NOT_SUPPORTED_SETEVENT_10) + &&(event != NOT_SUPPORTED_SETEVENT_24) + && (event >= MIN_EVENT_NB) + && (event <= MAX_EVENT_NB)) + || (event == EVENT_UNRECOGNIZED_ENVELOPE) + || (event == EVENT_PROFILE_DOWNLOAD) + || (event == EVENT_PROACTIVE_HANDLER_AVAILABLE) + || (event == EVENT_EXTERNAL_FILE_UPDATE) + || (event == EVENT_APPLICATION_DESELECT) + || (event == EVENT_FIRST_COMMAND_AFTER_ATR)); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + boolean bRes ; + byte testCaseNb ; + short j = 0; + + // Build the allowed and supported events list to be set AND clear + for(short i = MIN_EVENT_NB; i <= MAX_EVENT_NB;i++) { + + if ((this.isEventAllowed(i)) && (this.isEventSupported(i))) { + EventList[j] = i; + j++; + } + } + EventList[j++] = EVENT_UNRECOGNIZED_ENVELOPE; + EventList[j++] = EVENT_PROFILE_DOWNLOAD; + EventList[j++] = EVENT_PROACTIVE_HANDLER_AVAILABLE; + EventList[j++] = EVENT_APPLICATION_DESELECT; + EventList[j++] = EVENT_FIRST_COMMAND_AFTER_ATR; + EventList[j] = EVENT_EXTERNAL_FILE_UPDATE; + + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + // ----------------------------------------------------------------- + // Test Case 1 : Clear ALLOWED unregistered events + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + + bRes = false; + + for(short i=0; i < (short)(EventList.length); i++) { + bRes = false; + + if ((this.isEventAllowed(EventList[i])) && (this.isEventSupported(i))) { + try { + obReg.clearEvent(EventList[i]); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + if (obReg.isEventSet(EventList[i])) { + // A cleared event should not be set anymore + bRes = false; + break; + } + } + } + reportTestOutcome(testCaseNb,bRes); + + // ----------------------------------------------------------------- + // Test Case 2 : Clear registered events + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + bRes = false; + + // set all allowed and supported events + + try { + // Do not perform setEvent() with EVENT_EXTERNAL_FILE_UPDATE + for(short i=0; i < (short)(EventList.length - 1 ); i++) { + + if ((this.isEventAllowed(EventList[i])) && (this.isEventSupported(EventList[i]))) { + obReg.setEvent(EventList[i]); + } + } + // Register to EVENT_EXTERNAL_FILE_UPDATE + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, UICCSystem.getTheUICCView(JCSystem.NOT_A_TRANSIENT_OBJECT)); + bRes = true; + } + catch (Exception e) { // No exception should be thrown + bRes = false ; + } + + // clear all set events + if (bRes) { + try { + for(short i=0; i < (short)(MAX_EVENT); i++) { + + if (this.isEventAllowed(EventList[i])) { + obReg.clearEvent(EventList[i]); + + // check events are not set anymore + if(obReg.isEventSet(EventList[i])) { + bRes = false; + break; + } + } + } + } + catch (Exception e) { + bRes = false ; + } + } + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3 : Clear NOT ALLOWED events + // ----------------------------------------------------------------- + testCaseNb = (byte)3; + bRes = true; + + for (short i = 0; (i < NOT_ALLOWED_CLEAR_EVENTS.length) && (bRes); i++) { + bRes = false; + try { + obReg.clearEvent(NOT_ALLOWED_CLEAR_EVENTS[i]); + } + catch (ToolkitException e) { // Only EVENT_NOT_ALLOWED should be thrown + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + } + reportTestOutcome(testCaseNb, bRes); + + // -------------------------------------------------------------------- + // Test Case 4 : Check applet is not triggered by an + // envelope(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) command + // -------------------------------------------------------------------- + testCaseNb = (byte)4; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + } + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + testCaseNb = (byte)4; + reportTestOutcome(testCaseNb, false); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/Test_Api_2_Tkr_Cevt.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/Test_Api_2_Tkr_Cevt.java new file mode 100644 index 0000000..b647eea --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/Test_Api_2_Tkr_Cevt.java @@ -0,0 +1,81 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * clearEvent() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_cevt; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Cevt extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_cevt"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Cevt() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + // test script + test.reset(); + test.terminalProfileSession("0101"); + + // test case 1 to 3: trigger applet1 + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // test case 4: trigger applet1 + response = test.envelopeEventDownloadUserActivity(); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "04CCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/applet.opt new file mode 100644 index 0000000..90cd555 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_cevt.Api_2_Tkr_Cevt_1 +uicc.test.toolkit.api_2_tkr_cevt +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/javacard/api_2_tkr_cevt.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_cevt/javacard/api_2_tkr_cevt.cap new file mode 100644 index 0000000000000000000000000000000000000000..1d9584eeb8371376897f83563d83a23f908453e8 GIT binary patch literal 3629 zcmb7G4Qx}_6+ZXAU;oBQZO2J)5~2~3&^p*a3L&)lBMVJTQ=mUVY_>7(YR8FP$Dk~v z)JaI&k(8pcX;mdy3+swH3{o2?RZ-fmZ8BI?pj(UDBHFE^>o&1@s?s@0EcfNDaz3-gU(Z=y+knt=StXl;)9cJLcy?#r>Z5uYWRJ$8CZfIG*d5go{ zGJ75%xycr3ezLM-+flk~6i|3ki``=#N*5$B z73lKA?=61p^o@41bw%@~!c&u<&vv!W?D5*C{{7;rNlR6a=j1E3!A&vuvfsD=;)N&9 z{QR?HFHJ7lExx$@TuyPW?lM`c$=4mbe*Dxpf51U{j{Ixe$-i4Vua$iB*{351>W+9r zZ}cDh=f|HcnmKWzIxwUq@V_1pU8T9+B!|#g{D7<=p?mD475YuyLL<7Pc9zQBYIg_qWxNBV* zY8h@vES#=67z_C0k=PFzBZU$uM3`YCYy~Ub35%f}%}s+I2xtYOqJ3O+_2%PqhU{k9 z5RHZdamLAkSv5O?Ty>fA^HzOv=pH0t$c|`3cQg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zbMHIn zYJKbSq>s()deeq+@3QarAM*KSHaFu)M_2Nh=oNzk{q1c@g9DGXt}Od}o+jB*J7E z!o-3E}SsmJZdd87gNqTUx{gp(x@*?M1@bHVD2 z+rw~_>UoqG&XpS~E2&pX7?LId=KvMOwAC?CFA!BdFWdht&FKko=(JN_k#bD-g_aVE z;+a?;u1Y@84{8!41(I~UOOg+1#`_5n$QkeN8qC7dN;IiB;x zdf}SfkkzIW2JEm-JJ#SB9fsVGFMGtasv?{*urj#bL}jcs`e8(d&-uUkuP|h|KY>Nc zE-;)Ph-$U_%Q&-7JgddiM-}hYDa^MU>}F$z*;MX4iURI1O>~3>F0;aHM_aN3KP;bZ zD8*hX?@%*M^Rq2R#91onsTVP?CQs(L5HVngf(c~Rek`Nn7!|MJ9yJHMnghKe#|#xX z6{8b;6%2&)g7Z=aa6X*Cs{~by+CLyz?eDL`KhB0YT8way)%0zfVq4L9stG91bHfx< zrO{@#VyU41tD%LaX<+fSVC$HAp`Ld*tDhc?0!R$a8$@DhN@FCJrI}4)p$?-KiBYD5 zB4k69GlSAB(*`e)4}ix34OX#d@E4AX#2Jwg>2QFaRzAGPLL3PrV-yR+)({Q1CzkAB z$7;wVCN(dMFj_nV1K&@N*Jk?tP?!ISH_%gUFyLeHb;s_JrrymY$=(HJz( z32ud44v`mX7o@{0h^uVN3Gxc= baFileList.length + *******************************************************/ + + case 18: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1c, (short) 8, (short) 4, + null, (short) 0, (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 8, bRes); + break; + + /** Testcase 9 ***************************************** + * sOffset1 < 0 + *******************************************************/ + + case 19: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1a, (short) -1, (short) 4, + null, (short) 0, (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 9, bRes); + break; + + /** Testcase 10 **************************************** + * sLength1 > baFileList.length + *******************************************************/ + + case 20: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1c, (short) 0, (short) 10, + null, (short) 0, (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 10, bRes); + break; + + + /** Testcase 11 **************************************** + * sOffset1 + sLength1 > baFileList.length + *******************************************************/ + + case 21: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1c, (short) 5, (short) 4, + null, (short) 0, (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 11, bRes); + break; + + + /** Testcase 12 **************************************** + * sLength1 < 0 + *******************************************************/ + + case 22: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1a, (short) 0, (short) -1, + null, (short) 0, (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 12, bRes); + break; + + + /** Testcase 13 ***************************************** + * sOffset2 >= baFileList.length + *******************************************************/ + + case 23: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1a, (short) 0, (short) baFileList1a.length, + baADFAid15, (short) 15, (byte) 6 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 13, bRes); + break; + + + /** Testcase 14 ***************************************** + * sOffset2 < 0 + *******************************************************/ + + case 24: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1a, (short) 0, (short) baFileList1a.length, + baADFAid15, (short) -1, (byte) 6 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 14, bRes); + break; + + + /** Testcase 15 ***************************************** + * sLength2 > baFileList.length + *******************************************************/ + + case 25: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1a, (short) 0, (short) baFileList1a.length, + baADFAid15, (short) 0, (byte) 16 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 15, bRes); + break; + + + /** Testcase 16 ***************************************** + * sOffset2 + sLength2 > baFileList.length + *******************************************************/ + + case 26: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1a, (short) 0, (short) baFileList1a.length, + baADFAid15, (short) 10, (byte) 6 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 16, bRes); + break; + + + /** Testcase 17 ***************************************** + * ILLEGAL_VALUE Exception + *******************************************************/ + + case 27: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1a, (short) 0, (short) baFileList1a.length, + baADFAid18, (short) 0, (byte) 4 ); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.ILLEGAL_VALUE); + } + catch (Exception e) { + bRes = false; + } + + try { + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1a, (short) 0, (short) baFileList1a.length, + baADFAid18, (short) 0, (byte) 18 ); + } + catch (SystemException e) { + bRes &= (e.getReason() == SystemException.ILLEGAL_VALUE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome((byte) 17, bRes); + break; + + + /** Testcase 18 ***************************************** + * EVENT_MENU_SELECTION not allowed + *******************************************************/ + + case 28: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_MENU_SELECTION, + baFileList1a, (short) 0, (short) baFileList1a.length, + null, (short) 0, (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 18, bRes); + break; + + + /** Testcase 19 ***************************************** + * EVENT_MENU_SELECTION_HELP_REQUEST not allowed + *******************************************************/ + + case 29: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_MENU_SELECTION_HELP_REQUEST, + baFileList1a, (short) 0, (short) baFileList1a.length, + null, (short) 0, (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 19, bRes); + break; + + + /** Testcase 20 ***************************************** + * EVENT_TIMER_EXPIRATION not allowed + *******************************************************/ + + case 30: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_TIMER_EXPIRATION, + baFileList1a, (short) 0, (short) baFileList1a.length, + null, (short) 0, (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 20, bRes); + break; + + + /** Testcase 21 ***************************************** + * EVENT_STATUS_COMMAND not allowed + *******************************************************/ + + case 31: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_STATUS_COMMAND, + baFileList1a, (short) 0, (short) baFileList1a.length, + null, (short) 0, (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 21, bRes); + break; + + + /** Testcase 22 ***************************************** + * EVENT_NOT_SUPPORTED Exception + *******************************************************/ + + case 32: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_PROFILE_DOWNLOAD, + baFileList1a, (short) 0, (short) baFileList1a.length, + null, (short) 0, (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_SUPPORTED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 22, bRes); + break; + + } + } + + else if (event == EVENT_EXTERNAL_FILE_UPDATE) { + // If triggered on EVENT_EXTERNAL_FILE_UPDATE the applet stores the triggering File List in baFileList + sFileListLength = EnvelopeHandlerSystem.getTheHandler().findAndCopyValue(FILE_LIST_TAG, baFileList, (short)0); + hasBeenTriggered = true; + } + + else if (event == EVENT_CALL_CONTROL_BY_NAA) { + // If triggered on EVENT_CALL_CONTROL_BY_NAA the applet returns the latest triggering File List + EnvelopeResponseHandler envRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler(); + + if (hasBeenTriggered) { + envRespHdlr.appendArray(baFileList, (short) 0, (short) sFileListLength); + } + else { + envRespHdlr.appendTLV((byte)0x00, (byte)0x00); + } + + envRespHdlr.post(true); + + hasBeenTriggered = false; + } + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/Test_Api_2_Tkr_Drfes_Bss_Bsb.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/Test_Api_2_Tkr_Drfes_Bss_Bsb.java new file mode 100644 index 0000000..c2536b7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/Test_Api_2_Tkr_Drfes_Bss_Bsb.java @@ -0,0 +1,288 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 2 + * Test source for ToolkitRegistry interface + * deregisterFileEvent() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_drfes_bss_bsb; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Drfes_Bss_Bsb extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_drfes_bss_bsb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + static final String AID_ADF_1 = "A0000000 090005FF FFFFFF89 E0000002"; + + static final String MF = "3F00"; + static final String ADF = "7FFF"; + static final String DF_TEST = "7F4A"; + static final String DF_SUB_TEST = "5F10"; + static final String EF_TAA = "4F10"; + static final String EF_TARU = "6F03"; + static final String EF_CARU = "6F09"; + static final String EF_LARU = "6F0C"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Drfes_Bss_Bsb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00"); // LV ADF1 access domain DAP + + // test script + test.reset(); + response = test.terminalProfileSession("09030120"); + + + /** Testcase 1 ***************************************** + * Deregister EF under MF + *******************************************************/ + + test.unrecognizedEnvelope(); + + // update binary EF_TARU and check that applet is correctly triggered + result &= modifyEFandCheck(MF, EF_TARU, true); + result &= modifyEFandCheck(MF, EF_CARU, true); + result &= modifyEFandCheck(MF, EF_LARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, false); + result &= modifyEFandCheck(MF, EF_CARU, false); + result &= modifyEFandCheck(MF, EF_LARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_LARU, false); + + test.unrecognizedEnvelope(); + + + /** Testcase 2 ***************************************** + * Deregister DF under MF + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + + + /** Testcase 3 ***************************************** + * Deregister EF does not affect parent DF + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + result &= modifyEFandCheck(MF, EF_LARU, true); + + + /** Testcase 4 ***************************************** + * Deregister EF under ADF1 + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + result &= modifyEFandCheck(ADF, EF_CARU, true); + result &= modifyEFandCheck(ADF, EF_LARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, false); + result &= modifyEFandCheck(ADF, EF_CARU, false); + result &= modifyEFandCheck(ADF, EF_LARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_LARU, false); + + test.unrecognizedEnvelope(); + + + /** Testcase 5 ***************************************** + * Deregister DF does not affect child EF (under ADF1) + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + + + /** Testcase 6 ***************************************** + * Deregister EF does not affect parent DF (under ADF1) + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + result &= modifyEFandCheck(ADF, EF_LARU, true); + + + /** Testcase 7 - 20 ********************************** + * 7. NullPointerException Exception + * 8. sOffset1 >= baFileList.length + * 9. sOffset1 < 0 + * 10. sLength1 > baFileList.length + * 11. sOffset1 + sLength1 > baFileList.length + * 12. sLength1 < 0 + * 13. sOffset2 >= baFileList.length + * 14. sOffset2 < 0 + * 15. sLength2 > baFileList.length + * 16. sOffset2 + sLength2 > baFileList.length + * 17. ILLEGAL_VALUE Exception + * 18. EVENT_MENU_SELECTION not allowed + * 19. EVENT_MENU_SELECTION_HELP_REQUEST not allowed + * 20. EVENT_TIMER_EXPIRATION not allowed + * 21. EVENT_STATUS_COMMAND not allowed + * 22. EVENT_NOT_SUPPORTED Exception + *****************************************************/ + + for (int i=7; i<=22; i++ ) { + test.unrecognizedEnvelope(); + } + + + + /***************************************************** + * Restore modified files + *****************************************************/ + + // restore EF_CARU under ADF + test.selectApplication(AID_ADF_1); + test.selectFile(ADF); + test.selectFile(DF_TEST); + test.selectFile(EF_CARU); + test.updateRecord("00", "03", "AAAAAA"); + test.updateRecord("00", "03", "555555"); + + // restore EF_CARU under MF + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_CARU); + test.updateRecord("00", "03", "AAAAAA"); + test.updateRecord("00", "03", "555555"); + + + /***************************************************** + * Finish test + *****************************************************/ + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "16CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } + + + /** + * Check the File List which caused the latest EXTERNAL_FILE_UDPATE + * and compare it whith the File List given in parameter. + * If the applet has not been triggered it will return "000100" + */ + + private boolean appletTriggered(String data) { + response = test.envelopeCallControlByNAA(); + return response.checkData(data); + } + + + /** + * Perform an action on the specified EF in order to test + * if the test applet is triggered with an EXTERNAL_FILE_UDPATE event. + */ + + private boolean modifyEFandCheck(String mfadf, String fid, boolean shouldTrigger) { + + // select correct file + if (mfadf == ADF) test.selectApplication(AID_ADF_1); + test.selectFile(mfadf); + test.selectFile(DF_TEST); + if (fid == EF_TAA) test.selectFile(DF_SUB_TEST); + test.selectFile(fid); + + // modify the EF + if (fid == EF_CARU) test.increase("000001"); + else if (fid == EF_LARU) test.updateRecord("01","04","55555555"); + else test.updateBinary("0000", "FFFFFF"); + + // create the string to pass to appletTriggered() + String checkString = ("01" + MF); + if (mfadf == ADF) checkString += ADF; + + if (!shouldTrigger) checkString = "000100"; + else if (fid == EF_TARU) checkString += (DF_TEST + EF_TARU); + else if (fid == EF_CARU) checkString += (DF_TEST + EF_CARU); + else if (fid == EF_LARU) checkString += (DF_TEST + EF_LARU); + else if (fid == EF_TAA) checkString += (DF_TEST + DF_SUB_TEST + EF_TAA); + + // return the result of the triggering + return appletTriggered(checkString); + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/applet.opt new file mode 100644 index 0000000..3028bdc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_drfes_bss_bsb.Api_2_Tkr_Drfes_Bss_Bsb_1 +uicc.test.toolkit.api_2_tkr_drfes_bss_bsb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/javacard/api_2_tkr_drfes_bss_bsb.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfes_bss_bsb/javacard/api_2_tkr_drfes_bss_bsb.cap new file mode 100644 index 0000000000000000000000000000000000000000..26abc8b1691ae2d1de9426fe0b2a9140bd8fb768 GIT binary patch literal 6751 zcmb_g4R93Y8Gd)a{oni9yWCy&?nn$lG-!SRr4zvvBEJTZ7_e5Mav>ZN6Oto2!D7Ts zVm&Y<{73*x+d+#+#~%J6f>x#KXoXQbVjTrhQ5bDOM@MEDwPX5zdzakZk~ng8FYmqI zyYJ8Q?fZSVn|-Qh63zn>euC{+kAt+s102krIEJ_`l(vrPJkvX`XwUWSy^GF%^jLUqyFYq3|7dl~ zo8P{<@_{4wyjHyRtM0XbctmF2yJpu3W!lKDk3ZjW_u1lMJH*ImUU}O$)jPi(zO`|C z=S}XL&+V!Wltm9qMR({ccK-g|jrGso)cXE|e&?AL=%GF$rgqvNhp%TEPY_zv%jJpJ*E6HD0MKYF(c%yZobi#Ikt{O-B?W}Oxn zzCZo%e3!Is{97OHJg}mE_s#zA7ECzxV(!5@|Kl-mN`XzQFWR5;miUWnI%lqXQ<#4= zboyB6w9xrh&5dKM@93vT(>sOz>Y+cxjy3$H}0 z{@ph6`2NjJn@>MwD?Rt$;Wf9v&^zPA+=>@odU8?c@tco6SNe}R2kX9hW68PI_jj%O zOMM$#JyVpzs~ZCC48Um)pcASiF;z8k1coYFeM3GQr6a_^^v7y*e94Jl{4aJ2*PymHNVOfI#)-Y|a zfLdtRSlrhj0JD)8z@kVD#xNZ+Fr6%lh{6NYZpU+WK)+1d?F{L#GeUxA}WM^<#A^SEFRpna0}IR@xE)e3K3Efm^}(^3&T{=#UttL$p9%u}A)pwc!P# zWVuUbhoeiI7gJ18?HkMQFfQg_g#!MchMPZ$`b(owa6^GG%htl+`^rx z*P*==^&YfeLVd&-FFK(>^cy~L4C)ESC1M@wWoZ8n^%f%_K8gBoXupH{lo5~^D3Dac zCyhWo4!qJV7%q)7ywY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/uicc/test/toolkit/api_2_tkr_drfeso/Api_2_Tkr_Drfeso_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/Api_2_Tkr_Drfeso_1.java new file mode 100644 index 0000000..f4cd80b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/Api_2_Tkr_Drfeso_1.java @@ -0,0 +1,456 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_drfeso; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import uicc.access.*; +import javacard.framework.* ; +import uicc.test.util.* ; + +/** + * uicc.toolkit package, ToolkitRegistry interface, registerFileEvent() method + * applet 1 + */ +public class Api_2_Tkr_Drfeso_1 extends TestToolkitApplet { + + private boolean bRes = true; + private byte callNb = 1; + + private byte[] adf1Aid = null; + private FileView uiccFileView = null; + private FileView adf1FileView = null; + + private boolean hasBeenTriggered = false; + private byte[] baFileList = null; + private short sFileListLength = 0; + + private byte[] baFileList1 = { + (byte)0x03, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0x4A, (byte)0x6F,(byte)0x03, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0x4A, (byte)0x6F,(byte)0x09, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0x4A, (byte)0x6F,(byte)0x0C + }; + + private byte[] baFileList2 = { + (byte)0x02, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0x4A, (byte)0x6F,(byte)0x03, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0x4A + }; + + private byte[] baFileList4 = { + (byte)0x03, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0xFF, (byte)0x7F,(byte)0x4A, (byte)0x6F,(byte)0x03, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0xFF, (byte)0x7F,(byte)0x4A, (byte)0x6F,(byte)0x09, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0xFF, (byte)0x7F,(byte)0x4A, (byte)0x6F,(byte)0x0C + }; + + private byte[] baFileList5 = { + (byte)0x02, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0xFF, (byte)0x7F,(byte)0x4A, (byte)0x6F,(byte)0x03, + (byte)0x3F,(byte)0x00, (byte)0x7F,(byte)0xFF, (byte)0x7F,(byte)0x4A + }; + + + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Drfeso_1() { + baFileList = new byte[16]; + adf1Aid = new byte[16]; + UICCTestConstants uiccTestConstants = new UICCTestConstants(); + Util.arrayCopyNonAtomic(uiccTestConstants.AID_ADF1,(short)0,adf1Aid,(short)0,(short)adf1Aid.length); + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Drfeso_1 thisApplet = new Api_2_Tkr_Drfeso_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte)bArray[bOffset]); + + // Initialize the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + // Register to EVENT_CALL_CONTROL_BY_NAA + thisApplet.obReg.setEvent(EVENT_CALL_CONTROL_BY_NAA); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + switch (callNb++) { + + /** Testcase 1 ***************************************** + * Deregister EF under MF + *******************************************************/ + + case 1: + try { + bRes = !obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList1, + (short) 0, + (short) baFileList1.length, + null, + (short) 0, + (byte) 0 ); + } + catch (Exception e) { + bRes=false; + } + break; + + case 2: + try { + uiccFileView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + uiccFileView.select(UICCTestConstants.FID_DF_TEST); + uiccFileView.select(UICCTestConstants.FID_EF_TARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, uiccFileView); + } + catch (Exception e) { + bRes=false; + } + break; + + case 3: + try { + uiccFileView.select(UICCTestConstants.FID_EF_CARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, uiccFileView); + } + catch (Exception e) { + bRes=false; + } + break; + + case 4: + try { + bRes &= obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + uiccFileView.select(UICCTestConstants.FID_EF_LARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, uiccFileView); + } + catch (Exception e) { + bRes=false; + } + break; + + case 5: + try { + bRes &= !obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + } + catch (Exception e) { + bRes=false; + } + + reportTestOutcome((byte) 1, bRes); + break; + + + /** Testcase 2 ***************************************** + * Deregister DF does not affect child EF + *******************************************************/ + + case 6: + try { + bRes = true; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList2, (short) 0, (short) baFileList2.length, + null, (short) 0, (byte) 0 ); + } + catch (Exception e) { + bRes=false; + } + break; + + case 7: + try { + uiccFileView.select(UICCTestConstants.FID_MF); + uiccFileView.select(UICCTestConstants.FID_DF_TEST); + uiccFileView.select(UICCTestConstants.FID_EF_TARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, uiccFileView); + } + catch (Exception e) { + bRes=false; + } + + reportTestOutcome((byte) 2, bRes); + break; + + + /** Testcase 3 ***************************************** + * Deregister EF does not affect parent DF + *******************************************************/ + + case 8: + try { + bRes = true; + uiccFileView.select(UICCTestConstants.FID_MF); + uiccFileView.select(UICCTestConstants.FID_DF_TEST); + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, uiccFileView); + } + catch (Exception e) { + bRes=false; + } + break; + + case 9: + try { + uiccFileView.select(UICCTestConstants.FID_MF); + uiccFileView.select(UICCTestConstants.FID_DF_TEST); + uiccFileView.select(UICCTestConstants.FID_EF_TARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, uiccFileView); + } + catch (Exception e) { + bRes=false; + } + + reportTestOutcome((byte) 3, bRes); + break; + + + /** Testcase 4 ***************************************** + * Deregister EF under ADF1 + *******************************************************/ + + case 10: + try { + bRes = true; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList4, (short) 0, (short) baFileList4.length, + adf1Aid, (short) 0, (byte) adf1Aid.length ); + } + catch (Exception e) { + bRes=false; + } + break; + + case 11: + try { + adf1FileView = UICCSystem.getTheFileView(adf1Aid, (short) 0, (byte) adf1Aid.length, JCSystem.NOT_A_TRANSIENT_OBJECT); + adf1FileView.select(UICCTestConstants.FID_ADF); + adf1FileView.select(UICCTestConstants.FID_DF_TEST); + adf1FileView.select(UICCTestConstants.FID_EF_TARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, adf1FileView); + } + catch (Exception e) { + bRes=false; + } + break; + + case 12: + try { + adf1FileView.select(UICCTestConstants.FID_EF_CARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, adf1FileView); + } + catch (Exception e) { + bRes=false; + } + break; + + case 13: + try { + adf1FileView.select(UICCTestConstants.FID_EF_LARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, adf1FileView); + } + catch (Exception e) { + bRes=false; + } + + reportTestOutcome((byte) 4, bRes); + break; + + + /** Testcase 5 ***************************************** + * Deregister DF does not affect child EF (under ADF1) + *******************************************************/ + case 14: + try { + bRes = true; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList5, (short) 0, (short) baFileList5.length, + adf1Aid, (short) 0, (byte) adf1Aid.length ); + } + catch (Exception e) { + bRes=false; + } + break; + + + case 15: + try { + adf1FileView.select(UICCTestConstants.FID_ADF); + adf1FileView.select(UICCTestConstants.FID_DF_TEST); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, adf1FileView); + } + catch (Exception e) { + bRes=false; + } + + reportTestOutcome((byte) 5, bRes); + break; + + + /** Testcase 6 ***************************************** + * Deregister EF does not affect parent DF (under ADF1) + *******************************************************/ + + case 16: + try { + bRes = true; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, adf1FileView); + } + catch (Exception e) { + bRes=false; + } + break; + + + case 17: + try { + adf1FileView.select(UICCTestConstants.FID_ADF); + adf1FileView.select(UICCTestConstants.FID_DF_TEST); + adf1FileView.select(UICCTestConstants.FID_EF_TARU); + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, adf1FileView); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome((byte) 6, bRes); + break; + + + /** Testcase 7 ***************************************** + * NullPointerException Exception + *******************************************************/ + + case 18: + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, null); + } + catch (NullPointerException e) { + bRes = true; + } + catch (Exception e) {} + + reportTestOutcome((byte) 7, bRes); + + + /** Testcase 8 ***************************************** + * EVENT_MENU_SELECTION not allowed + *******************************************************/ + + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_MENU_SELECTION, uiccFileView); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) {} + + reportTestOutcome((byte) 8, bRes); + + /** Testcase 9 ***************************************** + * EVENT_MENU_SELECTION_HELP_REQUEST not allowed + *******************************************************/ + + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_MENU_SELECTION_HELP_REQUEST, uiccFileView); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) {} + + reportTestOutcome((byte) 9, bRes); + + /** Testcase 10 **************************************** + * EVENT_TIMER_EXPIRATION not allowed + *******************************************************/ + + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_TIMER_EXPIRATION, uiccFileView); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) {} + + reportTestOutcome((byte) 10, bRes); + + + /** Testcase 11 ***************************************** + * EVENT_STATUS_COMMAND not allowed + *******************************************************/ + + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_STATUS_COMMAND, uiccFileView); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) {} + + reportTestOutcome((byte) 11, bRes); + + + /** Testcase 12 ***************************************** + * EVENT_NOT_SUPPORTED Exception + *******************************************************/ + + try { + bRes = false; + obReg.deregisterFileEvent(EVENT_PROFILE_DOWNLOAD, uiccFileView); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_SUPPORTED); + } + catch (Exception e) {} + + reportTestOutcome((byte) 12, bRes); + + } + } + + else if (event == EVENT_EXTERNAL_FILE_UPDATE) { + sFileListLength = EnvelopeHandlerSystem.getTheHandler().findAndCopyValue((byte)0x92, baFileList, (short)0); + hasBeenTriggered = true; + } + + else if (event == EVENT_CALL_CONTROL_BY_NAA) { + EnvelopeResponseHandler envRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler(); + + if (hasBeenTriggered) { + envRespHdlr.appendArray(baFileList, (short) 0, (short) sFileListLength); + } + else { + envRespHdlr.appendTLV((byte)0x00, (byte)0x00); + } + + envRespHdlr.post(true); + + hasBeenTriggered = false; + } + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/Test_Api_2_Tkr_Drfeso.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/Test_Api_2_Tkr_Drfeso.java new file mode 100644 index 0000000..3271485 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/Test_Api_2_Tkr_Drfeso.java @@ -0,0 +1,274 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 2 + * Test source for ToolkitRegistry interface + * deregisterFileEvent() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_drfeso; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Drfeso extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_drfeso"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + static final String AID_ADF_1 = "A0000000 090005FF FFFFFF89 E0000002"; + + static final String MF = "3F00"; + static final String ADF = "7FFF"; + static final String DF_TEST = "7F4A"; + static final String EF_TARU = "6F03"; + static final String EF_CARU = "6F09"; + static final String EF_LARU = "6F0C"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Drfeso() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00"); // LV ADF1 access domain DAP + + // test script + test.reset(); + response = test.terminalProfileSession("09030120"); + + + /** Testcase 1 ***************************************** + * Deregister EF under MF + *******************************************************/ + + test.unrecognizedEnvelope(); + + // update binary EF_TARU and check that applet is correctly triggered + result &= modifyEFandCheck(MF, EF_TARU, true); + result &= modifyEFandCheck(MF, EF_CARU, true); + result &= modifyEFandCheck(MF, EF_LARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, false); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_CARU, false); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_LARU, false); + + test.unrecognizedEnvelope(); + + + /** Testcase 2 ***************************************** + * Deregister DF under MF + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + + + /** Testcase 3 ***************************************** + * Deregister EF does not affect parent DF + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + result &= modifyEFandCheck(MF, EF_LARU, true); + + + /** Testcase 4 ***************************************** + * Deregister EF under ADF1 + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + result &= modifyEFandCheck(ADF, EF_CARU, true); + result &= modifyEFandCheck(ADF, EF_LARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, false); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_CARU, false); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_LARU, false); + + + /** Testcase 5 ***************************************** + * Deregister DF does not affect child EF (under ADF1) + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + + + /** Testcase 6 ***************************************** + * Deregister EF does not affect parent DF (under ADF1) + *******************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + result &= modifyEFandCheck(ADF, EF_LARU, true); + + + + /******************************************************* + * Restore EF_CARU under MF and ADF + *******************************************************/ + + // restore EF_CARU + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_CARU); + test.updateRecord("00", "03", "AAAAAA"); + test.updateRecord("00", "03", "555555"); + + test.selectApplication(AID_ADF_1); + test.selectFile(ADF); + test.selectFile(DF_TEST); + test.selectFile(EF_CARU); + test.updateRecord("00", "03", "AAAAAA"); + test.updateRecord("00", "03", "555555"); + + + /** Testcase 7 - 12 ********************************** + * 7. NullPointerException Exception + * 8. EVENT_MENU_SELECTION not allowed + * 9. EVENT_MENU_SELECTION_HELP_REQUEST not allowed + * 10. EVENT_TIMER_EXPIRATION not allowed + * 11. EVENT_STATUS_COMMAND not allowed + * 12. EVENT_NOT_SUPPORTED Exception + *****************************************************/ + + test.unrecognizedEnvelope(); + + + /******************************************************* + * Finish test + *******************************************************/ + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } + + + /** + * Check the File List which caused the latest EXTERNAL_FILE_UDPATE + * and compare it whith the File List given in parameter. + * If the applet has not been triggered it will return "000100" + */ + + private boolean appletTriggered(String data) { + response = test.envelopeCallControlByNAA(); + return response.checkData(data); + } + + + /** + * Perform an action on the specified EF in order to test + * if the test applet is triggered with an EXTERNAL_FILE_UDPATE event. + */ + + private boolean modifyEFandCheck(String mfadf, String fid, boolean shouldTrigger) { + + // select correct file + if (mfadf == ADF) test.selectApplication(AID_ADF_1); + test.selectFile(mfadf); + test.selectFile(DF_TEST); + test.selectFile(fid); + + // modify the EF + if (fid == EF_TARU) test.updateBinary("0000", "FFFFFF"); + else if (fid == EF_LARU) test.updateRecord("01","04","55555555"); + else if (fid == EF_CARU) test.increase("000001"); + + + // create the string to pass to appletTriggered() + String checkString = ("01" + MF); + if (mfadf == ADF) checkString += ADF; + + if (!shouldTrigger) checkString = "000100"; + else if (fid == EF_TARU) checkString += (DF_TEST + EF_TARU); + else if (fid == EF_CARU) checkString += (DF_TEST + EF_CARU); + else if (fid == EF_LARU) checkString += (DF_TEST + EF_LARU); + + // return the result of the triggering + return appletTriggered(checkString); + } + +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/applet.opt new file mode 100644 index 0000000..6675683 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_drfeso.Api_2_Tkr_Drfeso_1 +uicc.test.toolkit.api_2_tkr_drfeso +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/javacard/api_2_tkr_drfeso.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_drfeso/javacard/api_2_tkr_drfeso.cap new file mode 100644 index 0000000000000000000000000000000000000000..619ac33680a1024bf28157f9e8a550e2a1e3e471 GIT binary patch literal 5250 zcmbVQ4OA4@6}~fX{`YT|pWR^zMul@Uh^ruk-2*F8j;9U~ zMT3AEZOmy?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ZmldO^90 zNwJ#Kt(Ga?%Pr#lV4;(6z#B`f3d&MFp~Pk9+n3`iLts?HEfceBW~8%~uy-V3q&5!c zc|KZd5w4-FcrK_p)lyl|P?={PAJm*g4acA(ZU-1dU z4C)eHg2$U*4JZ`ANm*nfPL2gk>f|`=I41`)zzA{Bifthh6hgc=Mzc7!4tkQ)m_q?{ z&<;9yf3JBwxH}#Zha&^au8;`bNgL8tGr7$|qT{zFl1*GU9T`Ydaxw`G!#mMfp*^4d zS%v1`{;OVNQe+G{to>W1;FIz#TG({&`RWEWgSt5IF?2zvHJ!n)R8W(sO93BAZ9pWx z!a&WSt^s@uAzUD4_$mT5gF37G7*+(tpw97X9(98D@$|)8)bs;MYfRT_0(D;Y5!41m z;LFl#26cq=F?=8dVuC7Os%g~G(MNMNAR1MyRMV(qmXBt;7>G6g5iBQDg9RKw5dONN K-&eBO1AhaCT$Min literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/Api_2_Tkr_Gpol_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/Api_2_Tkr_Gpol_1.java new file mode 100644 index 0000000..246dc9e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/Api_2_Tkr_Gpol_1.java @@ -0,0 +1,129 @@ +package uicc.test.toolkit.api_2_tkr_gpol; + +import uicc.test.util.*; +import uicc.toolkit.*; +import javacard.framework.*; + + +/** + * uicc.toolkit package, ToolkitRegistry interface, getPollInterval() method + * applet 1 + */ +public class Api_2_Tkr_Gpol_1 extends TestToolkitApplet { + boolean bRes; + byte testCaseNb; + + // Trigger number + byte callNb = (byte) 0; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Gpol_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance + Api_2_Tkr_Gpol_1 thisApplet = new Api_2_Tkr_Gpol_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short) (bOffset + 1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + short i; + short pollInterval; + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + callNb++; + + switch (callNb) { + /** Test Case 1 : + * Applet isn't registered to EVENT_STATUS_COMMAND + */ + case (byte) 1: + testCaseNb = (byte) 1; + reportTestOutcome(testCaseNb, obReg.getPollInterval() == 0); + + break; + + /** Test Case 2 : + * Requesting max duration + */ + case (byte) 2: + testCaseNb = (byte) 2; + bRes = false; + + try { + obReg.requestPollInterval((short) 15300); + bRes = true; + } catch (Exception e) { + bRes = false; + } + + break; + + case (byte) 3: + pollInterval = obReg.getPollInterval(); + reportTestOutcome(testCaseNb, bRes && (pollInterval > 0) && (pollInterval < 15301)); + + break; + + /** Test Case 3 : + * Requesting System Duration + */ + case (byte) 4: + testCaseNb = (byte) 3; + bRes = false; + + try { + obReg.requestPollInterval(POLL_SYSTEM_DURATION); + bRes = true; + } catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + break; + + case (byte) 5: + pollInterval = obReg.getPollInterval(); + reportTestOutcome(testCaseNb, bRes && (pollInterval > 0) && (pollInterval < 15301)); + + break; + + /** Test Case 4 : + * Requesting no Duration + */ + case (byte) 6: + testCaseNb = (byte) 4; + bRes = false; + + try { + obReg.requestPollInterval(POLL_NO_DURATION); + bRes = true; + } catch (Exception e) { + bRes = false; + } + + break; + + case (byte) 7: + reportTestOutcome(testCaseNb, bRes && (obReg.getPollInterval() == 0)); + } + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/Test_Api_2_Tkr_Gpol.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/Test_Api_2_Tkr_Gpol.java new file mode 100644 index 0000000..5166137 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/Test_Api_2_Tkr_Gpol.java @@ -0,0 +1,109 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * getPollInterval() method + */ + +package uicc.test.toolkit.api_2_tkr_gpol; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + + +public class Test_Api_2_Tkr_Gpol extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_gpol"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Gpol() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09017020"); + + /** Test case 1 + * Applet isn't registered to EVENT_STATUS_COMMAND. + */ + test.unrecognizedEnvelope(); + + /** Test case 2 + * Requesting max duration. + */ + response = test.unrecognizedEnvelope(); + result &= response.checkSw("910F"); + response = test.fetch("0F"); + test.terminalResponse("81030103 00820282 81830100 840200FF"); + test.reset(); + response = test.terminalProfile("09017020"); + result &= response.checkSw("910F"); + response = test.fetch("0F"); + test.terminalResponse("81030103 00820282 81830100 840200FF"); + test.unrecognizedEnvelope(); + + /** Test case 3 + * Requesting system duration. + */ + response = test.unrecognizedEnvelope(); + result &= response.checkSw("910F"); + response = test.fetch("0F"); + test.terminalResponse("81030103 00820282 81830100 8402011E"); + test.reset(); + response = test.terminalProfile("09017020"); + result &= response.checkSw("910F"); + response = test.fetch("0F"); + test.terminalResponse("81030103 00820282 81830100 84020175"); + test.unrecognizedEnvelope(); + + /** Test case 4 + * Requesting no Duration. + */ + response = test.unrecognizedEnvelope(); + result &= response.checkSw("910B"); + response = test.fetch("0B"); + test.terminalResponse("81030104 00820282 81830100"); + test.reset(); + response = test.terminalProfile("09017020"); + result &= response.checkSw("9000"); + test.unrecognizedEnvelope(); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "04CCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/applet.opt new file mode 100644 index 0000000..3a0fe79 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_gpol.Api_2_Tkr_Gpol_1 +uicc.test.toolkit.api_2_tkr_gpol +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/javacard/api_2_tkr_gpol.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_gpol/javacard/api_2_tkr_gpol.cap new file mode 100644 index 0000000000000000000000000000000000000000..c36742f54b4fc1a3799355692514e632b1d0d3a0 GIT binary patch literal 3141 zcmb7`3rtgI6vxkZ?=8K(RC%mG3#%}MsS_zOra*nHsDMMTh;BYMw3a$MD!nV!C}LK? zOomR)99!HNVKX|Np-v@E&D1$Hn;2h0`rFXM#j@dr- z@b~6>jmL7zhA7VEZ0gKEp;>dKYgd(adgiMmue1*>xtEl)KI&r5{b}S`i!};VUFW1hswCi)0&Sq%sugA@+`6b%dU=M z&j@vKo2fNDtGeHojxfj7>Atr1-8o0P9%XM`x3S!7Pi{Kq7?zkiBy-C*r^`-uPD=Xg zR>XEu|Lv#ZcF%9V_0ZURJEQ zexUJ(Ygq|aPoCz(+alAnek0!S-r0}Zv7qqD!q9t%45!sU040!adyk!?`20$ z+B>RZ=SQi(p03bzG(OQ7Pd?{u+dVm~>kI4tMR!V#(M|7ncX~ccFIO%PTU?#{=J92} zsPs*LbQ(MN|9N$l@<7tdsj0ds+pKQsP**AfD7iUa)4azf9d(dFyj8&w8s zq1|dVxNVhggWKtJl-u0~i)f#nKHFXHn*FxubQs>TEV5WFt};Wu%~ED_rCKc_f!L0A zUl(CGAmJ@&L9-q+*h@7M6*z9Z-DR`7ovtO6$Ur>AqBLNHbciNJ zAmAOELt*2H412n{bWRKoPz4vINfaG6H)XP*kwr&j4JEhhQJ6RRO7Ea87#qRUrU6e`oA*-JA|bsa{3};f%vlSxLPJ zf#`7_V0|D^OkNEGwLB4Om9q72B&L*N`~_8T%TQ=@&v%wll#&#&u-4NbS}@a{^{C+* z@MM5TO;Uho!nLa)M9bDgm16iBP>o&%p{a3NJ!jJDlUD*4w-OX_b%a^XfD)>>fqG^G zVYH){181654_>H*hd574hynvl0XHKUz3R6fWKu$VK7H~MP@T>?0qU74S3l({o`$+@e#%&3nU|T+K@gYJ#NWN^gM?& zapwP660@|*K11v?d=YiMF397k^4|>Q$IpG&57&??E2zy-;cS=lu zQA(Z<5jZu+j}SCkU1SWeix?pIJC$az%vp>MQ)Qw8KLz7$l~$Ks#3V?43WbF<0Rc;| z8m5-VQ$U-Cp+|#wSb9Ji4+}MT;F2*X(_R%MK_a|B@9_lX!AnGej{~SNoj#9Bz|mw# zrrF!)gF%o?(iHO(){+FSZ8!;M)595)xqvVl%)EUs08iHz`U2qJ{_AysS`m6z?pbw6 zvT^{!34D&Esw5}KOOHfI#hD76;8%#`5P6}IARB{%NM%P(kXIOq&>t5v@Gzu$BPYmf zhD2x%iXg8ba*n(lNSvX#ivo{iTwigJ1LRde0yG8%kZOXQAWvcvArs4A;33FTnj9m~ pV-lt*D2yzt$uaWGBw>bQY6(0V|2$= MIN_EVENT_NB) + && (event <= MAX_EVENT_NB)) + || (event == EVENT_UNRECOGNIZED_ENVELOPE) + || (event == EVENT_PROFILE_DOWNLOAD) + || (event == EVENT_PROACTIVE_HANDLER_AVAILABLE) + || (event == EVENT_EXTERNAL_FILE_UPDATE) + || (event == EVENT_APPLICATION_DESELECT) + || (event == EVENT_FIRST_COMMAND_AFTER_ATR)); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + boolean bRes; + byte testCaseNb; + short j=0; + + // Build the allowed and supported events list + for (short i = MIN_EVENT_NB; i <= MAX_EVENT_NB; i++) { + if ((this.isEventAllowed(i)) && (this.isEventSupported(i))) { + EventList[j] = i; + j++; + } + } + EventList[j++] = EVENT_UNRECOGNIZED_ENVELOPE; + EventList[j++] = EVENT_PROFILE_DOWNLOAD; + EventList[j++] = EVENT_PROACTIVE_HANDLER_AVAILABLE; + EventList[j++] = EVENT_APPLICATION_DESELECT; + EventList[j] = EVENT_FIRST_COMMAND_AFTER_ATR; + + // ----------------------------------------------------------------- + // Test Case 1 : Applet calls isEventSet() for each events allowed and supported + // except EVENT_UNRECOGNIZED_ENVELOPE and EVENT_MENU_SELECTION. + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + bRes = true; + + /* all events from -1, 1, 7 to 9, 11 to 23, 25 to 29, 123, 124, 126, 127 except -1 and 7 */ + for (short i = 0; (i < (short)(MAX_EVENT)) && bRes; i++) { + if ((EventList[i] != EVENT_UNRECOGNIZED_ENVELOPE) && (EventList[i] != EVENT_MENU_SELECTION)) { + bRes = !obReg.isEventSet(EventList[i]); + } + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2 : call isEventSet(EVENT_UNRECOGNIZED_ENVELOPE) + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + + bRes = obReg.isEventSet(EVENT_UNRECOGNIZED_ENVELOPE); + + reportTestOutcome(testCaseNb, bRes); + + + // ----------------------------------------------------------------- + // Test Case 3 : call isEventSet(EVENT_MENU_SELECTION) + // ----------------------------------------------------------------- + testCaseNb = (byte)3; + + bRes = obReg.isEventSet(EVENT_MENU_SELECTION); + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4: Call clearEvent() then isEventSet() for EVENT_UNRECOGNIZED_ENVELOPE + // ----------------------------------------------------------------- + testCaseNb = (byte)4; + bRes = false; + + try { + obReg.clearEvent(EVENT_UNRECOGNIZED_ENVELOPE); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + bRes = bRes && !obReg.isEventSet(EVENT_UNRECOGNIZED_ENVELOPE); + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 5 : For each SUPPORTED and ALLOWED event for setEvent(), + // applet calls setEvent() and isEventSet() methods + // ----------------------------------------------------------------- + testCaseNb = (byte)5; + bRes = true; + try { + for (short i = 0; (i < MAX_EVENT) && bRes;i++) { + + bRes = false; + if ((this.isEventAllowed(EventList[i])) + && (this.isEventSupported(EventList[i]))) { + + obReg.setEvent(EventList[i]); + bRes = obReg.isEventSet(EventList[i]); + + // Clear the setEvent + obReg.clearEvent(EventList[i]); + } else { + bRes = true; + } + } + } + catch (Exception e) { // No exception should be thrown + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 6 :For EVENT_MENU_SELECTION_HELP_REQUEST call: + // 1 - isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST) + // 2 - changeMenuEntry with help supported + // 3 - isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST) + // ----------------------------------------------------------------- + + testCaseNb = (byte)6; + + bRes = !obReg.isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST); + + try { + obReg.changeMenuEntry((byte) 1, MenuEntry1, (short)0, (short)MenuEntry1.length, + (byte)0, true, (byte)0, (short)0); + } + catch (Exception e) { + bRes = false; + } + bRes = bRes && obReg.isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST); + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 7 : For EVENT_TIMER_EXPIRATION, call: + // 1 - isEventSet(EVENT_TIMER_EXPIRATION) + // 2 - allocateTimer() + // 3 - isEventSet(EVENT_TIMER_EXPIRATION) + // ----------------------------------------------------------------- + testCaseNb = (byte)7; + + bRes = !obReg.isEventSet(EVENT_TIMER_EXPIRATION); + + try { + obReg.allocateTimer(); + } + catch (Exception e) { + bRes = false; + } + bRes = bRes && obReg.isEventSet(EVENT_TIMER_EXPIRATION); + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 8 : For Event EVENT_STATUS_COMMAND, call: + // 1 - isEventSet(EVENT_STATUS_COMMAND) + // 2 - requestPollInterval(POLL_SYSTEM_DURATION) + // 3 - isEventSet(EVENT_STATUS_COMMAND) + // ----------------------------------------------------------------- + testCaseNb = (byte)8; + bRes = !obReg.isEventSet(EVENT_STATUS_COMMAND); + + try { + obReg.requestPollInterval(POLL_SYSTEM_DURATION); + } + catch (Exception e) { + bRes = false; + } + bRes = bRes && obReg.isEventSet(EVENT_STATUS_COMMAND); + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 9 : For Event EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION , call: + // 1 - isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) + // 2 - allocateServiceIdentifier() + // 3 - isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) + // ----------------------------------------------------------------- + testCaseNb = (byte)9; + bRes = !obReg.isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION); + + try { + obReg.allocateServiceIdentifier(); + } + catch (Exception e) { + bRes = false; + } + bRes = bRes && obReg.isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION); + + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Api_2_Tkr_Ievs_2.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Api_2_Tkr_Ievs_2.java new file mode 100644 index 0000000..d9357d3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Api_2_Tkr_Ievs_2.java @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_ievs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, ToolkitRegistry interface, isEventSet() method + * applet 2 + */ +public class Api_2_Tkr_Ievs_2 extends TestToolkitApplet { + + private static byte[] MenuEntry2 = {(byte)'T', (byte)'e', (byte)'s', (byte)'t', (byte)'2'}; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Ievs_2() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Ievs_2 thisApplet = new Api_2_Tkr_Ievs_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte)bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuEntry2, (short)0, (short)MenuEntry2.length, (byte)0, + false, (byte)0, (short)0); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + // Result of tests + boolean bRes = false; + + // Number of tests + byte testCaseNb = (byte)0x01; + + // test case 10: check applet2 is triggered + bRes = !obReg.isEventSet(EVENT_UNRECOGNIZED_ENVELOPE); + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Test_Api_2_Tkr_Ievs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Test_Api_2_Tkr_Ievs.java new file mode 100644 index 0000000..b5a6846 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/Test_Api_2_Tkr_Ievs.java @@ -0,0 +1,93 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * isEventSet() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_ievs; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Ievs extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_ievs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 20020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 20020102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Ievs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "01" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "01"); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0102" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("090110"); + + // test case 1 to 9: trigger applet1 + test.envelopeMenuSelection("900101",""); + + // test case 10: trigger applet2 + test.envelopeMenuSelection("900102",""); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "09CCCCCC CCCCCCCC CCCC"); + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/applet.opt new file mode 100644 index 0000000..00b56ca --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x02:0x00:0x01 uicc.test.toolkit.api_2_tkr_ievs.Api_2_Tkr_Ievs_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_ievs.Api_2_Tkr_Ievs_1 +uicc.test.toolkit.api_2_tkr_ievs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/javacard/api_2_tkr_ievs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_ievs/javacard/api_2_tkr_ievs.cap new file mode 100644 index 0000000000000000000000000000000000000000..ae1d86798be3051cfeb7803752ccee4f85d38082 GIT binary patch literal 4051 zcmb7G4Nx1`5#IOiq&uB{I6#tR7>S?3U{Va0oY+t>F~$)8fXf)S6C4weL2)E7QbD#c z*p38l{fBYJo{pX1wlrzd+6igWIB7EDbV53vCb9AOXEL594ej(V#7XLSCQT-76LsH7 zSlmrJgPye7r@goP?Y_6SZ<{u7ycI|89HL&BveHcg?)4=JIfR?zdl#Hk|n9k&C49)o<;6HKTfa-P2vS&W~StI{(1s z!p1c%+iHewt)4?a`P+rZU`Mg%s{NkPQ`fJbJo_*1y~Uf#j&*FRubcYlopZY~7Bu|8 z7Roy@bg<#{_|9|hF6tuN_fB0NITU?{{4Tx6HGb{I$DeY;hgq*5Ui84Z&)=_F^5taN z=VN`7t1~Y>o3?w4`K4>&se*!-|Cx=iT(ejF_AiA`ytYhA`>els_=}U=siz_h;2QJg z@gJZ4hzwnM<=FJ^^PUX9Szg|`b@$ALsUxrb#&z-L6T1&sZWR<1w*I^OJD+U5(f?zq z?N9eUo0a3(GPvzW`F~%$t@1dyZxP)?r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7qC*ARGUy5lmXSgd0Eq zHzL^bMq0 vTa%M84;oT|(Nt(HjJ8}RVeY~gb^iOME}l&rbXdCp?;;~C#e+R&WdHsPWPI9m literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/Api_2_Tkr_Imet_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/Api_2_Tkr_Imet_1.java new file mode 100644 index 0000000..0cdf674 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/Api_2_Tkr_Imet_1.java @@ -0,0 +1,476 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_imet; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import javacard.framework.* ; +import uicc.test.util.* ; + +/** + * uicc.toolkit package, ToolkitRegistry interface, initMenuEntry() method + * applet 1 + */ +public class Api_2_Tkr_Imet_1 extends TestToolkitApplet { + + private static byte[] MenuEntry = {(byte)'T', (byte)'o', (byte)'o', (byte)'l', + (byte)'k', (byte)'i', (byte)'t', (byte)'T', + (byte)'e', (byte)'s', (byte)'t'}; + + private static byte[] MenuEntryImpossible = {(byte)'T', (byte)'o', (byte)'o', (byte)'l', + (byte)'k', (byte)'i', (byte)'t', (byte)'T', + (byte)'e', (byte)'s', (byte)'t', (byte)' ', + (byte)'I', (byte)'m', (byte)'p', (byte)'o', + (byte)'s', (byte)'s', (byte)'i', (byte)'b', + (byte)'l', (byte)'e'}; + + private byte[] MenuTest = {(byte)'T', (byte)'O', (byte)'O', (byte)'L', + (byte)'K', (byte)'I', (byte)'T', (byte)' ', + (byte)'T', (byte)'E', (byte)'S', (byte)'T', + (byte)' ', (byte)'1'}; + + private static byte[] MenuOffset = {(byte)'1', (byte)'2', (byte)'3', (byte)'4', + (byte)'5', (byte)'6', (byte)'7', (byte)'T', + (byte)'O', (byte)'O', (byte)'L', (byte)'K', + (byte)'I', (byte)'T', (byte)' ', (byte)'T', + (byte)'E', (byte)'S', (byte)'T', (byte)' ', + (byte)'2'}; + + private byte result = (byte)0; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Imet_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + boolean bRes; + // Number of tests + byte testCaseNb = (byte)23; + + // Create a new applet instance + Api_2_Tkr_Imet_1 thisApplet = new Api_2_Tkr_Imet_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte)bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + // ----------------------------------------------------------------- + // Test Case 1: NULL as parameter to menuEntry + // Shall throw a NullPointerException + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(null, (short)0, (short)0, (byte)0, false, + (byte)0, (short)0); + } + catch (java.lang.NullPointerException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2: Offset = menuEntry.length + // MenuEntry = "ToolkitTest" + // Offset = 12 + // Length = 0 + // Shall throw ArrayIndexOutOfBoundsException + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry, (short)12, (short)0, (byte)0, false, + (byte)0, (short)0); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3: Offset < 0 + // MenuEntry = "ToolkitTest" + // Offset = -1 + // Shall throw ArrayIndexOutOfBoundsException + // ----------------------------------------------------------------- + testCaseNb = (byte)3; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry, (short)-1, (short)0, (byte)0, false, + (byte)0, (short)0); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4: Offset = 255 + // MenuEntry = "ToolkitTest" + // Offset = 255 + // Length = 11 + // Shall throw ArrayIndexOutOfBoundsException + // ----------------------------------------------------------------- + testCaseNb = (byte)4; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry, (short)255, (short)11, (byte)0, false, + (byte)0, (short)0); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 5: Length = menuEntry.length+1 + // MenuEntry = "ToolkitTest" + // Offset = 0 + // Length = 12 + // Shall throw ArrayIndexOutOfBoundsException + // ----------------------------------------------------------------- + testCaseNb = (byte)5; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry, (short)0, (short)12, (byte)0, false, + (byte)0, (short)0); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 6: Length < 0 + // MenuEntry = "ToolkitTest" + // Offset = 0 + // Length = -1 + // Shall throw ArrayIndexOutOfBoundsException + // ----------------------------------------------------------------- + testCaseNb = (byte)6; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry, (short)0, (short)-1, (byte)0, false, + (byte)0, (short)0); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 7: Offset + length > menuEntry.length + // MenuEntry = "ToolkitTest" + // Offset = 11 + // Length = 1 + // Shall throw ArrayIndexOutOfBoundsException + // ----------------------------------------------------------------- + testCaseNb = (byte)7; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry, (short)11, (short)1, (byte)0, false, + (byte)0, (short)0); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 8: MenuEntry.length > size allocated at loading for each menu entry + // MenuEntry = "ToolkitTest Impossible" + // Offset = 0 + // Length = 16 + // ALLOWED_LENGTH_EXCEEDED ToolkitException is thrown + // ----------------------------------------------------------------- + testCaseNb = (byte)8; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntryImpossible, (short)0, (short)16, (byte)0, false, + (byte)0, (short)0); + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.ALLOWED_LENGTH_EXCEEDED); + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 9: Successful call, MenuEntry is the whole buffer + // 1-MenuEntry = "TOOLKIT TEST 1" + // Offset = 0 + // Length = 14 + // Shall return ID 01 + // 2-isEventSet(EVENT_MENU_SELECTION) + // Shall return true + // ----------------------------------------------------------------- + testCaseNb = (byte)9; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(thisApplet.MenuTest, (short)0, (short)14, (byte)0, false, + (byte)0, (short)0); + bRes = (thisApplet.result == (byte)1); + } + catch (Exception e) { + bRes = false; + } + + bRes = bRes && thisApplet.obReg.isEventSet(EVENT_MENU_SELECTION); + + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 10: Successful call, MenuEntry part of a buffer + // 1-MenuEntry = "1234567TOOLKIT TEST 2" + // Offset = 7 + // Length = 14 + // Shall return ID 02 + // 2-isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST) + // Shall return false + // ----------------------------------------------------------------- + testCaseNb = (byte)10; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuOffset, (short)7, (short)14, (byte)0, false, + (byte)0, (short)0); + bRes = thisApplet.result == (byte)2; + } + catch (Exception e) { + bRes = false; + } + + bRes = bRes && !thisApplet.obReg.isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST); + + thisApplet.reportTestOutcome(testCaseNb, bRes); + + + // ----------------------------------------------------------------- + // Test Case 11: Successful call, MenuEntry with help supported + // 1-MenuEntry = "TOOLKIT TEST 3" + // Offset = 0 + // Length = 14 + // Shall return ID 03 + // 2-isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST) + // Shall return true + // ----------------------------------------------------------------- + testCaseNb = (byte)11; + bRes = false; + + thisApplet.MenuTest[13] = (byte)'3'; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(thisApplet.MenuTest, (short)0, (short)14, (byte)0, true, + (byte)0, (short)0); + bRes = thisApplet.result == (byte)3; + } + catch (Exception e) { + bRes = false; + } + + bRes = bRes && thisApplet.obReg.isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST); + + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 12: Successful call, MenuEntry with an icon + // MenuEntry = "TOOLKIT TEST 4" + // Offset = 0 + // Length = 14 + // Shall return ID 04 + // ----------------------------------------------------------------- + testCaseNb = (byte)12; + bRes = false; + + thisApplet.MenuTest[13] = (byte)'4'; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(thisApplet.MenuTest, (short)0, (short)14, (byte)0, false, + (byte)1, (short)1); + bRes = thisApplet.result == (byte)4; + } + catch (Exception e) { + bRes = false; + } + + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 13: Successful call, MenuEntry + // with a next action indication + // MenuEntry = "TOOLKIT TEST 5" + // Offset = 0 + // Length = 14 + // NextAction = 24 [Select Item] + // Shall return ID 05 + // ----------------------------------------------------------------- + testCaseNb = (byte)13; + bRes = false; + + thisApplet.MenuTest[13] = (byte)'5'; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(thisApplet.MenuTest, (short)0, (short)14, (byte)0x24, false, + (byte)0, (short)0); + bRes = thisApplet.result == (byte)5 ; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 14: Successful call, length = 0 + // MenuEntry = "ToolkitTest" + // Offset = 0 + // Length = 0 + // NextAction = 00 + // HelpSupported = false + // IconQualifier = 00 + // IconIdentifier = 00 + // Shall return ID 06 + // ----------------------------------------------------------------- + testCaseNb = (byte)14; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry, (short)0, (short)0, (byte)0, false, + (byte)0, (short)0); + bRes = thisApplet.result == (byte)6; + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 15: Initialize more entry than allocated at loading + // MenuEntry = "ToolkitTest" + // Offset = 0 + // Length = 11 + // REGISTRY_ERROR ToolkitException is thrown + // ----------------------------------------------------------------- + testCaseNb = (byte)15; + bRes = false; + + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry, (short)0, (short)11, (byte)0, false, + (byte)0, (short)0); + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.REGISTRY_ERROR); + } + catch (Exception e) { + bRes = false; + } + thisApplet.reportTestOutcome(testCaseNb, bRes); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + boolean bRes; + byte testCaseNb; + byte TLV; + byte ItemID; + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + // ----------------------------------------------------------------- + // Test Case 16: Dynamic update of the menu stored by the ME + // This test is true by default + // ----------------------------------------------------------------- + testCaseNb = (byte)16; + reportTestOutcome(testCaseNb, true); + } else { + if (event == EVENT_MENU_SELECTION) { + + // ----------------------------------------------------------------- + // Test Cases 17-21 and 23: Check Applet is triggered by + // ENVELOPE(MENU_SELECTION) command + // ----------------------------------------------------------------- + + // find item ID + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + TLV = envHdlr.findTLV(TAG_ITEM_IDENTIFIER, (byte)1); + + if (TLV != TLV_NOT_FOUND) { + ItemID = envHdlr.getValueByte((short)0); + + if ((ItemID > (byte)0) && (ItemID < (byte)6)) { + testCaseNb = (byte)(ItemID + 16); + reportTestOutcome(testCaseNb, true); + } else if (ItemID == (byte)6) { + reportTestOutcome((byte)23, true); + } + } + } else { + + if (event == EVENT_MENU_SELECTION_HELP_REQUEST) { + // ----------------------------------------------------------------- + // Test Case 22 : Check Applet is triggered by + // ENVELOPE(MENU_SELECTION_HELP_REQUEST) command + // Menu Entry ID = 03 + // ----------------------------------------------------------------- + // find item ID + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + TLV = envHdlr.findTLV(TAG_ITEM_IDENTIFIER, (byte)1); + + if (TLV != TLV_NOT_FOUND) { + ItemID = envHdlr.getValueByte((short)0); + testCaseNb = (byte)22; + reportTestOutcome(testCaseNb, ItemID == (byte)3); + } + } + } + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/Test_Api_2_Tkr_Imet.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/Test_Api_2_Tkr_Imet.java new file mode 100644 index 0000000..e8e96aa --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/Test_Api_2_Tkr_Imet.java @@ -0,0 +1,118 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * isEventSet() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_imet; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Imet extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_imet"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Imet() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8014" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "06" + // V Maximum number of menu entries + "01010202 03030404 05050606" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfile("09010020"); + + // test Case 16 + response = test.fetch("76"); + result = response.checkData("D0748103 01258082 02818285 09554943" + + "43205445 53548F0F 01544F4F 4C4B4954" + + "20544553 5420318F 0F02544F 4F4C4B49" + + "54205445 53542032 8F0F0354 4F4F4C4B" + + "49542054 45535420 338F0F04 544F4F4C" + + "4B495420 54455354 20348F0F 05544F4F" + + "4C4B4954 20544553 5420358F 01061806" + + "00000000 2400"); + result &= response.checkSw("9000"); + + response = test.terminalResponse("81030125 80820282 81830100"); + result &= response.checkSw("9000"); + + test.unrecognizedEnvelope(); + result &= response.checkSw("9000"); + + // test case 17 + response = test.envelopeMenuSelection("900101", ""); + result &= response.checkSw("9000"); + + // test case 18 + response = test.envelopeMenuSelection("900102", ""); + result &= response.checkSw("9000"); + + // test case 19 + response = test.envelopeMenuSelection("900103", ""); + result &= response.checkSw("9000"); + + // test case 20 + response = test.envelopeMenuSelection("900104", ""); + result &= response.checkSw("9000"); + + // test case 21 + response = test.envelopeMenuSelection("900105", ""); + result &= response.checkSw("9000"); + + // test case 22 + response = test.envelopeMenuSelection("900103", "9500"); + result &= response.checkSw("9000"); + + // test case 23 + response = test.envelopeMenuSelection("900106", ""); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "17CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/applet.opt new file mode 100644 index 0000000..6db8050 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_imet.Api_2_Tkr_Imet_1 +uicc.test.toolkit.api_2_tkr_imet +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/javacard/api_2_tkr_imet.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_imet/javacard/api_2_tkr_imet.cap new file mode 100644 index 0000000000000000000000000000000000000000..83e0b08963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HufQr@Fufl!@_OD_8-)J7q07^@v z`Sc#_ACBHZe}Mh-V53JsMW2t_=pTVf%>D%E?acU;zD8tTcMWAt?iz_VD%RkxQL}n? zjfT~^YnX~pGc|K!tBK!h*<8HWu|?SG<0FRnY#N*Dehlp5cCt}h!EA*Htgd+iGzF4H zvS-m+dscooXf0AV=qyr~AoK`e09r^zmj$2b5{MYTdNg2AZ6{%4fr`4qngX@x3JVs= zO0&BmO_Cqq1V(1Ky@e{tLb$zwI>{g%VocACZW)#)$wnNB>y{QQIW93C*sU#+17mu6 z+pt(tTqcpRM3c+{l||JJjOm&s8Wu6liexjbyeupbh|HK^Z;`eVDqE^}nX*@A@Jcc@ zudTRp#O;mRF`evg6QtvwQo56F;!YEH=To@TkGSgsmd2*JNA}Q-Ffliy$>d?GZs}JU zrXj&^xx%kVX@Xz1!tYlrO-pc5k?exy$(xDCrn#99V`8@AnMzs{Q!eT&a8t5j^7eI% z7Ciwr=^tz(&Ce2=jf}bM*%bfbUV^PzOx;}fBxG<)#%PZSIo;dT)KFjNb$XHHI$aop;yv?reb<2=9OaT)hzkR28bW>yGt|moHd>@NuGj>c zpKi=a&tW;^a?*2IZhCHd2{lq%ZU(hE_53d0=IW`5<}rL27OOR1f2sV`C~0jDquycE zIgDxi#-wwYu+ezyP@5 z0X{~wBnQgH!(a!{5qb`0!qa>ld14Vvh7wLnM=rD|M{&hsNJES8Hv^?Q79;yfne>qJ zDZ=P)riv~`W};Rm)OzZPU`97LK6w%eHUH#EzHasb#J%X?=Hy%Uas=}*_B_f|T#2CM z+cH8irf=*BN$gt*qGZ=H$WK!Ok-4@KK}oA+1ihHbGGvmiL{JiC8Q~`>At-6H5=Y5# zWt{oAi^g7%**6%k5= baFileList.length + *******************************************************/ + + case 10: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 8, + (short) 4, + null, + (short) 0, + (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 6, bRes); + break; + + /** Testcase 7 ***************************************** + * sOffset1 < 0 + *******************************************************/ + + case 11: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) -1, + (short) 4, + null, + (short) 0, + (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 7, bRes); + break; + + /** Testcase 8 ***************************************** + * sLength1 > baFileList.length + *******************************************************/ + + case 12: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 0, + (short) 10, + null, + (short) 0, + (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 8, bRes); + break; + + + /** Testcase 9 ***************************************** + * sOffset1 + sLength1 > baFileList.length + *******************************************************/ + + case 13: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 5, + (short) 4, + null, + (short) 0, + (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 9, bRes); + break; + + + /** Testcase 10 **************************************** + * sLength1 < 0 + *******************************************************/ + + case 14: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 0, + (short) -1, + null, + (short) 0, + (byte) 0 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 10, bRes); + break; + + + /** Testcase 11 ***************************************** + * sOffset2 >= baFileList.length + *******************************************************/ + + case 15: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 0, + (short) baFileList6.length, + baADFAid15, + (short) 15, + (byte) 6 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 11, bRes); + break; + + + /** Testcase 12 ***************************************** + * sOffset2 < 0 + *******************************************************/ + + case 16: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 0, + (short) baFileList6.length, + baADFAid15, + (short) -1, + (byte) 6 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 12, bRes); + break; + + + /** Testcase 13 ***************************************** + * sLength2 > baFileList.length + *******************************************************/ + + case 17: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 0, + (short) baFileList6.length, + baADFAid15, + (short) 0, + (byte) 16 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 13, bRes); + break; + + + /** Testcase 14 ***************************************** + * sOffset2 + sLength2 > baFileList.length + *******************************************************/ + + case 18: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 0, + (short) baFileList6.length, + baADFAid15, + (short) 10, + (byte) 6 ); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 14, bRes); + break; + + + /** Testcase 15 ***************************************** + * ILLEGAL_VALUE Exception + *******************************************************/ + + case 19: + try { + bRes = false; + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 0, + (short) baFileList6.length, + baADFAid18, + (short) 0, + (byte) 4 ); + } + catch (SystemException e) { + bRes = (e.getReason() == SystemException.ILLEGAL_VALUE); + } + catch (Exception e) { + bRes = false; + } + + try { + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList6, + (short) 0, + (short) baFileList6.length, + baADFAid18, + (short) 0, + (byte) 18 ); + } + catch (SystemException e) { + bRes &= (e.getReason() == SystemException.ILLEGAL_VALUE); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome((byte) 15, bRes); + break; + + + /** Testcase 16 ***************************************** + * EVENT_MENU_SELECTION not allowed + *******************************************************/ + + case 20: + try { + bRes = false; + obReg.registerFileEvent(EVENT_MENU_SELECTION, + baFileList6, + (short) 0, + (short) baFileList6.length, + null, + (short) 0, + (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 16, bRes); + break; + + + /** Testcase 17 ***************************************** + * EVENT_MENU_SELECTION_HELP_REQUEST not allowed + *******************************************************/ + + case 21: + try { + bRes = false; + obReg.registerFileEvent(EVENT_MENU_SELECTION_HELP_REQUEST, + baFileList6, + (short) 0, + (short) baFileList6.length, + null, + (short) 0, + (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 17, bRes); + break; + + + /** Testcase 18 ***************************************** + * EVENT_TIMER_EXPIRATION not allowed + *******************************************************/ + + case 22: + try { + bRes = false; + obReg.registerFileEvent(EVENT_TIMER_EXPIRATION, + baFileList6, + (short) 0, + (short) baFileList6.length, + null, + (short) 0, + (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 18, bRes); + break; + + + /** Testcase 19 ***************************************** + * EVENT_STATUS_COMMAND not allowed + *******************************************************/ + + case 23: + try { + bRes = false; + obReg.registerFileEvent(EVENT_STATUS_COMMAND, + baFileList6, + (short) 0, + (short) baFileList6.length, + null, + (short) 0, + (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 19, bRes); + break; + + + /** Testcase 20 ***************************************** + * EVENT_NOT_SUPPORTED Exception + *******************************************************/ + + case 24: + try { + bRes = false; + obReg.registerFileEvent(EVENT_PROFILE_DOWNLOAD, + baFileList6, + (short) 0, + (short) baFileList6.length, + null, + (short) 0, + (byte) 0 ); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_SUPPORTED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome((byte) 20, bRes); + break; + + + /** Testcase 21 ***************************************** + * Register a deleted and recreated EF under MF + *******************************************************/ + + case 25: + try { + bRes = !obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList21, + (short) 0, + (short) baFileList21.length, + null, + (short) 0, + (byte) 0 ); + bRes &= obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + + } + catch (Exception e) { + bRes=false; + } + break; + + case 26: + try { + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList21, + (short) 0, + (short) baFileList21.length, + null, + (short) 0, + (byte) 0 ); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome((byte) 21, bRes); + break; + + + /** Testcase 22 ***************************************** + * Register a deleted and recreated DF under MF + *******************************************************/ + + case 27: + try { + bRes = !obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList22, + (short) 0, + (short) baFileList22.length, + null, + (short) 0, + (byte) 0 ); + bRes &= obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + + } + catch (Exception e) { + bRes=false; + } + break; + + case 28: + try { + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList22, + (short) 0, + (short) baFileList22.length, + null, + (short) 0, + (byte) 0 ); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome((byte) 22, bRes); + break; + + + /** Testcase 23 ***************************************** + * Register a non existant EF under MF + *******************************************************/ + + case 29: + try { + bRes = !obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList23, + (short) 0, + (short) baFileList23.length, + null, + (short) 0, + (byte) 0 ); + bRes &= obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + + } + catch (Exception e) { + bRes=false; + } + break; + + case 30: + try { + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList23, + (short) 0, + (short) baFileList23.length, + null, + (short) 0, + (byte) 0 ); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome((byte) 23, bRes); + break; + + + + /** Testcase 24 ***************************************** + * Register a non existant DF under MF + *******************************************************/ + + case 31: + try { + bRes = !obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList24, + (short) 0, + (short) baFileList24.length, + null, + (short) 0, + (byte) 0 ); + bRes &= obReg.isEventSet(EVENT_EXTERNAL_FILE_UPDATE); + + } + catch (Exception e) { + bRes=false; + } + break; + + case 32: + try { + obReg.deregisterFileEvent(EVENT_EXTERNAL_FILE_UPDATE, + baFileList24, + (short) 0, + (short) baFileList24.length, + null, + (short) 0, + (byte) 0 ); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome((byte) 24, bRes); + break; + + } + } + + else if (event == EVENT_EXTERNAL_FILE_UPDATE) { + // If triggered on EVENT_EXTERNAL_FILE_UPDATE the applet stores the triggering File List in baFileList + sFileListLength = EnvelopeHandlerSystem.getTheHandler().findAndCopyValue(FILE_LIST_TAG, baFileList, (short)0); + hasBeenTriggered = true; + } + + else if (event == EVENT_CALL_CONTROL_BY_NAA) { + // If triggered on EVENT_CALL_CONTROL_BY_NAA the applet returns the latest triggering File List + EnvelopeResponseHandler envRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler(); + + if (hasBeenTriggered) { + envRespHdlr.appendArray(baFileList, (short) 0, (short) sFileListLength); + } + else { + envRespHdlr.appendTLV((byte)0x00, (byte)0x00); + } + + envRespHdlr.post(true); + + hasBeenTriggered = false; + } + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/Test_Api_2_Tkr_Rgfes_Bss_Bsb.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/Test_Api_2_Tkr_Rgfes_Bss_Bsb.java new file mode 100644 index 0000000..fda4395 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/Test_Api_2_Tkr_Rgfes_Bss_Bsb.java @@ -0,0 +1,353 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 2 + * Test source for ToolkitRegistry interface + * registerFileEvent() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_rgfes_bss_bsb; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Rgfes_Bss_Bsb extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + static final String AID_ADF_1 = "A0000000 090005FF FFFFFF89 E0000002"; + + static final String MF = "3F00"; + static final String ADF = "7FFF"; + static final String DF_TEST = "7F4A"; + static final String DF_SUB_TEST = "5F10"; + static final String DF_NEW = "5F16"; + static final String EF_TAA = "4F10"; + static final String EF_TNEW = "4F16"; + static final String EF_TARU = "6F03"; + static final String EF_CARU = "6F09"; + static final String EF_LARU = "6F0C"; + + static final String fcp_EF_TARU = "8202 41218302 6F038A01 058B032F 06018002 0104"; + static final String fcp_EF_TAA = "8202 41218302 4F108A01 058B032F 06018001 03"; + static final String fcp_EF_TNEW = "8202 41218302 4F168A01 058B032F 06018001 03"; + + static final String fcp_DF_NEW = "8202 78218302 5F168A01 058B032F 06018102 0200C606 90018083 0101"; + static final String fcp_DF_SUB_TEST = "8202 78218302 5F108A01 058B032F 06018102 0200C606 90018083 0101"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Rgfes_Bss_Bsb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access Application specific parameters + "00" + // LV UICC file system AID + "0100" + // LV UICC file system access aomain + "00" + // LV UICC file system access domain DAP + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 AID + "0100" + // LV ADF1 access domain + "00"); // LV ADF1 access domain DAP + + // test script + test.reset(); + response = test.terminalProfileSession("09030120"); + + + /** Testcase 1 & 2 ************************************* + * Register EF under MF + * Register DF under MF + *******************************************************/ + + for (int i=0; i < 2; i ++) { + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + result &= modifyEFandCheck(MF, EF_CARU, true); + + if (i == 0) + result &= modifyEFandCheck(MF, EF_LARU, false); + else + result &= modifyEFandCheck(MF, EF_LARU, true); + + result &= modifyEFandCheck(MF, EF_TAA, false); + + test.unrecognizedEnvelope(); + } + + + + /** Testcase 3 & 4 ************************************* + * Register EF under ADF1 + * Register DF under ADF1 + *******************************************************/ + + for (int i=0; i < 2; i ++) { + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(ADF, EF_TARU, true); + result &= modifyEFandCheck(ADF, EF_CARU, true); + + if (i == 0) + result &= modifyEFandCheck(ADF, EF_LARU, false); + else + result &= modifyEFandCheck(ADF, EF_LARU, true); + + result &= modifyEFandCheck(ADF, EF_TAA, false); + + test.unrecognizedEnvelope(); + } + + /** Testcase 5 - 20 ********************************** + * 5. NullPointerException Exception + * 6. sOffset1 >= baFileList.length + * 7. sOffset1 < 0 + * 8. sLength1 > baFileList.length + * 9. sOffset1 + sLength1 > baFileList.length + * 10. sLength1 < 0 + * 11. sOffset2 >= baFileList.length + * 12. sOffset2 < 0 + * 13. sLength2 > baFileList.length + * 14. sOffset2 + sLength2 > baFileList.length + * 15. ILLEGAL_VALUE Exception + * 16. EVENT_MENU_SELECTION not allowed + * 17. EVENT_MENU_SELECTION_HELP_REQUEST not allowed + * 18. EVENT_TIMER_EXPIRATION not allowed + * 19. EVENT_STATUS_COMMAND not allowed + * 20. EVENT_NOT_SUPPORTED Exception + *****************************************************/ + + for (int i=5; i<=20; i++ ) { + test.unrecognizedEnvelope(); + } + + + /** Testcase 21 ************************************** + * Register a deleted and recreated EF under MF + *****************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TARU, true); + + // delete EF_TARU + test.deleteFile(EF_TARU); + // create EF_TARU + test.createFile(fcp_EF_TARU); + + result &= modifyEFandCheck(MF, EF_TARU, true); + + test.unrecognizedEnvelope(); + + + + /** Testcase 22 ************************************** + * Register a deleted and recreated DF under MF + *****************************************************/ + + test.unrecognizedEnvelope(); + + result &= modifyEFandCheck(MF, EF_TAA, true); + + // delete DF_SUB_TEST + test.selectFile(MF); + test.selectFile(DF_TEST); + test.deleteFile(DF_SUB_TEST); + + // create DF_SUB_TEST + test.createFile(fcp_DF_SUB_TEST); + + // create EF_TAA + test.selectFile(DF_SUB_TEST); + test.createFile(fcp_EF_TAA); + + result &= modifyEFandCheck(MF, EF_TAA, true); + + test.unrecognizedEnvelope(); + + + /** Testcase 23 ************************************** + * Register a non existant EF under MF + *****************************************************/ + + test.unrecognizedEnvelope(); + + // create MF/DF_TEST/DF_SUB_TEST/EF_TNEW + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(DF_SUB_TEST); + test.createFile(fcp_EF_TNEW); + + // update binary EF_TNEW + test.selectFile(EF_TNEW); + test.updateBinary("0000", "FFFFFF"); + result &= appletTriggered("01" + MF + DF_TEST + DF_SUB_TEST + EF_TNEW); + + test.unrecognizedEnvelope(); + + + /** Testcase 24 ************************************** + * Register a non existant DF under MF + *****************************************************/ + + test.unrecognizedEnvelope(); + + // create DF_NEW + test.selectFile(MF); + test.selectFile(DF_TEST); + test.createFile(fcp_DF_NEW); + + // create EF_TNEW + test.selectFile(DF_NEW); + test.createFile(fcp_EF_TNEW); + + // update binary EF_TNEW + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(DF_NEW); + test.selectFile(EF_TNEW); + test.updateBinary("0000", "FFFFFF"); + result &= appletTriggered("01" + MF + DF_TEST + DF_NEW + EF_TNEW); + + test.unrecognizedEnvelope(); + + // delete DF_NEW + test.selectFile(MF); + test.selectFile(DF_TEST); + test.deleteFile(DF_NEW); + + + /***************************************************** + * Restore modified files + *****************************************************/ + + // restore EF_CARU under ADF + test.selectApplication(AID_ADF_1); + test.selectFile(ADF); + test.selectFile(DF_TEST); + test.selectFile(EF_CARU); + test.updateRecord("00", "03", "AAAAAA"); + test.updateRecord("00", "03", "555555"); + + // restore EF_CARU under MF + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_CARU); + test.updateRecord("00", "03", "AAAAAA"); + test.updateRecord("00", "03", "555555"); + + // restore EF_TAA under MF + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(DF_SUB_TEST); + test.selectFile(EF_TAA); + test.updateBinary("0000", "AAAAAA"); + + // restore EF_TARU under MF + test.selectFile(MF); + test.selectFile(DF_TEST); + test.selectFile(EF_TARU); + String FFx130 = ""; + for (int i=0; i<130; i++) + FFx130 += "FF"; + test.updateBinary("0000", FFx130); + test.updateBinary("0082", FFx130); + + + /***************************************************** + * Finish test + *****************************************************/ + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "18CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } + + + /** + * Check the File List which caused the latest EXTERNAL_FILE_UDPATE + * and compare it whith the File List given in parameter. + * If the applet has not been triggered it will return "000100" + */ + + private boolean appletTriggered(String data) { + response = test.envelopeCallControlByNAA(); + return response.checkData(data); + } + + + /** + * Perform an action on the specified EF in order to test + * if the test applet is triggered with an EXTERNAL_FILE_UDPATE event. + */ + + private boolean modifyEFandCheck(String mfadf, String fid, boolean shouldTrigger) { + + // select correct file + if (mfadf == ADF) test.selectApplication(AID_ADF_1); + test.selectFile(mfadf); + test.selectFile(DF_TEST); + if (fid == EF_TAA) test.selectFile(DF_SUB_TEST); + test.selectFile(fid); + + // modify the EF + if (fid == EF_CARU) test.increase("000001"); + else if (fid == EF_LARU) test.updateRecord("01","04","55555555"); + else test.updateBinary("0000", "FFFFFF"); + + // create the string to pass to appletTriggered() + String checkString = ("01" + MF); + if (mfadf == ADF) checkString += ADF; + + if (!shouldTrigger) checkString = "000100"; + else if (fid == EF_TARU) checkString += (DF_TEST + EF_TARU); + else if (fid == EF_CARU) checkString += (DF_TEST + EF_CARU); + else if (fid == EF_LARU) checkString += (DF_TEST + EF_LARU); + else if (fid == EF_TAA) checkString += (DF_TEST + DF_SUB_TEST + EF_TAA); + + // return the result of the triggering + return appletTriggered(checkString); + } + + +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/applet.opt new file mode 100644 index 0000000..142ce22 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_rgfes_bss_bsb.Api_2_Tkr_Rgfes_Bss_Bsb_1 +uicc.test.toolkit.api_2_tkr_rgfes_bss_bsb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/javacard/api_2_tkr_rgfes_bss_bsb.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rgfes_bss_bsb/javacard/api_2_tkr_rgfes_bss_bsb.cap new file mode 100644 index 0000000000000000000000000000000000000000..d3604434836881a75bb3859288e8b871bff95a5b GIT binary patch literal 6497 zcmbVQ3v?9a6}~h7Jol0PceB|{c3lFok)U}1M~|xzAx6OvqcPwfc}Q521(VQZo2)OS zG6`zH@G_{!YAGm>qK8E*5G*1`MAX_MNIfX6Xxl@5p{L+MdRi^%{bx7sW?&I^cJJKz z=HB~%|3Cjfk9%vYiQonWf5SS*UIi(e8w9AiaY{u=)h!dsYASB2nsDRfDWx?N&b$i{ zt2@xvHPXF%)roPZUhzM=?b^@hS8i1Q*ryG9wb!!ms>@%hTYBc-Ek~xzl8(My>6`S) z1D}5X;I4y@58u4<#Ihw_b4PIRyj-(4XXzx*-jg%?wL6No{cF#%`i*~kcw)g7ryp*7 zhQF_=@#xc!H0?TMzjW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=fss-Q%{2_viixyV#9Q~i&b0OJNS2Cg%aLKS6{6n`J`d!?3Nn&smy;SCAHex;kP4LQMi8snt)Lb)%k?Z5tLHpmBvvo*AP}n;dc>cK z-9pB69`UEC_C2aq4pXHaVz)3=f{1Ov=^H^1?xWUlNoq}C0|rE?IcaDe;>G{t#A;^NgOT*3koQO!(3!1tDH_>W(@+)%CZsK+)y@{vufCgPPUV% zxVcm*YBa>G!!~->dz!4IozwSiE<@fY1Serd8DH zD7Q%#pKnAoW~5#m$wg37p`)aj2~yUXK>{y911Q8rW7x=1=){p}DefO5qd@-MmfDG2tx>S#zW`@8ns|l=b;{ZN1|4a(ynqoUqwF;9#h~Bq!R1W zR$gW^*v!UMv#EG=mx(chJ#EeyN3svBnK;9)VJtPRdBb8v97`$P$r73?BYia*FOKo> zW_-o7+`Z;8A#UzobHHCD#wJYW_xs}i8H67Q2VrM1O@)hM9CeAU?Y`GQdT-) zJh6mK{Krf#lJq~uxjpZ%hFX!1FW$2Xs>8}R=;zeq~;x(Ukdp+{CeiViNIYn^#w_usBU}! zei?HBeBu&-qp0x__<78M@C57o)Lr0ZH9ibKl{sK?MXtc`5*r_epPd{q|GEU@oU5|Z R1sDqe8D8@-?!96<`X6+AYL);1 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Api_2_Tkr_Rsid_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Api_2_Tkr_Rsid_1.java new file mode 100644 index 0000000..503325f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Api_2_Tkr_Rsid_1.java @@ -0,0 +1,199 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_rsid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import javacard.framework.* ; +import uicc.test.util.* ; + +/** + * uicc.toolkit package, ToolkitRegistry interface, releaseServiceIdentifier() method + * applet 1 + */ +public class Api_2_Tkr_Rsid_1 extends TestToolkitApplet { + + boolean bRes; + byte testCaseNb = (byte)0x00; + + // Service ID value range + private static byte MIN_SERVICE_ID = 0; + private static byte MAX_SERVICE_ID = 7; + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'1'}; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Rsid_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Rsid_1 thisApplet = new Api_2_Tkr_Rsid_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, (short) MenuInit.length, (byte) 0, + false, (byte) 0, (short) 0); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + if (event == EVENT_MENU_SELECTION) { + + switch (testCaseNb) { + case (byte)0x00: + // Test Case 1: Release not allocated services + testCaseNb = (byte)0x01; + bRes = true; + + for (byte i = (byte)0x80; (i < (byte)0x7F) && (bRes); i++) { + try { + obReg.releaseServiceIdentifier((byte)i); + bRes = false; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.INVALID_SERVICE_ID); + } + catch (Exception e) { + bRes = false; + } + } + reportTestOutcome(testCaseNb, bRes); + + // Test Case 2: Release allocated services + testCaseNb = (byte)0x02; + try { + // allocate 8 service id. + for (byte i = MIN_SERVICE_ID; i < (MAX_SERVICE_ID + 1); i++) { + obReg.allocateServiceIdentifier(); + } + + // release 7 service id. + for (byte i = MIN_SERVICE_ID; i < MAX_SERVICE_ID; i++) { + obReg.releaseServiceIdentifier(i); + } + + // check applet is registered to EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION + bRes = obReg.isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + + // Test Case 3: Release invalid service ID + testCaseNb = (byte)0x03; + try { + obReg.releaseServiceIdentifier((byte)0xFF); + bRes = false; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.INVALID_SERVICE_ID); + } + catch (Exception e) { + bRes = false; + } + // check applet is still registered to EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION + bRes = bRes && obReg.isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION); + + reportTestOutcome(testCaseNb, bRes); + + // Test Case 4: Release last service + testCaseNb = (byte)0x04; + try { + obReg.releaseServiceIdentifier((byte)7); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + // check applet is not registered to EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION + bRes = bRes && !obReg.isEventSet(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION); + + reportTestOutcome(testCaseNb, bRes); + + // Test Case 5: Released services can be allocated + testCaseNb = (byte)0x05; + try { + for (byte i = MIN_SERVICE_ID; i < (MAX_SERVICE_ID + 1); i++) { + obReg.allocateServiceIdentifier(); + } + obReg.releaseServiceIdentifier((byte)0x01); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + case (byte)0x05: + // Test Case 6: Release all services for this applet + testCaseNb = (byte)0x06; + try { + obReg.releaseServiceIdentifier((byte)0x00); + for (byte i = 2; i < (MAX_SERVICE_ID + 1); i++) { + obReg.releaseServiceIdentifier(i); + } + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // Test Case 7: Check Applet1 is not triggered by envelope(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) command + testCaseNb = (byte)0x07; + reportTestOutcome(testCaseNb, true); + break; + + case (byte)0x07: + // Test Case 8: Release invalid service ID + testCaseNb = (byte)0x08; + bRes = true; + + try { + for (byte i = MIN_SERVICE_ID; (i < MAX_SERVICE_ID) && bRes; i++) { + bRes = bRes && !(obReg.allocateServiceIdentifier() == (byte)0x01); + } + obReg.releaseServiceIdentifier((byte)0x01); + bRes = false; + } + catch (ToolkitException e) { + bRes = bRes && (e.getReason() == ToolkitException.INVALID_SERVICE_ID); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + } + + if (event == EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) { + // Test Case 7: Check Applet1 is not triggered by envelope(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) command + testCaseNb = 0x07; + bRes = false; + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Api_2_Tkr_Rsid_2.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Api_2_Tkr_Rsid_2.java new file mode 100644 index 0000000..13e20d7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Api_2_Tkr_Rsid_2.java @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_rsid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import javacard.framework.* ; +import uicc.test.util.* ; + +/** + * uicc.toolkit package, ToolkitRegistry interface, releaseServiceIdentifier() method + * applet 2 + */ +public class Api_2_Tkr_Rsid_2 extends TestToolkitApplet { + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'2'}; + private byte[] abServiceRecord = {(byte)0x00, (byte)0x01, (byte)0x00}; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Rsid_2() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Rsid_2 thisApplet = new Api_2_Tkr_Rsid_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, (short) MenuInit.length, (byte) 0, + false, (byte) 0, (short) 0); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + boolean bRes; + byte testCaseNb; + + if (event == EVENT_MENU_SELECTION) { + // Test Case 5: Released services can be allocated + testCaseNb = (byte)0x01; + + try { + bRes = (obReg.allocateServiceIdentifier() == (byte)0x01); + // Get the system instance of handlers + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + // Send SERVICE ADD + proHdlr.init(PRO_CMD_DECLARE_SERVICE, (byte)0x00 /*Add*/, (byte)DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_SERVICE_RECORD, abServiceRecord, (short)0x00, (short)abServiceRecord.length); + proHdlr.send(); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + } + + // Test Case 7: check this applet is triggered by envelope(EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) command + if (event == EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION) { + testCaseNb = (byte)0x02; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Test_Api_2_Tkr_Rsid.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Test_Api_2_Tkr_Rsid.java new file mode 100644 index 0000000..43b1719 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/Test_Api_2_Tkr_Rsid.java @@ -0,0 +1,111 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * releaseServiceIdentifier() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_rsid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Rsid extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_rsid"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 20020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 20020102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Rsid() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "08"); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0102" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "01"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09010000 0040"); + + // test case 1 to 5: trigger Applet1 with EVENT_MENU_SELECTION (item = '01') + response = test.envelopeMenuSelection("900101",""); + result = response.checkSw("9000"); + + // test case 5: trigger Applet2 with EVENT_MENU_SELECTION (item = '02') + response = test.envelopeMenuSelection("900102",""); + result &= response.checkSw("9110"); + response = test.fetch("10"); + response = test.terminalResponse("81030147 00820282 81830100"); + + + // test case 6: trigger Applet1 with EVENT_MENU_SELECTION (item = '01') + response = test.envelopeMenuSelection("900101",""); + result &= response.checkSw("9000"); + + // test case 7: trigger Applet1 with EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION + response = test.envelopeEventDownloadLocalConnection("4103000100"); + result &= response.checkSw("9000"); + + // test case 8: trigger Applet1 with EVENT_MENU_SELECTION (item = '01') + response = test.envelopeMenuSelection("900101",""); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "08CCCCCC CCCCCCCC CC"); + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "02CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/applet.opt new file mode 100644 index 0000000..ef5e89d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x02:0x00:0x01 uicc.test.toolkit.api_2_tkr_rsid.Api_2_Tkr_Rsid_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_rsid.Api_2_Tkr_Rsid_1 +uicc.test.toolkit.api_2_tkr_rsid +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/javacard/api_2_tkr_rsid.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rsid/javacard/api_2_tkr_rsid.cap new file mode 100644 index 0000000000000000000000000000000000000000..bfe2037ddc0257f798de148cfa4547dbb1644b0f GIT binary patch literal 4047 zcmb7G3s6+o8UF7%=kDDnT%KNeM-kL23mZfd#IlMgArO32hZ>_REMclPF_UN$qwPrAm>I`OCN@9^+a$G?Jlc*^6X}0;m1Xak&T{Vj zbKd{=zwUqj>I%x@L62W%=Za-8qs0S*$~BwpOUtXutd;hv^0GA>H|128-5vq(AFOoy zauszl^Q)e;S683#zx&##a=FX7wSRD1IlZuK@$n7)w{Im(Nb`I(Z{(MZo=v}W>$8io zF<(CVmOH0ye^&es)6af1|ACDwe8;YS@%EeNgbrQwWBb)dVn*`E{`T~-*72;P|87Wn z>GKPl5BpYiIUf16x%kja?{rreKeJb5jrY;#if#M8f2#gHht2oT#TCw)og?SOU$pfe zy>WKET3}v3Z2#@VUvK`awEd|aaew&li@WH5Z&+w9b^6m#;3igH% zN++)ke&@lu8>zn;D)N3=|b>-Ke`Blm3nj?LubRVVUoJ`3Xdt>6QEALH=UGDvf_or>Yypn$# zsw*V@E4kjaJp#b@M8G*^#()dCGjE@oDoVu}r+lP#S8c7;>umE{y>54Nlgn#$cwF0U z+r3S#+gsaQb=F45Zbz-7wa&WE>8NwI=F~bo0wj%&Ox+L&13^B5Obj4SVcVO5<8Zk4 z;&-;p!&Oepks^mHb+tNcz3$c@a6|&>kc5;CMbHRKXg7|ZMRuQn4hTdsqJf>V-#@Y# z_c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Rtim_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/Api_2_Tkr_Rtim_1.java new file mode 100644 index 0000000..7767b48 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/Api_2_Tkr_Rtim_1.java @@ -0,0 +1,214 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_rtim; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import javacard.framework.* ; +import uicc.test.util.* ; + +/** + * uicc.toolkit package, ToolkitRegistry interface, releaseTimer() method + * applet 1 + */ +public class Api_2_Tkr_Rtim_1 extends TestToolkitApplet { + + // Timer ID value range + private static short MIN_TIMER_ID = 1; + private static short MAX_TIMER_ID = 8; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Rtim_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Tkr_Rtim_1 thisApplet = new Api_2_Tkr_Rtim_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + boolean bRes ; + byte testCaseNb; + + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + // ----------------------------------------------------------------- + // Test Case 1: Release not allocated timers + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + bRes = false; + + try { + obReg.releaseTimer((byte)0); + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.INVALID_TIMER_ID); + } + catch (Exception e) { + bRes = false; + } + + try { + for (short i = ((short)1); (i < ((short)256)) && (bRes);i++) { + bRes = false; + obReg.releaseTimer((byte)i); + } + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.INVALID_TIMER_ID); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 2: Release allocated timers + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + bRes = false; + + try { + for (short i = MIN_TIMER_ID; (i < (short) (MAX_TIMER_ID + 1)); i++){ + obReg.allocateTimer(); + } + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + try { + obReg.releaseTimer((byte)MIN_TIMER_ID); + bRes = bRes && obReg.isEventSet(EVENT_TIMER_EXPIRATION); + } + catch (Exception e) { + bRes = false; + } + + try { + for (short i = (short)(MIN_TIMER_ID + 1); + (i < MAX_TIMER_ID ) && (bRes);i++) { + obReg.releaseTimer((byte) i); + + bRes = obReg.isEventSet(EVENT_TIMER_EXPIRATION); + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3: Release invalid timer ID + // ----------------------------------------------------------------- + + testCaseNb = (byte)3; + bRes = false; + + try { + obReg.releaseTimer((byte)255); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.INVALID_TIMER_ID); + } + catch (Exception e) { + bRes = false; + } + bRes = bRes && obReg.isEventSet(EVENT_TIMER_EXPIRATION); + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4: Release last timer + // ----------------------------------------------------------------- + testCaseNb = (byte)4; + bRes = false; + + try { + obReg.releaseTimer((byte)MAX_TIMER_ID); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + bRes = bRes && !obReg.isEventSet(EVENT_TIMER_EXPIRATION); + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 5: Check we can allocate timers + // ----------------------------------------------------------------- + testCaseNb = (byte)5; + bRes = false; + + try { + for (short i = MIN_TIMER_ID; (i < (short)(MAX_TIMER_ID + 1));i++) { + obReg.allocateTimer(); + } + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 6: Release all timers + // ----------------------------------------------------------------- + testCaseNb = (byte)6; + bRes = false; + + try { + for (short i = MIN_TIMER_ID; (i < (short)(MAX_TIMER_ID+1));i++) { + obReg.releaseTimer((byte)i); + } + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 7: Initialiation of the test case + // ----------------------------------------------------------------- + testCaseNb = (byte)7; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + } + else { + if (event == EVENT_TIMER_EXPIRATION) { + + // ----------------------------------------------------------------- + // Test Case 7: Check applet is not triggered + // by ENVELOPE(TIMER_EXPIRATION) command any more + // ----------------------------------------------------------------- + testCaseNb = (byte)7; + reportTestOutcome(testCaseNb, false); + } + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/Test_Api_2_Tkr_Rtim.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/Test_Api_2_Tkr_Rtim.java new file mode 100644 index 0000000..d455037 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/Test_Api_2_Tkr_Rtim.java @@ -0,0 +1,97 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * releaseTimer() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_rtim; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Rtim extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_rtim"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Rtim() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("2101"); + + // test case 1 to 6 + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // test case 7 + response = test.envelopeTimerExpiration("240101"); + result &= response.checkSw("9000"); + + response = test.envelopeTimerExpiration("240102"); + result &= response.checkSw("9000"); + + response = test.envelopeTimerExpiration("240103"); + result &= response.checkSw("9000"); + + response = test.envelopeTimerExpiration("240104"); + result &= response.checkSw("9000"); + + response = test.envelopeTimerExpiration("240105"); + result &= response.checkSw("9000"); + + response = test.envelopeTimerExpiration("240106"); + result &= response.checkSw("9000"); + + response = test.envelopeTimerExpiration("240107"); + result &= response.checkSw("9000"); + + response = test.envelopeTimerExpiration("240108"); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "07CCCCCC CCCCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/applet.opt new file mode 100644 index 0000000..acee246 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_rtim.Api_2_Tkr_Rtim_1 +uicc.test.toolkit.api_2_tkr_rtim +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/javacard/api_2_tkr_rtim.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_rtim/javacard/api_2_tkr_rtim.cap new file mode 100644 index 0000000000000000000000000000000000000000..cbeba42601ba2f193ee4ef4f93dea4950680e013 GIT binary patch literal 3436 zcmb7`e^69a6vxl|#lHOoi!46`c2N@nO@67Vfj3yb3OvL5vV^eiZ~HY956 zVlK|PU9&Rwz>hO;L>Ra1J${ToJIUP9m-TmXT$bx$^ZSb9I~L!yGXn>QesP@Gwy)^x z!v(iCeVbk$$DK*vbus&dw)Mi%-rBI@8FPm&d^4#qF=)r}=F%N27Ql3M&*D>w>qFaZ ziur->%-Xs8PEmW$qVzk(@${&VHmSNstu?3aQ#bmz1v=YO+k%g6T|Mc*@0yHrbzM+B z`ooHr64R;&hdOKL>|Jkscxqy&BKV7Q*ShoDEq%K-+2Z%FU(?rhq5G4pwpmSu`!2<_ zu33FeXncDQ_rtQ&B_(wBW|+Qk)yF>#^&cJ#h`+ZoZhUL(dq1B%-*x2f?3a!t-_8u) z=z5iIy)3K){r5|EC)p-!58%^}I-2tjmMrW&y{Px}$%ES?drOO4>4O8mT@&uQu4E@( z8SERFf2g?WpI26tT`jzxTISe!tgg1=rtYuLjmjIvHvRo3W@&%7PBZ)0Ke?J|Lpd={ z+u5d@Z#P}qGe!U4QskC`Q}>`CSH?FFrOK950N=5IZH8629~pUgj}Ev}bl4)Aih9#* zG$uGr4rhYXYOSg?I};2xb6Ikkv(jE>cbcmcmKv5Bj0SsoLbl0JZnDQ44K@nG&-c4- zP&5marUMs|1LwkH?HIiF#%bS8wU5JIqUorSrh0D>DtOHN4Q;7A7@+jz zK-}jr&}v#h5-#HhU|*!8ufK6tSdVnE)a$9&T8_c$VT%)SwSR2D6+4xuv|7kXkwFQ!aA?#xJ(AQWhgbk#i zn$sJuJbPYPl)eQN95U)aiEF5PU;_nye2RO19jMr}sy|qQVF{)OaF_?6U!v&&jgr8a zB~OfTkHRr*8ZI_kH0R0Cq~V2$VHbzj^_b!3cGd0v|G4@eV9#`!dpg?eF;KMn=@|x( zsh%19Nd5K<*AN3eaS9M!8+HgIbzNjWo*_$SlRTF;jZUMiRBB|&VNndmyw>|o;nsBD z3&aghL|)&KzbS=IgVSuxGMlR0o0!Ms=uV5c2qqTby*YEHJ(Cvek$z ztA)HQa!kSgjoP?$z5iH6Ty%KY*hH8r2l$yai}q*$YCoQVo=ds#h8th zhW#vwn#&|>=(K`diq>L@8vagtx(Ji+B=6%{Url5c1w6Z8i>n-=d3DQz55>$*YZit0hN{|*;k+9V#g0$31IntUbawg+0 z8uopF=f0j X-gqadf?N*2s{oYvOT@TOkdxNGV61`m literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Api_2_Tkr_Sevl_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Api_2_Tkr_Sevl_1.java new file mode 100644 index 0000000..52b84a2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Api_2_Tkr_Sevl_1.java @@ -0,0 +1,493 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_sevl; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, ToolkitRegistry interface, setEventList() method + * applet 1 + */ +public class Api_2_Tkr_Sevl_1 extends TestToolkitApplet { + + // Not allowed events for the setEvent() method + private static short[] NOT_ALLOWED_SET_EVENTS = {EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, + EVENT_TIMER_EXPIRATION,EVENT_STATUS_COMMAND, + EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION, EVENT_EXTERNAL_FILE_UPDATE}; + + // Not supported events for the setEvent() method + private static short NOT_SUPPORTED_SETEVENT_10 = 10; + private static short NOT_SUPPORTED_SETEVENT_24 = 24; + + // Event value range + private static short MIN_EVENT_NB = 7; + private static short MAX_EVENT_NB = 29; + + // Events allowed and supported + private static short OFFSET = 5; + private static short MAX_EVENT = 21; // 27 events - 6 not allowed events + private short[] EventList = new short[MAX_EVENT]; + + // Event allocated only for 1 applet + private short[] List = {EVENT_CALL_CONTROL_BY_NAA}; + + private static byte[] MenuEntry = {(byte)'A', (byte)'p', (byte)'p', (byte)'l', + (byte)'e', (byte)'t', (byte)'1'}; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Sevl_1() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + // Create a new applet instance + Api_2_Tkr_Sevl_1 thisApplet = new Api_2_Tkr_Sevl_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte)bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuEntry, (short)0, (short)MenuEntry.length, (byte)0, + false, (byte)0, (short)0); + } + + /** + * Method called by the processToolkit() method to know if event + * is an allowed event for the clearEvent() or setEvent() method + */ + private boolean isEventAllowed(short event) { + boolean allowed = true; + + for(short i = 0; (i < NOT_ALLOWED_SET_EVENTS.length) && (allowed); i++) { + allowed = (NOT_ALLOWED_SET_EVENTS[i] != event); + } + return allowed; + } + + /** + * Method called by the processToolkit() method to know if event + * is a supported event for the setEvent() method + */ + private boolean isEventSupported(short event) { + return (((event != NOT_SUPPORTED_SETEVENT_10) + &&(event != NOT_SUPPORTED_SETEVENT_24) + && (event >= MIN_EVENT_NB) + && (event <= MAX_EVENT_NB)) + || (event == EVENT_UNRECOGNIZED_ENVELOPE) + || (event == EVENT_PROFILE_DOWNLOAD) + || (event == EVENT_PROACTIVE_HANDLER_AVAILABLE) + || (event == EVENT_EXTERNAL_FILE_UPDATE) + || (event == EVENT_APPLICATION_DESELECT) + || (event == EVENT_FIRST_COMMAND_AFTER_ATR)); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + boolean bRes; + byte testCaseNb; + short[] MonoEventList = new short[1]; + short i; + short j; + + if ((event == EVENT_MENU_SELECTION) && (EnvelopeHandlerSystem.getTheHandler().getItemIdentifier() == (byte)0x01)) { + + j = 0; + + // Build the allowed and supported events list + for(i = MIN_EVENT_NB; i <= MAX_EVENT_NB;i++) { + + if ((this.isEventAllowed(i)) && (this.isEventSupported(i))) { + EventList[j] = i; + j++; + } + } + EventList[j++] = EVENT_UNRECOGNIZED_ENVELOPE; + EventList[j++] = EVENT_PROFILE_DOWNLOAD; + EventList[j++] = EVENT_PROACTIVE_HANDLER_AVAILABLE; + EventList[j++] = EVENT_APPLICATION_DESELECT; + EventList[j] = EVENT_FIRST_COMMAND_AFTER_ATR; + + // ----------------------------------------------------------------- + // Test Case 1: Applet1 registering all eventList buffer + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + bRes = false; + + // ----------------------------------------------------------------- + // 1 - For each event in EventList, clearEvent(event) + // No exception shall be thrown + // ----------------------------------------------------------------- + try { + for(j = (short)0; (j < (short)EventList.length); j++) { + obReg.clearEvent(EventList[j]); + } + bRes = true; + } + catch (Exception e) { + bRes = false; + } + + // ----------------------------------------------------------------- + // 2 - setEventList(eventList) + // Offset = 0 + // Length = eventList.length + // No exception shall be thrown + // ----------------------------------------------------------------- + try { + obReg.setEventList(EventList, (short)0, (short)EventList.length); + } + catch (Exception e) { + bRes = false; + } + + // ----------------------------------------------------------------- + // 3 - For all events in eventList isEventSet(event) + // Each time shall return true + // ----------------------------------------------------------------- + for(j = (short)0; (j < MAX_EVENT) && bRes; j++) { + bRes = obReg.isEventSet(EventList[j]); + } + + // ----------------------------------------------------------------- + // 4 - For each event in EventList clearEvent(event) + // No exception shall be thrown + // ----------------------------------------------------------------- + try { + for(j = (short)0; (j < MAX_EVENT) && bRes; j++) { + obReg.clearEvent(EventList[j]); + } + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + + // ----------------------------------------------------------------- + // Test Case 2 : Registering part of eventList buffer + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + bRes = true; + + // ----------------------------------------------------------------- + // 1 - setEventList(eventList) + // Offset > 0 + // Length = eventList.lentgh - OFFSET + // No exception shall be thrown + // ----------------------------------------------------------------- + try { + obReg.setEventList(EventList, OFFSET, (short)(MAX_EVENT-OFFSET)); + } + catch (Exception e) { + bRes = false; + } + + // ----------------------------------------------------------------- + // 2 - For all events in eventList isEventSet(event) + // Each time shall return true for events + // ranging from OFFSET to OFFSET+length + // else shall return false + // ----------------------------------------------------------------- + for (j = (short)0; (j < OFFSET) && bRes; j++) { + bRes &= !obReg.isEventSet(EventList[j]); + } + + for(j = (short)OFFSET; (j < MAX_EVENT) && bRes; j++) { + bRes &= obReg.isEventSet(EventList[j]); + } + + // ----------------------------------------------------------------- + // 4 - For each event in EventList clearEvent(event) + // No exception shall be thrown + // ----------------------------------------------------------------- + try { + for(j = (short)OFFSET; (j < MAX_EVENT) && bRes; j++) { + bRes = false; + obReg.clearEvent(EventList[j]); + bRes = true; + } + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3: Null buffer + // EventList = null + // Shall throw a java.lang.NullPointerException exception + // ----------------------------------------------------------------- + testCaseNb = (byte)3; + bRes = false; + + try { + obReg.setEventList(null, (short)0, (short)1); + } + catch (java.lang.NullPointerException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4: Out of bounds offset + // Offset = eventList.length + // Length = 1 + // Shall throw a java.lang.ArrayIndexOutOfBounds exception + // ----------------------------------------------------------------- + testCaseNb = (byte)4; + bRes = false; + + try { + obReg.setEventList(EventList, MAX_EVENT, (short)1); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 5: Out of bounds and big offset + // Offset = 255 + // Length = 1 + // Shall throw a java.lang.ArrayIndexOutOfBounds exception + // ----------------------------------------------------------------- + testCaseNb = (byte)5; + bRes = false; + + try { + obReg.setEventList(EventList, (short)255, (short)1); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 6: Offset < 0 + // Offset = -1 + // Length = 1 + // Shall throw a java.lang.ArrayIndexOutOfBounds exception + // ----------------------------------------------------------------- + testCaseNb = (byte)6; + bRes = false; + + try { + obReg.setEventList(EventList, (short)-1, (short)1); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 7: Out of bounds length + // Offset = 0 + // Length = eventList.length + 1 + // Shall throw a java.lang.ArrayIndexOutOfBounds exception + // ----------------------------------------------------------------- + testCaseNb = (byte)7; + bRes = false; + + try { + obReg.setEventList(EventList, (short)0, (short)(MAX_EVENT + 1)); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 8: Out of bounds and big length + // Offset = 0 + // Length = 255 + // Shall throw a java.lang.ArrayIndexOutOfBounds exception + // ----------------------------------------------------------------- + testCaseNb = (byte)8; + bRes = false; + + try { + obReg.setEventList(EventList, (short)0, (short)255); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 9: Length < 0 + // Offset = 0 + // Length = -1 + // Shall throw a java.lang.ArrayIndexOutOfBounds exception + // ----------------------------------------------------------------- + testCaseNb = (byte)9; + bRes = false; + + try { + obReg.setEventList(EventList, (short)0, (short)-1); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 10: Out of bounds offset + Length + // Offset + length > eventList.length + 1 + // Shall throw a java.lang.ArrayIndexOutOfBounds exception + // ----------------------------------------------------------------- + testCaseNb = (byte)10; + bRes = false; + + try { + obReg.setEventList(EventList, OFFSET, MAX_EVENT); + } + catch (java.lang.ArrayIndexOutOfBoundsException e) { + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 11: Event 0 + // Call setEventList with eventList indicating event 0 + // Shall throw a ToolkitException with EVENT_NOT_SUPPORTED reason code + // ----------------------------------------------------------------- + + testCaseNb = (byte)11; + bRes = false; + MonoEventList[(short)0] = (byte)0; + + try { + obReg.setEventList(MonoEventList, (short)0, (short)1); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_SUPPORTED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Cases 12 to 17 + // + // Test Case 12: EVENT_MENU_SELECTION + // Shall throw a ToolkitException + // with EVENT_NOT_ALLOWED reason code + // + // Test Case 13: EVENT_MENU_SELECTION_HELP_REQUEST + // Shall throw a ToolkitException + // with EVENT_NOT_ALLOWED reason code + // + // Test Case 14: EVENT_TIMER_EXPIRATION + // Shall throw a ToolkitException + // with EVENT_NOT_ALLOWED reason code + // + // Test Case 15: EVENT_STATUS_COMMAND + // Shall throw a ToolkitException + // with EVENT_NOT_ALLOWED reason code + // + // Test Case 16: EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION + // Shall throw a ToolkitException + // with EVENT_NOT_ALLOWED reason code + // + // Test Case 17: EVENT_EXTERNAL_FILE_UPDATE + // Shall throw a ToolkitException + // with EVENT_NOT_ALLOWED reason code + // + // ----------------------------------------------------------------- + for (j = (short)0; (j < (short)NOT_ALLOWED_SET_EVENTS.length); j++) { + + MonoEventList[(short)0] = NOT_ALLOWED_SET_EVENTS[j]; + bRes = false; + try { + obReg.setEventList(MonoEventList, (short)0, (short)1); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + testCaseNb = (byte)(testCaseNb + 1); // Test Cases : 12-17 + reportTestOutcome(testCaseNb, bRes); + } + + // ----------------------------------------------------------------- + // Test Case 18: Set EVENT_CALL_CONTROL_BY_NAA + // Shall not throw an exception + // ----------------------------------------------------------------- + testCaseNb = (byte)18; + bRes = false; + + try { + obReg.setEventList(List, (short)0, (short)1); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Cases 19: by default + // ----------------------------------------------------------------- + testCaseNb = (byte)19; + bRes = false; + reportTestOutcome(testCaseNb, bRes); + + } else { + if (event == EVENT_CALL_CONTROL_BY_NAA) { + // ----------------------------------------------------------------- + // Test Case 19: Check applet is triggered by an + // ENVELOPE(EVENT_CALL_CONTROL_BY_NAA) + // ----------------------------------------------------------------- + testCaseNb = (byte)19; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + } + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Api_2_Tkr_Sevl_2.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Api_2_Tkr_Sevl_2.java new file mode 100644 index 0000000..fc0ec2e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Api_2_Tkr_Sevl_2.java @@ -0,0 +1,124 @@ +//----------------------------------------------------------------------------- +// API_2_TKR_SEVL_BSS_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_sevl; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, ToolkitRegistry interface, setEventList() method + * applet 2 + */ +public class Api_2_Tkr_Sevl_2 extends TestToolkitApplet { + + private static byte[] MenuEntry = {(byte)'A', (byte)'p', (byte)'p', (byte)'l', + (byte)'e', (byte)'t', (byte)'2'}; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Sevl_2() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + // Create a new applet instance + Api_2_Tkr_Sevl_2 thisApplet = new Api_2_Tkr_Sevl_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte)bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuEntry, (short)0, (short)MenuEntry.length, (byte)0, + false, (byte)0, (short)0); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + boolean bRes; + byte testCaseNb; + short[] EventList = new short[2]; + + if (EnvelopeHandlerSystem.getTheHandler().getItemIdentifier() == (byte)0x02) { + // ----------------------------------------------------------------- + // Test Case 20: event already assigned + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + bRes = false; + + EventList[(short)0] = EVENT_CALL_CONTROL_BY_NAA; + + try { + obReg.setEventList(EventList, (short)0, (short)1); + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.EVENT_ALREADY_REGISTERED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 21: Atomicity + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + bRes = false; + + EventList[(short)1] = EVENT_EVENT_DOWNLOAD_CALL_CONNECTED; + + try { + obReg.setEventList(EventList, (short)0, (short)2); + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.EVENT_ALREADY_REGISTERED); + } + catch (Exception e) { + bRes = false; + } + + bRes &= !obReg.isEventSet(EVENT_EVENT_DOWNLOAD_CALL_CONNECTED); + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 22: Multiple registration to the same event + // ----------------------------------------------------------------- + testCaseNb = (byte)3; + bRes = false; + + EventList[(short)0] = EVENT_EVENT_DOWNLOAD_MT_CALL; + EventList[(short)1] = EVENT_EVENT_DOWNLOAD_MT_CALL; + + try { + obReg.setEventList(EventList, (short)0, (short)2); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + bRes &= obReg.isEventSet(EVENT_EVENT_DOWNLOAD_MT_CALL); + + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Test_Api_2_Tkr_Sevl.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Test_Api_2_Tkr_Sevl.java new file mode 100644 index 0000000..3d837bf --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/Test_Api_2_Tkr_Sevl.java @@ -0,0 +1,104 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * isEventSet() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_sevl; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Sevl extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_sevl"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 20020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 20020102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Sevl() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0202" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09010020"); + + // test case 1 to 18: trigger Applet1 + response = test.envelopeMenuSelection("900101", ""); + result = response.checkSw("9000"); + + // test case 19: trigger Applet1 with EVENT_CALL_CONTROL_BY_NAA + test.reset(); + test.terminalProfileSession("09010020 03"); + response = test.envelopeCallControlByNAA(); + result &= response.checkSw("9000"); + + // test case 20 to 22: trigger Applet2 + response = test.envelopeMenuSelection("900102", ""); + result &= response.checkSw("910E"); + response = test.fetch("0E"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "13CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC"); + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "03CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/applet.opt new file mode 100644 index 0000000..fd9c83b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x02:0x00:0x01 uicc.test.toolkit.api_2_tkr_sevl.Api_2_Tkr_Sevl_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_sevl.Api_2_Tkr_Sevl_1 +uicc.test.toolkit.api_2_tkr_sevl +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/javacard/api_2_tkr_sevl.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevl/javacard/api_2_tkr_sevl.cap new file mode 100644 index 0000000000000000000000000000000000000000..257f839d22a5099c9ec38721fe2aa50da2102976 GIT binary patch literal 4869 zcmb7H4Nz3q6+Z9Y_p`fimwmwQvMer(R0Sf6piD*3iWmY>5JOBviL${Z0TFg!{V9l9 z!0{K+U}LRh(pZy_n2;KiNK7Ya?|${*AUxZPhemI_a30N!_0NmUY=z$*}Lu zdH0@s&pqEc=iYbkJr#>6Zvh>?lRFD?Vbo&*9?I^2xNur&d2v=*VR>os{gn?-FDt(D zF~H#dvgWQCcK^*u-)v7FDtcq^LS9o({pp;9nP*>rq4RH!*yS0;f&cFMH&s5!T;)h< zzOwh99S1LNeIWCPpZD*4c3`LeSf}s2t>;18>EXw2yVumX=5|X%C8wU1QqONZx#rUe zvrB6VZX9~O<2Si83qRJ8{c-ov*ZlI+ zO`Fbc)vp*h`q*)s_oLbkbqkHvrrEvTFW{NyewVq2D;b9J)IU7*_Dx&WIrEk`u5`(^ zLp60B?_6wn`5904{(avJ49@xMgDd}T+1tP4)`j$fUw!hT@$wR``T&>1ZE8Haz)st5 zwE0tJH67Ww;cU7yCnhFw*g2>9&Bt#Z`^E8huQ?BYn6KYiIy|p`S^jYD<$==)UzuP1 zNZNMkxq|~cPVPFmx83l_j(wM2`_iHtl6}9v^zx5C^c?u)YX8Q9cO7kCx374*FS+$b z)%wrO6^kU@eU*L2?Hs@p0zd^$ra_%THko%$1oEB8F`9+6zP`3L%jaqJW%-($8`swR zvfSSK)j6wuYg<;gdNwp>HMlppYuzntvPwMeHJ+B~wQes5j>{hhKH~@vobo&>(Ss1c zXJ-o5BjKukdGK^9wlexI()i&P*0*?Sea$W3XNUw`;6O@)eAoqbh#<3_fPW>mr-=srR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GI^A!9wx#?Cu6o%&{vR6hkN6hQ&CW_;7kI9?D@Fs|N_T0IDH% zq+W-0Hl28^aEDjdX)*c`z_!ZZ%d!dfz%ryNwXGVe?@Cu9P8D}bcrs-lr|@rObH}*($jqQQ z3Ryr3D;9CY0^tO9bT-5i*vMzBbe3r`V8GdPugoc|@8lC=BvuR3PC*NsFLOfWin_G#WR;>5vvdo6>|4-j51Fo8V}1v{^+M=LK9v z!Jm(54MxfJyiVjUOPKL}(GTheR0Rpd1Z?=E%^(XgB^a%v57EFq&gP3!~jo e!!UD9(ZED*uN8{~OxpmDJsD=;#J(THxc>pigll~O literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_1.java new file mode 100644 index 0000000..a68cb18 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_1.java @@ -0,0 +1,243 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_sevt; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, ToolkitRegistry interface, setEvent() method + * applet 1 + */ +public class Api_2_Tkr_Sevt_1 extends TestToolkitApplet { + + // Not allowed events for the setEvent() method + private static short[] NOT_ALLOWED_SET_EVENTS = {EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, + EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND, + EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION, + EVENT_EXTERNAL_FILE_UPDATE}; + + // Not supported events for the setEvent() method + private static short NOT_SUPPORTED_SETEVENT_10 = 10; + private static short NOT_SUPPORTED_SETEVENT_24 = 24; + + // Event value range + private static short MIN_EVENT_NB = 7; + private static short MAX_EVENT_NB = 29; + + // Events allowed and supported for setEvent() method + private static short MAX_EVENT = 21; // 27 events - 6 not allowed events + private short[] EventList = new short[MAX_EVENT]; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Sevt_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + // Create a new applet instance + Api_2_Tkr_Sevt_1 thisApplet = new Api_2_Tkr_Sevt_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_EVENT_DOWNLOAD_USER_ACTIVITY + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + /** + * Method called by the processToolkit() method to know if event + * is an allowed event for the clearEvent() or setEvent() method + */ + private boolean isEventAllowed(short event) { + boolean allowed = true; + + for(short i = 0; (i < NOT_ALLOWED_SET_EVENTS.length) && (allowed); i++) { + allowed = (NOT_ALLOWED_SET_EVENTS[i] != event); + } + return allowed; + } + + /** + * Method called by the processToolkit() method to know if event + * is a supported event for the setEvent() method + */ + private boolean isEventSupported(short event) { + return (((event != NOT_SUPPORTED_SETEVENT_10) + &&(event != NOT_SUPPORTED_SETEVENT_24) + && (event >= MIN_EVENT_NB) + && (event <= MAX_EVENT_NB)) + || (event == EVENT_UNRECOGNIZED_ENVELOPE) + || (event == EVENT_PROFILE_DOWNLOAD) + || (event == EVENT_PROACTIVE_HANDLER_AVAILABLE) + || (event == EVENT_EXTERNAL_FILE_UPDATE) + || (event == EVENT_APPLICATION_DESELECT) + || (event == EVENT_FIRST_COMMAND_AFTER_ATR)); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + // Result of tests + boolean bRes; + + // Number of tests + byte testCaseNb = (byte) 0x0B; + + short j = 0; + short eventID; + + // Build the allowed and supported events list + for(short i = MIN_EVENT_NB; i <= MAX_EVENT_NB; i++) { + + if ((this.isEventAllowed(i)) && (this.isEventSupported(i))) { + EventList[j] = i; + j++; + } + } + EventList[j++] = EVENT_UNRECOGNIZED_ENVELOPE; + EventList[j++] = EVENT_PROFILE_DOWNLOAD; + EventList[j++] = EVENT_PROACTIVE_HANDLER_AVAILABLE; + EventList[j++] = EVENT_APPLICATION_DESELECT; + EventList[j] = EVENT_FIRST_COMMAND_AFTER_ATR; + + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + + // ----------------------------------------------------------------- + // Test Case 1: Applet1 is triggered by envelope(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) command + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + reportTestOutcome(testCaseNb, true); + + // ----------------------------------------------------------------- + // Test Case 2: For all events defined in ETSI TS 102 241 and allowed, + // clearEvent(event), isEventSet(event), setEvent(event) + // isEventSet(event), clearEvent(event) + // ----------------------------------------------------------------- + testCaseNb = (byte)2; + bRes = false; + + try { + for(short i = 0; i < (short)EventList.length; i++) { + bRes = false; + + if ((this.isEventAllowed(EventList[i])) + && (this.isEventSupported(EventList[i]))) { + + obReg.clearEvent(EventList[i]); + if (obReg.isEventSet(EventList[i])) { + bRes = false; + break; + } + + obReg.setEvent(EventList[i]); + + if (!obReg.isEventSet(EventList[i])) { + bRes = false; + break; + } + + obReg.clearEvent(EventList[i]); + bRes = true; + } else { + bRes = true; + } + } + } + catch (Exception e) { // No exception shall be thrown + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 3: setEvent 0 + // ----------------------------------------------------------------- + testCaseNb = (byte) 3; + bRes = false; + + try { + eventID = (byte) 0; + obReg.setEvent(eventID); + } + catch (ToolkitException e) { // Only EVENT_NOT_SUPPORTED should be thrown + bRes = (e.getReason()==ToolkitException.EVENT_NOT_SUPPORTED); + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Case 4: Set EVENT_MENU_SELECTION + // Test Case 5: Set EVENT_MENU_SELECTION_HELP_REQUEST + // Test Case 6: Set EVENT_TIMER_EXPIRATION + // Test Case 7: Set EVENT_STATUS_COMMAND + // Test Case 8: Set EVENT_EVENT_DOWNLOAD_LOCAL_CONNECTION + // Test Case 9: Set EVENT_EXTERNAL_FILE_UPDATE + // ----------------------------------------------------------------- + for (short i = (short)(NOT_ALLOWED_SET_EVENTS.length-1); (i > (short) -1); i--) { + + bRes = false; + try { + obReg.setEvent(NOT_ALLOWED_SET_EVENTS[i]); + } + catch (ToolkitException e) { // Only EVENT_NOT_ALLOWED should be thrown + bRes = (e.getReason()==ToolkitException.EVENT_NOT_ALLOWED); + } + catch (Exception e) { + bRes = false; + } + + testCaseNb = (byte)(testCaseNb + 1); // Test Cases: 4-9 + reportTestOutcome(testCaseNb, bRes); + } + reportTestOutcome(testCaseNb, bRes); + + + // ----------------------------------------------------------------- + // Test Case 10: Set EVENT_CALL_CONTROL_BY_NAA + // ----------------------------------------------------------------- + testCaseNb = (byte)10; + bRes = false; + + try { + obReg.setEvent(EVENT_CALL_CONTROL_BY_NAA); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // ----------------------------------------------------------------- + // Test Cases 11: by default + // ----------------------------------------------------------------- + testCaseNb = (byte)11; + reportTestOutcome(testCaseNb, false); + } + else { + if (event == EVENT_CALL_CONTROL_BY_NAA) { + // ----------------------------------------------------------------- + // Test Case 10: Check applet is triggered by an envelope(EVENT_CALL_CONTROL_BY_NAA) + // ----------------------------------------------------------------- + testCaseNb = (byte)11; + reportTestOutcome(testCaseNb, true); + } + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_2.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_2.java new file mode 100644 index 0000000..addc4df --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_2.java @@ -0,0 +1,72 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_sevt; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, ToolkitRegistry interface, setEvent() method + * applet 2 + */ +public class Api_2_Tkr_Sevt_2 extends TestToolkitApplet { + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'2'}; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Sevt_2() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Sevt_2 thisApplet = new Api_2_Tkr_Sevt_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, (short) MenuInit.length, + (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + boolean bRes ; + byte testCaseNb; + + // ----------------------------------------------------------------- + // Test Case 12: SetEvent(EVENT_CALL_CONTROL_BY_NAA) + // ----------------------------------------------------------------- + testCaseNb = (byte)1; + bRes = false; + try { + obReg.setEvent(EVENT_CALL_CONTROL_BY_NAA); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_ALREADY_REGISTERED); + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_3.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_3.java new file mode 100644 index 0000000..c3ed18c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_3.java @@ -0,0 +1,70 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_sevt; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, ToolkitRegistry interface, setEvent() method + * applet 3 + */ +public class Api_2_Tkr_Sevt_3 extends TestToolkitApplet { + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'3'}; + protected static boolean bRes = false; + + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Sevt_3() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Sevt_3 thisApplet = new Api_2_Tkr_Sevt_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, (short) MenuInit.length, + (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + byte testCaseNb = (byte) 0x01; + + // ----------------------------------------------------------------- + // Test Case 13: registers to CALL_CONTROL_BY_NAA but it is already + // assigned to another applet in not selectable state + // ----------------------------------------------------------------- + testCaseNb = (byte) 0x01; + try { + obReg.setEvent(EVENT_CALL_CONTROL_BY_NAA); + bRes=false; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.EVENT_ALREADY_REGISTERED); + } + reportTestOutcome(testCaseNb, bRes); + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_4.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_4.java new file mode 100644 index 0000000..823f529 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Api_2_Tkr_Sevt_4.java @@ -0,0 +1,92 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_sevt; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * uicc.toolkit package, ToolkitRegistry interface, setEvent() method + * applet 4 + */ +public class Api_2_Tkr_Sevt_4 extends TestToolkitApplet { + + private static byte[] MenuInit = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e', (byte)'t',(byte)'4'}; + private byte testCaseNb; + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Sevt_4() { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + // Create a new applet instance + Api_2_Tkr_Sevt_4 thisApplet = new Api_2_Tkr_Sevt_4(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte) bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_MENU_SELECTION + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, (short) MenuInit.length, + (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + // Result of tests + boolean bRes = false; + + // ----------------------------------------------------------------- + // Test Case 14: applet registers more than once to the same event + // ----------------------------------------------------------------- + testCaseNb = (byte) 0x01; + + // 2- setEvent(EVENT_EVENT_DOWNLOAD_MT_CALL) + try { + obReg.setEvent(EVENT_EVENT_DOWNLOAD_MT_CALL); + bRes=true; + } + catch (ToolkitException e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + bRes=false; + + // 3- setEvent(EVENT_EVENT_DOWNLOAD_MT_CALL) + testCaseNb = (byte) 0x02; + try { + obReg.setEvent(EVENT_EVENT_DOWNLOAD_MT_CALL); + bRes=true; + } + catch (ToolkitException e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + + // 4- isEventSet(EVENT_EVENT_DOWNLOAD_MT_CALL) + testCaseNb = (byte) 0x03; + try { + obReg.isEventSet(EVENT_EVENT_DOWNLOAD_MT_CALL); + bRes=true; + } + catch (ToolkitException e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Test_Api_2_Tkr_Sevt.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Test_Api_2_Tkr_Sevt.java new file mode 100644 index 0000000..ace6b29 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/Test_Api_2_Tkr_Sevt.java @@ -0,0 +1,144 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * isEventSet() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_sevt; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Sevt extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_sevt"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 20020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 20020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 20030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 20030102"; + static final String CLASS_AID_4 = "A0000000 090005FF FFFFFF89 20040001"; + static final String APPLET_AID_4 = "A0000000 090005FF FFFFFF89 20040102"; + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Sevt() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = true; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0101" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0102" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_4, APPLET_AID_4, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "0103" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("090110"); + + // test case 1 to 10: trigger applet1 + test.envelopeEventDownloadUserActivity(); + + // test case 11 + test.envelopeCallControlByNAA(); + + // test case 12: trigger applet2 + test.envelopeMenuSelection("900101",""); + + // test case 13: Set Applet1 in the lock state + test.lockApplication(APPLET_AID_1); + + // trigger applet3 + test.envelopeMenuSelection("900102",""); + + // Set Applet1 in selectable state + test.unlockApplication(APPLET_AID_1); + + // test case 14: trigger applet4 + test.envelopeMenuSelection("900103",""); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "0BCCCCCC CCCCCCCC CCCCCCCC"); + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01CC"); + + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "01CC"); + + response = test.selectApplication(APPLET_AID_4); + result &= response.checkData("10" + APPLET_AID_4 + "03CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deleteApplet(APPLET_AID_4); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/applet.opt new file mode 100644 index 0000000..93db0b2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/applet.opt @@ -0,0 +1,7 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x02:0x00:0x01 uicc.test.toolkit.api_2_tkr_sevt.Api_2_Tkr_Sevt_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x03:0x00:0x01 uicc.test.toolkit.api_2_tkr_sevt.Api_2_Tkr_Sevt_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x04:0x00:0x01 uicc.test.toolkit.api_2_tkr_sevt.Api_2_Tkr_Sevt_4 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_sevt.Api_2_Tkr_Sevt_1 +uicc.test.toolkit.api_2_tkr_sevt +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/javacard/api_2_tkr_sevt.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_sevt/javacard/api_2_tkr_sevt.cap new file mode 100644 index 0000000000000000000000000000000000000000..0f761af787712b3ca6b26d00a693af0c06f4c202 GIT binary patch literal 4554 zcmb7H4R9036@I&Sy3^^$KH0J?EMyr1#)M)clMFZp92?9}z~BT^Y$(CPR&B|~61E^< z1CeF^aom)FNk~!#@H8ZY1%VPu5+(&^poJDDrIVEMmy)I>Eu=$A89brHeJlT*bdz?h zyLsBTZ+GAK_U*fUPo=Xt-V9oNGg~J;4N;F7cql0@D;zs(?)03J!nw1i7tb%tE}8z_ z1%U8^CBD!&^SV*r6#RQdOV;Hxuivp%y>a4qXAMUeUVe7PE4nUoXV3bx-K|~w7q9gM zueba&@AjTe(#6#mo|6i8XRX;|3eGuL(;a&Ld{XzxcMB$FZtI%iPc0kr`n~cm|N8dM z`ijsB%bO1;ch;Qz!^kK0ezD^EYr1gG{k6{9N9XC&Z_T_^Ty}KV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<&6&rPyDnuZq&qdcU+-+uE0u7Ia%y2o7~xmL88p;>Om z)NB9|zi2&nZLpRDu{Xu$4shcKxTo;a)ZuHz6?RC8HSN!*u3g=XCNYZ7v=`hzp5v=R z^L!2L#*?sg$ZW80F-ww8H%zaiIx0sfCGF|rGTUr?X|j$cYpEF)iCX0mcpY!xC8H@p z5QJ=<);!s)HyV-*NsdHaDwiPYh9($Ik}L{1OW-AwE_Hy_h~x4QvH>)Mhfz*(f2mS-X^iP zF$H;GX&cI+6s+lT(`7j91AxB9mviT$vW}$DHInl0gegXA=xEhDaaJKe!MN?l~Danx0-g2T$|IB@!FST%sU)Kmc8j|)I4 zJk<#5)T1DX7}|s1f+`WIVbp0vf!QAyj4G+9Vbu4z0u$87vzyr4y>zw)?^wLR@g0W& Jv>|dw{})$`SM>k@ literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/Api_2_Tkr_Smta_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/Api_2_Tkr_Smta_1.java new file mode 100644 index 0000000..0848595 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/Api_2_Tkr_Smta_1.java @@ -0,0 +1,244 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_smta; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import javacard.framework.* ; +import uicc.test.util.* ; + +/** + * uicc.toolkit package, ToolkitRegistry interface, setMenuEntryTextAttribute() method + * applet 1 + */ +public class Api_2_Tkr_Smta_1 extends TestToolkitApplet { + + private static byte[] menu1 = { + (byte) 'A', (byte) 'p', (byte) 'p', (byte) 'l', (byte) 'e', (byte)'t',(byte)'1' + }; + + private byte[] textAttribute = { + (byte) 0x00, (byte) 0x0C, (byte) 0x11, (byte) 0x02, + (byte) 0x00, (byte) 0x0C, (byte) 0x10, (byte) 0x03 + }; + + private byte[] shortTextAttribute = { + (byte) 0x00, (byte) 0x0C, (byte) 0x11 + }; + + private boolean bRes = true; + private byte testCaseNb = 1; + + + /** + * Constructor of the applet + */ + public Api_2_Tkr_Smta_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Api_2_Tkr_Smta_1 thisApplet = new Api_2_Tkr_Smta_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), (byte)bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + thisApplet.obReg.initMenuEntry(menu1, (short) 0, (short) menu1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(menu1, (short) 0, (short) menu1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(menu1, (short) 0, (short) menu1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(menu1, (short) 0, (short) menu1.length, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + switch (testCaseNb) { + + /** Testcase 1: + * Text attribute update 1 + * No exception shall be thrown. + */ + case 1: + try { + bRes=true; + obReg.setMenuEntryTextAttribute((byte)0x02, textAttribute, (short)0, (short)4); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 2 + * Text attribute update 2 + * No exception shall be thrown. + */ + case 2: + try { + bRes=true; + obReg.setMenuEntryTextAttribute((byte)0x04, textAttribute, (short)4, (short)4); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 3 + * Call setMenuEntryTextAttribute() with null textAttribute + * Shall throw a NullPointerException + */ + case 3: + try { + bRes=false; + obReg.setMenuEntryTextAttribute((byte)0x04, null, (short)4, (short)4); + } + catch (NullPointerException e) { + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 4 + * DstOffset >= dstBuffer.length + * Shall throw a ArrayIndexOutOfBoundsException + */ + case 4: + try { + bRes=false; + obReg.setMenuEntryTextAttribute((byte)0x04, textAttribute, (short)8, (short)4); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 5 + * dstOffset < 0 + * Shall throw a ArrayIndexOutOfBoundsException + */ + case 5: + try { + bRes=false; + obReg.setMenuEntryTextAttribute((byte)0x04, textAttribute, (short)-1, (short)4); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 6 + * DstLength > dstBuffer.length + * Shall throw a ArrayIndexOutOfBoundsException + */ + case 6: + try { + bRes=false; + obReg.setMenuEntryTextAttribute((byte)0x04, shortTextAttribute, (short)0, (short)4); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 7 + * dstOffset + dstLength > dstBuffer.length + * Shall throw a ArrayIndexOutOfBoundsException + */ + case 7: + try { + bRes=false; + obReg.setMenuEntryTextAttribute((byte)0x04, textAttribute, (short)5, (short)4); + } + catch (ArrayIndexOutOfBoundsException e) { + bRes=true; + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 8 + * Call setMenuEntryTextAttribute() with Id = 08 + * Shall throw a ToolkitException with MENU_ENTRY_NOT_FOUND reason code + */ + case 8: + try { + bRes=false; + obReg.setMenuEntryTextAttribute((byte)0x08, textAttribute, (short)0, (short)4); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.MENU_ENTRY_NOT_FOUND); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + + /** Testcase 9 + * Call setMenuEntryTextAttribute() with length = 2 + * Shall throw a ToolkitException with BAD_INPUT_PARAMETER reason code + */ + case 9: + try { + bRes=false; + obReg.setMenuEntryTextAttribute((byte)0x01, textAttribute, (short)0, (short)2); + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER); + } + catch (Exception e) { + bRes=false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + } + testCaseNb++; + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/Test_Api_2_Tkr_Smta.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/Test_Api_2_Tkr_Smta.java new file mode 100644 index 0000000..3e54dd0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/Test_Api_2_Tkr_Smta.java @@ -0,0 +1,108 @@ +/** + * ETSI TS 102 268: UICC API testing + * uicc.toolkit package part 3 + * Test source for ToolkitRegistry interface + * setMenuEntryTextAttribute() method + */ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_tkr_smta; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; + +public class Test_Api_2_Tkr_Smta extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_tkr_smta"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Tkr_Smta() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // start test + test.reset(); + test.terminalProfileSession("0101"); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8010" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "04" + // V Maximum number of menu entries + "01010202 03030404" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + response = test.terminalProfile("09010020 00000000 00000000 00000008" + + "00000000 00000000 0000003F 7F"); + + result = response.checkSw("913E"); + response = test.fetch("3E"); + test.terminalResponse("81030125 00820282 81830100"); + + // testcase 1 + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9150"); + response = test.fetch("50"); + + result &= response.checkData("D04E8103 01250082 02818285 09554943" + + "43205445 53548F08 01417070 6C657431" + + response.getData().substring(64,66)+ "08024170 706C6574 31"+ //item2 + response.getData().substring(84,86)+ "08034170 706C6574 31"+ //item3 + response.getData().substring(104,106)+"08044170 706C6574 31"+ //item4 + response.getData().substring(124,126)+"10000003 90000C11 02000003 9000000390");//text attribute + + test.terminalResponse("81030125 00820282 81830100"); + // testcase 2 + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9150"); + response = test.fetch("50"); + result &= response.checkData("D04E8103 01250082 02818285 09554943" + + "43205445 53548F08 01417070 6C657431" + + response.getData().substring(64,66)+ "08024170 706C6574 31"+ //item2 + response.getData().substring(84,86)+ "08034170 706C6574 31"+ //item3 + response.getData().substring(104,106)+"08044170 706C6574 31"+ //item4 + response.getData().substring(124,126)+"10000003 90000C11 02000003 90000C1003");//text attribute + + test.terminalResponse("81030125 00820282 81830100"); + + // testcase 3->9 + for (int i = 3; i <= 9; i++) + response = test.unrecognizedEnvelope(); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "09CCCCCC CCCCCCCC CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/applet.opt new file mode 100644 index 0000000..e634d68 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_tkr_smta.Api_2_Tkr_Smta_1 +uicc.test.toolkit.api_2_tkr_smta +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/javacard/api_2_tkr_smta.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_tkr_smta/javacard/api_2_tkr_smta.cap new file mode 100644 index 0000000000000000000000000000000000000000..59bceaab82ba41dc4414bbe7424aa01ab80ca211 GIT binary patch literal 3702 zcmbtW3rtg282-<>_x9eFhqo1^g7}Q}2`wUuVigbxh$umwb40P$DhSd_>r~XN)(0qx zMB^jMGSN8Qw8(rfnahmPIpe0zMUAiMHr*1RoAVKkvj2dr_HIO)o!hVH{QvpS`Of*z zx&QrhvN%2rBz(4Hn-k!z5(YeEj~JH{lQ}xwn4K~@GkwI^ak1IyuTKMbb0^t7rm#gl zZVmfu_JW>=!mrEgddaRR{!}$?yA=>!v}jofh7HxTAW=wkdapyu9$>%ABe)+mW#G z$??71XPwE0WaG4}uKx7FPx;hy?s?6&v32jQ-~9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wiBoc;^kjfB}i1|4nBa1LUy)u@p041Z+)Pq99t^bMAj?E-{c(Rbi>5kq6aqYTnUjev=wpnCJTq9LF`X zpkh)2xkdsiP{~Sp&c?Djn-In0o#`)EjvBBV`>eB`nKfaf>cE%Be)LyhQ*8dUJ9XeE z8ElCeY^%SrtqtQm?9V6eoc!t%49BVnccZ3d$0>1H9C!v_b^JXYWlQ(}%du(&w}+(koQ5W`@Y5d*~W z#0@y=6~G-`#00Tta}(C$NgMhQM1D?;5j!_G=C)TDk*gD9#4gN@St|8rG@cGEH;boU O2NZZE;Jh0Jn)?T-uthKc literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/Api_2_Erh_Copy_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/Api_2_Erh_Copy_1.java new file mode 100644 index 0000000..10c0cd7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/Api_2_Erh_Copy_1.java @@ -0,0 +1,385 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Copy_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_copy; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_copy + * + * @version 0.0.1 - 5 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Copy_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + byte[] data = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4,(byte)0xC5,(byte)0xC6,(byte)0xC7,(byte)0xC8,(byte)0xC9,(byte)0xCA,(byte)0xCB,(byte)0xCC,(byte)0xCD,(byte)0xCE,(byte)0xCF,(byte)0xD0, + (byte)0xD1,(byte)0xD2,(byte)0xD3,(byte)0xD4,(byte)0xD5,(byte)0xD6,(byte)0xD7,(byte)0xD8,(byte)0xD9,(byte)0xDA,(byte)0xDB,(byte)0xDC,(byte)0xDD,(byte)0xDE,(byte)0xDF,(byte)0xE0, + (byte)0xE1,(byte)0xE2,(byte)0xE3,(byte)0xE4,(byte)0xE5,(byte)0xE6,(byte)0xE7,(byte)0xE8,(byte)0xE9,(byte)0xEA,(byte)0xEB,(byte)0xEC,(byte)0xED,(byte)0xEE,(byte)0xEF,(byte)0xF0, + (byte)0xF1,(byte)0xF2,(byte)0xF3,(byte)0xF4,(byte)0xF5,(byte)0xF6,(byte)0xF7,(byte)0xF8,(byte)0xF9,(byte)0xFA,(byte)0xFB,(byte)0xFC,(byte)0xFD,(byte)0xFE,(byte)0xFF,(byte)0x00 + }; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Copy_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Copy_1 thisApplet = new Api_2_Erh_Copy_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event){ + + // Result of tests + boolean bRes ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler(); + + switch ( testCaseNb ) { + + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : try to use copy value method with the destination buffer null + testCaseNb = (byte) 1 ; + bRes = false ; + + // Null as dstBuffer + try { + // Build a 7Fh byte command + EnvRespHdlr.appendTLV((byte)0x33,data,(short) 0x00, (short) 0x07); + EnvRespHdlr.copy(null, (short)0, (short)1) ; + } + catch (NullPointerException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : dstOffset >= dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + byte[] dstBuffer = new byte[5] ; + EnvRespHdlr.copy(dstBuffer, (short)5, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + byte[] dstBuffer = new byte[5] ; + EnvRespHdlr.copy(dstBuffer, (short)-1, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + byte[] dstBuffer = new byte[5] ; + EnvRespHdlr.copy(dstBuffer, (short)0, (short)6) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + byte[] dstBuffer = new byte[5] ; + EnvRespHdlr.copy(dstBuffer, (short)3, (short)3) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + byte[] dstBuffer = new byte[5] ; + + EnvRespHdlr.copy(dstBuffer, (short)0, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : dstLength > length of the simple TLV list + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + byte[] dstBuffer = new byte[10] ; + EnvRespHdlr.copy(dstBuffer, (short)0, (short)10) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : Successful call, whole buffer + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + byte[] dstBuffer = new byte[9] ; + if(EnvRespHdlr.copy(dstBuffer, (short)0, (short)9)==9) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Compare the buffer + testCaseNb = (byte) 9 ; + bRes = false ; + + byte[] compareBuffer = new byte[9] ; + + try { + // Initialise buffers + Util.arrayCopyNonAtomic(data,(short)0,compareBuffer,(short)2,(short)7); + compareBuffer[0]=0x33; + compareBuffer[1]=0x07; + + // Compare buffers + byte[] dstBuffer = new byte[9] ; + + if( (EnvRespHdlr.copy(dstBuffer, (short)0, (short)9)==9) + && (Util.arrayCompare(compareBuffer, (short)0,dstBuffer, (short)0, (short)9)==0)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 10 : Successful call, part of a buffer + testCaseNb = (byte) 10 ; + bRes = false ; + + // Compare buffers + byte[] dstBuffer = new byte[143] ; + + EnvRespHdlr.appendTLV((byte)0x34,data,(short) 0x00, (short)0x0080); + try { + if(EnvRespHdlr.copy(dstBuffer, (short)3, (short)0x8C)==(short)0x8F) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 11 : Compare the buffer + testCaseNb = (byte) 11 ; + bRes = false ; + + compareBuffer = new byte[143] ; + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)compareBuffer.length,(byte)0); + compareBuffer[3]=0x33; + compareBuffer[4]=0x07; + Util.arrayCopyNonAtomic(data,(short)0,compareBuffer,(short)5,(short)7); + + compareBuffer[12]=0x34; + compareBuffer[13]=(byte)0x81; + compareBuffer[14]=(byte)0x80; + Util.arrayCopyNonAtomic(data,(short)0,compareBuffer,(short)15,(short)0x80); + + try { + if( (EnvRespHdlr.copy(dstBuffer, (short)3, (short)0x8C)==(short)0x8F) + && (Util.arrayCompare(compareBuffer, (short)0,dstBuffer, (short)0, (short)compareBuffer.length)==0)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + return; + + case (byte) 11 : + + // -------------------------------------------- + // Test Case 12 : Successful call, part of a buffer + testCaseNb = (byte) 12 ; + bRes = false ; + + dstBuffer = new byte[15] ; + + EnvRespHdlr.appendTLV((byte)0x33,data,(short) 0x00, (short) 13); + + try { + if(EnvRespHdlr.copy(dstBuffer, (short)3, (short)6)==9) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare the buffer + testCaseNb = (byte) 13 ; + bRes = false ; + + // Compare buffers + compareBuffer = new byte[15] ; + dstBuffer = new byte[15] ; + + compareBuffer[3]=0x33; + compareBuffer[4]=0x0D; + Util.arrayCopy(data, (short)0,compareBuffer, (short)5, (short)4); + + try { + if((EnvRespHdlr.copy(dstBuffer, (short)3, (short)6)==9)&& + (Util.arrayCompare(compareBuffer, (short)0,dstBuffer, (short)0, (short)15)==0)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 14 : successful call with the length=0 and the offset = length of the destination buffer + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + if(EnvRespHdlr.copy(dstBuffer, (short)dstBuffer.length, (short)0)==15) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + return; + + + case (byte) 14 : + // -------------------------------------------- + // Test Case 15 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 15 ; + bRes = false ; + dstBuffer = new byte[10] ; + + try { + EnvRespHdlr.post(true); + try { + EnvRespHdlr.copy(dstBuffer, (short)0, (short)0); + bRes=false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + return; + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/Test_Api_2_Erh_Copy.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/Test_Api_2_Erh_Copy.java new file mode 100644 index 0000000..a018d8c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/Test_Api_2_Erh_Copy.java @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Copy.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_copy; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_copy + * + * @version 0.0.1 - 5 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Copy extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_copy"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Copy() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 11 + test.unrecognizedEnvelope(); + + // Test case 11 to 14 + test.unrecognizedEnvelope(); + + // Test case 15 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0FCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/applet.opt new file mode 100644 index 0000000..96b3323 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_copy.Api_2_Erh_Copy_1 +uicc.test.toolkit.api_2_erh_copy +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/javacard/api_2_erh_copy.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_copy/javacard/api_2_erh_copy.cap new file mode 100644 index 0000000000000000000000000000000000000000..9e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OqQeUN|;WHvTH5tMYB@jYtiu@%0g3^9AcK0 z+it3_yQ%iJn;PnFDnWm{3Y5Cr>TkO#>XjgAZ+BR@YJhsZYZBD!TQ?4q&2p&#lpLLG zmuN6Nh6JvPV7$4f(X}UxIkn>_*Bw6?x%}FVY1GZK4u&$}7i*R!`rl}lWqML@eX9#G z>m=Mflpk&2`hXs0Y_~WsQ2DrYkEAMeA&919)1A5Yl$v#Vx}&;^q7ANBrLR|&$-OuA zmdYxZ%0vKFrFT_jpsHNeDmSX7$CYR*m!4OOSw8fyz_kHJ@kKvz-jBi$HN-&9YV($^lRRQ8e;LtA5TAid452sT-QgDg!E5aJbVv4nd02Q)SXwKpNa zKPXW3Zd|`}?Ps3}T|^z@uu|OlJg9eOVMal=ounkdHQzYst663WAX(<|QAWhzHtRK}~ zp5XPP`mg`Dn#4y@uU{UwTFP)AWgGSN&Ii!Fu;H1(bM?ZVp##l|?>s}jwG7WBo@*8E zBr6(}#JzIinZa|B!ks~-|F3u64fm3TX9mw@2X}_W4a(rT2;rH>bG5*oCxxz}JMT&2 zjkN>M1fGio?gX0}l)$}Y;F-bmPU+6zkA`%?f-TuWa60lTe$2LJ#7 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/Api_2_Erh_Cprv_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/Api_2_Erh_Cprv_1.java new file mode 100644 index 0000000..99585aa --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/Api_2_Erh_Cprv_1.java @@ -0,0 +1,491 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Cprv_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_cprv; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_cprv + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Cprv_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + byte[] ref_data = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4,(byte)0xC5,(byte)0xC6,(byte)0xC7,(byte)0xC8,(byte)0xC9,(byte)0xCA,(byte)0xCB,(byte)0xCC,(byte)0xCD,(byte)0xCE,(byte)0xCF,(byte)0xD0, + (byte)0xD1,(byte)0xD2,(byte)0xD3,(byte)0xD4,(byte)0xD5,(byte)0xD6,(byte)0xD7,(byte)0xD8,(byte)0xD9,(byte)0xDA,(byte)0xDB,(byte)0xDC,(byte)0xDD,(byte)0xDE,(byte)0xDF,(byte)0xE0, + (byte)0xE1,(byte)0xE2,(byte)0xE3,(byte)0xE4,(byte)0xE5,(byte)0xE6,(byte)0xE7,(byte)0xE8,(byte)0xE9,(byte)0xEA,(byte)0xEB,(byte)0xEC,(byte)0xED,(byte)0xEE,(byte)0xEF,(byte)0xF0, + (byte)0xF1,(byte)0xF2,(byte)0xF3,(byte)0xF4,(byte)0xF5,(byte)0xF6,(byte)0xF7,(byte)0xF8,(byte)0xF9,(byte)0xFA,(byte)0xFB,(byte)0xFC,(byte)0xFD,(byte)0xFE,(byte)0xFF,(byte)0x00 + }; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Cprv_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Cprv_1 thisApplet = new Api_2_Erh_Cprv_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Null as compareBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + byte[] TLVBuffer = new byte[16]; + + //initialize the buffer + for(short i=0;i<16;i++) + TLVBuffer[i]=(byte)i; + + //built the first TLV + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 16); + + // Select the TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)1) ; + + try { + EnvRespHdlr.compareValue((short)0, null, (short)0, (short)1) ; + } + catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : compareOffset >= compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + byte[] compareBuffer = new byte[5]; + + try { + try { + EnvRespHdlr.compareValue((short)0, compareBuffer, (short)5, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + try { + EnvRespHdlr.compareValue((short)0, compareBuffer, (short)-1, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : compareLength > compareBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + try { + EnvRespHdlr.compareValue((short)0, compareBuffer, (short)0, (short)6) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : compareOffset + compareLength > compareBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + try { + EnvRespHdlr.compareValue((short)0, compareBuffer, (short)3, (short)3) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : compareLength < 0 + + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + try { + EnvRespHdlr.compareValue((short)0, compareBuffer, (short)0, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= TLV Length + testCaseNb = (byte) 7 ; + bRes = false ; + + compareBuffer=new byte[15]; + + try { + //initialize the buffer + for(short i=0;i<15;i++) + compareBuffer[i]=(byte)i; + + EnvRespHdlr.clear(); + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x0D,compareBuffer,(short) 0x00, (short) 6); + + // Select Text String TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)1) ; + + try { + EnvRespHdlr.compareValue((short)6, compareBuffer, (short)0, (short)1) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + try { + EnvRespHdlr.compareValue((short)-1, compareBuffer, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : compareLength > TLV length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + try { + EnvRespHdlr.compareValue((short)0, compareBuffer, (short)0, (short)7) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + compareLength > Text String length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + try { + EnvRespHdlr.compareValue((short)2, compareBuffer, (short)0, (short)5) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Unavailable element + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + //clear the handler + EnvRespHdlr.clear(); + try { + EnvRespHdlr.compareValue((short)0, compareBuffer, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + + compareBuffer = new byte[17] ; + + // Initialise compare buffer + compareBuffer[0] = 4; + for (short i=1; i<17; i++) + compareBuffer[i] = (byte)(i-1) ; + + EnvRespHdlr.clear(); + + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x0D,compareBuffer,(short) 0x00, (short) 17); + + // Search Text String TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)0x01) ; + + try { + // Compare TLV + if(EnvRespHdlr.compareValue((short)0, compareBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 13 : Successfull call + testCaseNb = (byte) 13 ; + bRes = false ; + + compareBuffer[16] = (byte)0x10 ; + + try { + // Compare TLV + if(EnvRespHdlr.compareValue((short)0, compareBuffer, (short)0, (short)17)==-1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 14 : Successfull call + testCaseNb = (byte) 14 ; + bRes = false ; + + // Initialise compareBuffer + compareBuffer[0] = (byte)0x03; + compareBuffer[16] = (byte)0x0F; + + try { + // Compare TLV + if(EnvRespHdlr.compareValue((short)0, compareBuffer, (short)0, (short)17)==+1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Successfull call + testCaseNb = (byte) 15 ; + bRes = false ; + + compareBuffer = new byte[134]; + // Initialise compareBuffer + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)compareBuffer.length,(byte)0x55); + Util.arrayCopyNonAtomic(ref_data, (short)2, compareBuffer, (short)3, (short)0x81); + + //Initialise the TLV + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,ref_data,(short) 0x00, (short)0x83); + + // Search Text String TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)0x01) ; + + try { + // Compare TLV + if(EnvRespHdlr.compareValue((short)2, compareBuffer, (short)3, (short)0x81)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 16 : Successfull call + testCaseNb = (byte) 16 ; + bRes = false ; + + // Initialise compareBuffer + compareBuffer[131] = (byte) 0x84 ; + + try { + // Compare TLV + if(EnvRespHdlr.compareValue((short)2, compareBuffer, (short)3, (short)0x81)==-1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Successfull call + testCaseNb = (byte) 17 ; + bRes = false ; + + // Initialise compareBuffer + compareBuffer[131] = (byte) 0x82 ; + + try { + // Compare TLV + if(EnvRespHdlr.compareValue((short)2, compareBuffer, (short)3, (short)0x81)==+1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 18 : Successfull call (with the length = 0 and the offset = length of the comparaison buffer) + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + // Compare TLV + if(EnvRespHdlr.compareValue((short)2, compareBuffer, (short)compareBuffer.length, (short)0)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 19 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 19 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.compareValue((short)0, compareBuffer, (short)compareBuffer.length, (short)0); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes = true; + } else { + bRes = false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/Test_Api_2_Erh_Cprv.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/Test_Api_2_Erh_Cprv.java new file mode 100644 index 0000000..c73c0e9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/Test_Api_2_Erh_Cprv.java @@ -0,0 +1,106 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Cprv.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_cprv; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_cprv + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Cprv extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_cprv"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Cprv() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 19 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "13CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/applet.opt new file mode 100644 index 0000000..4df4273 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_cprv.Api_2_Erh_Cprv_1 +uicc.test.toolkit.api_2_erh_cprv +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/javacard/api_2_erh_cprv.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cprv/javacard/api_2_erh_cprv.cap new file mode 100644 index 0000000000000000000000000000000000000000..3ecfdafc94ea990dda8db3de546513d3b16e1fc5 GIT binary patch literal 5997 zcmb7|30xHA8^_<-nY|bG2Q082h>{0t0#fQKVj7B}fq0d8BVr&Z2xy9_3u-D?qzX{K44N6G(rR&Zrg|1f;s?{}Y>cjlS*op)z>-`MW5Vi7v} zbI*=yCGOiSLJ`qj`gCd$6%!d8-63nv?Nza1gU3|(`<%BLCWnW!<^Ky&hqjncZpIN=)?1bApKHFcgH{kTb+_Hfq0%kSc z?Gx(OHDk?q-Q^C4{AJ_q^O}JZCYVM96h~cuwdu}-_Bz_Hwk9vw=XE08kl~?(uO4!7 zUBkGtX%{y4xv}Tm)g$I!aSQgz&8=ArOe?lWdBycQ9Jgs$clVZCzMp6~IT=p<)u)tI(-j6JHVmK|T-s2ne!9-d8Hov5X&DnZqe}RT z+EgqeOvDHulU^9aM7mra71|WZCGAN2n&ZB7fJ@C<*(p6eH8G2G%EI!W)=AnaRogc@ zxadR&O2VaPiK0fOr)4-2DI(0ZBd^fqRFZZ%X_zFr^s*=I6%_}CRP}!LcUw2UCmrU} zj!O0WJ0fj#W>);@tXLWb+WJORNy`1YNX>uS_QB}Rs_lCAVSBtL5ZcST~ zqY}9~$&jmc84JceGbWf!LU5_sBZ^MUN=h5fskA1&zxJ#!X|D>sw#*)-y(J7fvvAYZ z6Golc?yYM~achdZP~4j0Xo?33cikw82ibjeV=10a$6up(Ivrm^aVf<+C@!UVk1*&x zguA|hFzHU%`{`Rz94XxNeT7LMX>XuUrZ}69=TV$(56~~AxQvePq_~WZAEWpJ#WyKF zV{c+G34>v%-NTSc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@tM)lY$2k=(rbm0PU0xOGG!JW*iTlyRF(%Zq)~3*qGv6I@N<`(L^GLny(w!cB zXH~nCv%;}o8?VrCq5dG3M;{V5Sr3 zcdMci-s;)tTPQrjN+s$<4gKa73QziS+#3(2l1x8+|7}4azbQsVya_`p`$77y{&4F3{VzR9UofP2##J<4m%mMoFAYG_Dz3S7V$R4027H;ar<>&EUGe z;>@t9Mj2dJTU_(FE{{0#M9?Uz{sW1qTr6=-;JPZ}Oi)^*1kN=Q*9@+2MrQ`2M@^dG z@}6`}= dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + EnvRespHdlr.copyValue((short)0, dstBuffer, (short)5, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + EnvRespHdlr.copyValue((short)0, dstBuffer, (short)-1, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + EnvRespHdlr.copyValue((short)0, dstBuffer, (short)0, (short)6) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + EnvRespHdlr.copyValue((short)0, dstBuffer, (short)3, (short)3) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + EnvRespHdlr.copyValue((short)0, dstBuffer, (short)0, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= TLV Length + testCaseNb = (byte) 7 ; + bRes = false ; + + dstBuffer = new byte[15] ; + + //built the first tlv + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 6); + EnvRespHdlr.findTLV((byte)0x0D, (byte)1) ; + + try { + EnvRespHdlr.copyValue((short)6, dstBuffer, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + EnvRespHdlr.copyValue((short)-1, dstBuffer, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : dstLength > TLV length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + EnvRespHdlr.copyValue((short)0, dstBuffer, (short)0, (short)7) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + dstLength > TLV length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + EnvRespHdlr.copyValue((short)2, dstBuffer, (short)0, (short)5) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Unavailable element (the envelopeResponseHandler is cleared) + testCaseNb = (byte) 11 ; + bRes = false ; + + EnvRespHdlr.clear() ; + + try { + EnvRespHdlr.copyValue((short)0, dstBuffer, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + + dstBuffer = new byte[17] ; + + EnvRespHdlr.appendTLV((byte)0x0D,(byte)4,data,(short) 0x00, (short) 0x10); + + // Search the TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)0x01) ; + + try { + // Copy TLV + if(EnvRespHdlr.copyValue((short)0, dstBuffer, (short)0, (short)17)==(short)17) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare buffer + testCaseNb = (byte) 13 ; + bRes = false ; + + byte[] compareBuffer = new byte[20] ; + + // Initialise compare buffer + compareBuffer[0] = 4; + for (short i=1; i<17; i++) + compareBuffer[i] = (byte)(i-1) ; + + try { + if(Util.arrayCompare(dstBuffer, (short)0, compareBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successfull call + testCaseNb = (byte) 14 ; + bRes = false ; + + dstBuffer = new byte[134] ; + //initialise the destination array + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)dstBuffer.length,(byte)0x55); + + // Initialise the TLV + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,ref_data,(short) 0x00, (short)0x83); + + // Search the TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)0x01) ; + + try { + // Copy TLV + if(EnvRespHdlr.copyValue((short)2, dstBuffer, (short)3, (short)0x81)== (short)0x84) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Compare buffer + testCaseNb = (byte) 15 ; + bRes = false ; + + // Initialise compare buffer + compareBuffer = new byte[134]; + Util.arrayFillNonAtomic(compareBuffer,(short)0,(short)compareBuffer.length,(byte)0x55); + Util.arrayCopy(ref_data, (short)2, compareBuffer, (short)3, (short)0x81); + + try { + if(Util.arrayCompare(dstBuffer, (short)0, compareBuffer, (short)0, (short)compareBuffer.length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 16 : Successfull call(with the length = 0 and the offset = length of the destination buffer) + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + // Copy TLV + if(EnvRespHdlr.copyValue((short)2, dstBuffer, (short)dstBuffer.length, (short)0)== (short)dstBuffer.length) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : ToolkitException HANDLER_NO_AVAILABLE + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.copyValue((short)0, dstBuffer, (short)0, (short)0); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/Test_Api_2_Erh_Cpyv.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/Test_Api_2_Erh_Cpyv.java new file mode 100644 index 0000000..ee6fad6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/Test_Api_2_Erh_Cpyv.java @@ -0,0 +1,106 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Cpyv.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_cpyv; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_cpyv + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Cpyv extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_cpyv"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Cpyv() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 17 + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "11CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/applet.opt new file mode 100644 index 0000000..6b5d019 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_cpyv.Api_2_Erh_Cpyv_1 +uicc.test.toolkit.api_2_erh_cpyv +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/javacard/api_2_erh_cpyv.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_cpyv/javacard/api_2_erh_cpyv.cap new file mode 100644 index 0000000000000000000000000000000000000000..3fb6ed26f2ea06a2175b0246f08905ee227df6f5 GIT binary patch literal 5850 zcmb7|30zcF8;8%GduQg(3^Vf|WCqZ1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;I!IR zhrwY`V(3XUNDc#RnHQ-Qx(?e6VN1H%i1Cg_EYt}7q`3P+6}2TuoFTmFDZPFF)=4t` z5OFuE-$0ru9sORp`$s=fl^wjZZR_o}xrcVOvh8(})~@nLXNX#nH+x6d?%q966Ly7C zQO{&|DtdF5R5o|L%04Uf2W#HN^@yy`4mr<2rL5(ta?reDG z@!W=}%F~UWqWixgF}F4)JQH~CK2#;xSfd10dl8-)Jii#LGK@z}hT!ov>6ym!yRj3)R@lENO#`8<7D$N>OO-57wD=faJmbR~iFwrZN=6$w%AMIZRLW4p8 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/Api_2_Erh_Facrb_Bs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/Api_2_Erh_Facrb_Bs_1.java new file mode 100644 index 0000000..2319d29 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/Api_2_Erh_Facrb_Bs_1.java @@ -0,0 +1,467 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Facrb_Bs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_facrb_bs; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_facrb_bs + * + * @version 0.0.1 - 7 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Facrb_Bs_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + byte[] ref_data = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4,(byte)0xC5,(byte)0xC6,(byte)0xC7,(byte)0xC8,(byte)0xC9,(byte)0xCA,(byte)0xCB,(byte)0xCC,(byte)0xCD,(byte)0xCE,(byte)0xCF,(byte)0xD0, + (byte)0xD1,(byte)0xD2,(byte)0xD3,(byte)0xD4,(byte)0xD5,(byte)0xD6,(byte)0xD7,(byte)0xD8,(byte)0xD9,(byte)0xDA,(byte)0xDB,(byte)0xDC,(byte)0xDD,(byte)0xDE,(byte)0xDF,(byte)0xE0, + (byte)0xE1,(byte)0xE2,(byte)0xE3,(byte)0xE4,(byte)0xE5,(byte)0xE6,(byte)0xE7,(byte)0xE8,(byte)0xE9,(byte)0xEA,(byte)0xEB,(byte)0xEC,(byte)0xED,(byte)0xEE,(byte)0xEF,(byte)0xF0, + (byte)0xF1,(byte)0xF2,(byte)0xF3,(byte)0xF4,(byte)0xF5,(byte)0xF6,(byte)0xF7,(byte)0xF8,(byte)0xF9,(byte)0xFA,(byte)0xFB,(byte)0xFC,(byte)0xFD,(byte)0xFE,(byte)0xFF,(byte)0x00 + }; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Facrb_Bs_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Facrb_Bs_1 thisApplet = new Api_2_Erh_Facrb_Bs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Null as compareBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + byte[] TLVBuffer=new byte[20]; + byte[] dstBuffer=new byte[20]; + + try { + //initialize the buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 16); + + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, null, (short)0) ; + } + catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : compareOffset >= compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short) 20) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : compareOffset + length > compareBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)5) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : length > compareBufferLength + testCaseNb = (byte) 5 ; + bRes = false ; + + + try { + try { + byte[] compareBuffer=new byte[15]; + EnvRespHdlr.findAndCompareValue((byte)0x0D, compareBuffer, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Unavailable element + testCaseNb = (byte) 6 ; + bRes = false ; + + + // Initialise handler + EnvRespHdlr.clear(); + //built the first tlv + EnvRespHdlr.appendTLV((byte)TAG_DEVICE_IDENTITIES,TLVBuffer,(short) 0x00, (short) 2); + + // Select a TLV + EnvRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + // Search a wrong TLV + try { + EnvRespHdlr.findAndCompareValue((byte)0x03, TLVBuffer, (short)0) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : verify the current TLV + testCaseNb = (byte) 7 ; + bRes = false ; + + // Verify there is no selected TLV + try { + EnvRespHdlr.getValueLength() ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successful call + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + // Initialise handler + EnvRespHdlr.clear(); + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 17); + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)0)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Verify current TLV + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + if(EnvRespHdlr.getValueLength()==(short)17) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successful call + testCaseNb = (byte) 10 ; + bRes = false ; + + // Initialise compare buffer + TLVBuffer[16] = (byte)0x10; + + try { + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)0)==-1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Successful call + testCaseNb = (byte) 11 ; + bRes = false ; + + // Initialise compare buffer + TLVBuffer[16] = (byte)0x0F; + TLVBuffer[0] = (byte)0x03; + + try { + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)0)==1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successful call + testCaseNb = (byte) 12 ; + bRes = false ; + + // Initialise compare buffer + Util.arrayFillNonAtomic(TLVBuffer,(short)0,(short)TLVBuffer.length,(byte)0x55); + for(short i=3;i<20;i++) + TLVBuffer[i]=(byte)(i-3); + TLVBuffer[2]=(byte)4; + + try { + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)2)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successful call with 2 Text String TLV + testCaseNb = (byte) 13 ; + bRes = false ; + + EnvRespHdlr.clear(); + // Append the first Text String TLV + EnvRespHdlr.appendTLV((byte)0x0D,ref_data,(short) 0x00, (short)0x81); + + try { + + // Initialise compare buffer + TLVBuffer[0] = (byte) 0x00 ; + TLVBuffer[1] = (byte) 0x11 ; + TLVBuffer[2] = (byte) 0x22 ; + TLVBuffer[3] = (byte) 0x33 ; + TLVBuffer[4] = (byte) 0x44 ; + TLVBuffer[5] = (byte) 0x55 ; + EnvRespHdlr.appendTLV((byte)0x0D, TLVBuffer, (short)0, (short)6) ; + + // Initialise compare buffer + TLVBuffer = new byte[134]; + Util.arrayFillNonAtomic(TLVBuffer,(short)0,(short)TLVBuffer.length,(byte)0x55); + Util.arrayCopyNonAtomic(ref_data,(short)0,TLVBuffer,(short)3,(short)0x81); + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)3)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successful call with 2 Text String TLV + testCaseNb = (byte) 14 ; + bRes = false ; + + // Initialise compare buffer + TLVBuffer[130] = (byte)0x7F; + + try { + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)3)==(short)-1) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Successful call with 2 Text String TLV + testCaseNb = (byte) 15 ; + bRes = false ; + + // Initialise compare buffer + TLVBuffer[130] = (byte)0x80; + TLVBuffer[131] = (byte)0x80; + + try { + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, TLVBuffer, (short)3)==1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 16 : Successful call : search tag 8Dh + testCaseNb = (byte) 16 ; + bRes = false ; + + TLVBuffer=new byte[17]; + // Initialise compare buffer + for(short i=0;i<17;i++) + TLVBuffer[i]=(byte)(i); + TLVBuffer[0]=(byte)4; + + + try { + + EnvRespHdlr.clear(); + //add the first tag + EnvRespHdlr.appendTLV((byte)0x0D, TLVBuffer , (short)0, (short)17) ; + + // Search tag 8Dh + if(EnvRespHdlr.findAndCompareValue((byte)0x8D, TLVBuffer, (short)0)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Successful call : search tag 8Fh + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + //add the first tag + EnvRespHdlr.appendTLV((byte)0x0F, TLVBuffer , (short)1, (short)16) ; + + //initilase the compare buffer + for(short i=1;i<17;i++) + TLVBuffer[(short)(i-1)]=TLVBuffer[i]; + + // Search tag 8Fh + if(EnvRespHdlr.findAndCompareValue((byte)0x8F, TLVBuffer, (short)0)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 18 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.findAndCompareValue((byte)0, dstBuffer, (short)0); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes = true; + } else { + bRes = false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/Test_Api_2_Erh_Facrb_Bs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/Test_Api_2_Erh_Facrb_Bs.java new file mode 100644 index 0000000..289f210 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/Test_Api_2_Erh_Facrb_Bs.java @@ -0,0 +1,106 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Facrb_Bs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_facrb_bs; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_facrb_bs + * + * @version 0.0.1 - 7 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Facrb_Bs extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_facrb_bs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Facrb_Bs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 18 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "12CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/applet.opt new file mode 100644 index 0000000..75b9350 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_facrb_bs.Api_2_Erh_Facrb_Bs_1 +uicc.test.toolkit.api_2_erh_facrb_bs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/javacard/api_2_erh_facrb_bs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrb_bs/javacard/api_2_erh_facrb_bs.cap new file mode 100644 index 0000000000000000000000000000000000000000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#>xFS{ZmHv&PbwI z8RK}>VW4%d=Rsa^mzL($D=jVVD~2iRqYr&~u>#pcRt=p@e(>|AKdYa~!{A|piT=Gj zd`#Bbmd7k;?ql)}_3`xZ@v}6r1kw3gO?^zN$yBFiUrxRhb-s}L!Ko7^_m*nWDcMO` zshPB@=dPHaUl$0?d zMvfMKl<^UPqJ;=5EfpbjJw$|*cbX~MQtCkM>@2!UA<`z@=my0SI%XroLB+5{4V=|0>j+qL^Y7r&`n literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/Api_2_Erh_Facrbbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/Api_2_Erh_Facrbbs_Bss_1.java new file mode 100644 index 0000000..596f3a0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/Api_2_Erh_Facrbbs_Bss_1.java @@ -0,0 +1,642 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Facrbbs_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_facrbbs_bss; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_facrbbs_bss + * + * @version 0.0.1 - 8 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Facrbbs_Bss_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + byte[] ref_data = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4,(byte)0xC5,(byte)0xC6,(byte)0xC7,(byte)0xC8,(byte)0xC9,(byte)0xCA,(byte)0xCB,(byte)0xCC,(byte)0xCD,(byte)0xCE,(byte)0xCF,(byte)0xD0, + (byte)0xD1,(byte)0xD2,(byte)0xD3,(byte)0xD4,(byte)0xD5,(byte)0xD6,(byte)0xD7,(byte)0xD8,(byte)0xD9,(byte)0xDA,(byte)0xDB,(byte)0xDC,(byte)0xDD,(byte)0xDE,(byte)0xDF,(byte)0xE0, + (byte)0xE1,(byte)0xE2,(byte)0xE3,(byte)0xE4,(byte)0xE5,(byte)0xE6,(byte)0xE7,(byte)0xE8,(byte)0xE9,(byte)0xEA,(byte)0xEB,(byte)0xEC,(byte)0xED,(byte)0xEE,(byte)0xEF,(byte)0xF0, + (byte)0xF1,(byte)0xF2,(byte)0xF3,(byte)0xF4,(byte)0xF5,(byte)0xF6,(byte)0xF7,(byte)0xF8,(byte)0xF9,(byte)0xFA,(byte)0xFB,(byte)0xFC,(byte)0xFD,(byte)0xFE,(byte)0xFF,(byte)0x00 + }; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Facrbbs_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Facrbbs_Bss_1 thisApplet = new Api_2_Erh_Facrbbs_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Null as compareBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + byte[] compareBuffer5=new byte[5]; + byte[] TLVBuffer=new byte[20]; + + try { + // initialise the buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 17); + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte) 1, (short) 0, null, (short) 0, (short) 1) ; + } + catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : compareOffset >= compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, compareBuffer5, (short)5, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, compareBuffer5, (short)-1, (short)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : compareLength > compareBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, compareBuffer5, (short)0, (short)6) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : compareOffset + compareLength > compareBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, compareBuffer5, (short)3, (short)3) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : compareLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0 , compareBuffer5, (short)0 , (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + + byte[] compareBuffer15=new byte[15]; + try { + + // initialise the buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + //built the first tlv + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 6); + + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)6, compareBuffer15, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)-1, compareBuffer15, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : compareLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, compareBuffer15, (short)0, (short)7) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + compareLength > Text String Length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)2, compareBuffer15, (short)0, (short)5) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Invalid parameter + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)0, (short)0, compareBuffer15, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.BAD_INPUT_PARAMETER) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Unavailable Element + testCaseNb = (byte) 12 ; + bRes = false ; + + // Initialise the handler + EnvRespHdlr.appendTLV((byte)0x02,TLVBuffer,(short) 0x00, (short) 2); + + // Select a TLV + EnvRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + // FindAndCompareValue + try { + EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)2, (short)0, compareBuffer15, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : verify the current TLV + testCaseNb = (byte) 13 ; + bRes = false ; + + // Verify there is no selected TLV + try { + EnvRespHdlr.getValueLength() ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 14 : Successful call + testCaseNb = (byte) 14 ; + bRes = false ; + + byte[] compareBuffer17=new byte[17]; + + try { + + // initialise the buffer + for(short i=1;i<17;i++) { + compareBuffer17[i]=(byte)(i-1); + TLVBuffer[i]=(byte)(i-1); + } + TLVBuffer[0]=(byte)4; + compareBuffer17[0]=(byte)4; + + //built the first tlv + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 17); + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, compareBuffer17, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Verify current TLV + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + if(EnvRespHdlr.getValueLength()==(short)17) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Successful call + testCaseNb = (byte) 16; + bRes = false ; + + try { + // Initialise buffers + compareBuffer17[16] = 0x10 ; + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, compareBuffer17, (short)0, (short)17)==-1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 17 : Successful call + testCaseNb = (byte) 17; + bRes = false ; + + try { + // Initialise buffers + compareBuffer17[16] = 0x0F ; + compareBuffer17[0] = 0x03 ; + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, compareBuffer17, (short)0, (short)17)==+1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : Successful call + testCaseNb = (byte) 18; + bRes = false ; + + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,ref_data,(short)0,(short)0x81); + TLVBuffer = new byte[134]; + Util.arrayFillNonAtomic(TLVBuffer,(short)0,(short)TLVBuffer.length,(byte)0x55); + Util.arrayCopyNonAtomic(ref_data,(short)0,TLVBuffer,(short)3,(short)0x81); + + try { + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, TLVBuffer, (short)3, (short)0x81)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 19 : Successful call + testCaseNb = (byte) 19; + bRes = false ; + + try { + // Initialise buffers + TLVBuffer[130]=(byte)0x7F ; + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, TLVBuffer, (short)3, (short)0x81)==-1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 20 : Successful call + testCaseNb = (byte) 20; + bRes = false ; + + try { + // Initialise buffers + TLVBuffer[130]=(byte)0x80 ; + TLVBuffer[131]=(byte)0x80 ; + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, TLVBuffer, (short)3, (short)0x81)==+1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 21 : Successful call + testCaseNb = (byte)21 ; + bRes = false ; + + try { + + // Append a 2nd Text String TLV + TLVBuffer[0] = (byte)0x00 ; + TLVBuffer[1] = (byte)0x11 ; + TLVBuffer[2] = (byte)0x22 ; + TLVBuffer[3] = (byte)0x33 ; + TLVBuffer[4] = (byte)0x44 ; + TLVBuffer[5] = (byte)0x55 ; + + EnvRespHdlr.appendTLV((byte)0x0D, TLVBuffer, (short)0, (short)6) ; + + // initialise the buffer + Util.arrayFillNonAtomic(TLVBuffer,(short)0,(short)TLVBuffer.length,(byte)0x55); + Util.arrayCopyNonAtomic(ref_data,(short)0,TLVBuffer,(short)3,(short)0x81); + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)1, (short)0, TLVBuffer, (short)3, (short)0x81)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 22 : Successful call + testCaseNb = (byte)22 ; + bRes = false ; + + try { + + // Append a 2nd Text String TLV + TLVBuffer[0] = (byte)0x00 ; + TLVBuffer[1] = (byte)0x11 ; + TLVBuffer[2] = (byte)0x22 ; + TLVBuffer[3] = (byte)0x33 ; + TLVBuffer[4] = (byte)0x44 ; + TLVBuffer[5] = (byte)0x55 ; + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)2, (short)0, TLVBuffer, (short)0, (short)6)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 23 : Successful call + testCaseNb = (byte)23 ; + bRes = false ; + + try { + // Initialise buffers + TLVBuffer[5] = (byte)0x66 ; + + if(EnvRespHdlr.findAndCompareValue((byte)0x0D, (byte)2, (short)0, TLVBuffer, (short)0, (short)6)==-1) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 24 : Successful call : search tag 8Dh + testCaseNb = (byte) 24 ; + bRes = false ; + + TLVBuffer = new byte[17]; + try { + // initialise the buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D, TLVBuffer, (short)0, (short)17) ; + + if(EnvRespHdlr.findAndCompareValue((byte)0x8D, (byte)1, (short)0, TLVBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 25 : Successful call : search tag 8Fh + testCaseNb = (byte) 25 ; + bRes = false ; + + byte[] compareBuffer16=new byte[16]; + + try { + // Append tag 0Fh + EnvRespHdlr.appendTLV((byte)0x0F, TLVBuffer, (short)1, (short)16) ; + + for(short i=0;i<16;i++) + TLVBuffer[i]=TLVBuffer[(short)(i+1)]; + + if(EnvRespHdlr.findAndCompareValue((byte)0x8F, (byte)1, (short)0, TLVBuffer, (short)0, (short)16)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 26 : Successful call (with the length = 0 and the offset = length of the comparaison buffer) + testCaseNb = (byte) 26 ; + bRes = false ; + + try { + if(EnvRespHdlr.findAndCompareValue((byte)0x8F, (byte)1, (short)0, TLVBuffer, (short)TLVBuffer.length, (short)0)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 27 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 27 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.findAndCompareValue((byte)0x8F, (byte)1, (short)0, TLVBuffer, (short)0x0F, (short)0); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes = true; + } else { + bRes = false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/Test_Api_2_Erh_Facrbbs_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/Test_Api_2_Erh_Facrbbs_Bss.java new file mode 100644 index 0000000..985c718 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/Test_Api_2_Erh_Facrbbs_Bss.java @@ -0,0 +1,109 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Facrbbs_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_facrbbs_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_facrbbs_bss + * + * @version 0.0.1 - 8 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Facrbbs_Bss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_facrbbs_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Facrbbs_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 27 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "1BCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/applet.opt new file mode 100644 index 0000000..b272389 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_facrbbs_bss.Api_2_Erh_Facrbbs_Bss_1 +uicc.test.toolkit.api_2_erh_facrbbs_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/javacard/api_2_erh_facrbbs_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facrbbs_bss/javacard/api_2_erh_facrbbs_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..c475877806eab217f7094af0360b76ce6bffcb86 GIT binary patch literal 6836 zcmbuD3tUuH9>>p}=bafCej_u8B5I`xX7Vrv1&oIgY9RSsGb2C@5@iB3v#mz7mk65X z_E1YJd+es`CT?mL>6VsdTWt?Bv$8c?A7$2-YbE>pkLbXJZnDGYe7|$%o^$@^oO|x& z-jhGvXmTr^f0#A2ziRPuE0fB-Vsyr(L-VrZax?OVW?wOCbl=?UlRK1JJuJzHRS;;+#>B z#IO3?x_Dmg{pxV{j}H#b?!R>F*8`f~srJt8`trmL!?rBkKJw|+@0LH4zHr-HFHZgF zgG(kR8pfv9NA2GH!P}XAzPvW6blXKqMaTLLEA7)O+>?9%bE|LI^yJzr_q#1`T=m+r zvLRm#T%K^x%5JGH-vGC(A!EtoRX^Y8T6giT9`|k>UBA7{lF{31pG~`O%|k1fczeA1 z@Q84!&>d!>ea+GYB8NvmVBrXGsQA8ysR z9qwwpT~lhmNvV9E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k?Y)u9S3f_eb z1d1`XV^D!T$>2c2`-*`;jqM2(yvrCIE_hoo5Uzp??YvJ`*6B^c;5fm%fq^)mwI@zs zZ!kDe@a;DcXjgbU1{8EN4vrRl2M$EbaU)>Zex&QzG literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/Api_2_Erh_Facyb_Bs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/Api_2_Erh_Facyb_Bs_1.java new file mode 100644 index 0000000..e6ac2c0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/Api_2_Erh_Facyb_Bs_1.java @@ -0,0 +1,444 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Facyb_Bs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_facyb_bs; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_facyb_bs + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Facyb_Bs_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + byte[] ref_data = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4,(byte)0xC5,(byte)0xC6,(byte)0xC7,(byte)0xC8,(byte)0xC9,(byte)0xCA,(byte)0xCB,(byte)0xCC,(byte)0xCD,(byte)0xCE,(byte)0xCF,(byte)0xD0, + (byte)0xD1,(byte)0xD2,(byte)0xD3,(byte)0xD4,(byte)0xD5,(byte)0xD6,(byte)0xD7,(byte)0xD8,(byte)0xD9,(byte)0xDA,(byte)0xDB,(byte)0xDC,(byte)0xDD,(byte)0xDE,(byte)0xDF,(byte)0xE0, + (byte)0xE1,(byte)0xE2,(byte)0xE3,(byte)0xE4,(byte)0xE5,(byte)0xE6,(byte)0xE7,(byte)0xE8,(byte)0xE9,(byte)0xEA,(byte)0xEB,(byte)0xEC,(byte)0xED,(byte)0xEE,(byte)0xEF,(byte)0xF0, + (byte)0xF1,(byte)0xF2,(byte)0xF3,(byte)0xF4,(byte)0xF5,(byte)0xF6,(byte)0xF7,(byte)0xF8,(byte)0xF9,(byte)0xFA,(byte)0xFB,(byte)0xFC,(byte)0xFD,(byte)0xFE,(byte)0xFF,(byte)0x00 + }; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Facyb_Bs_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Facyb_Bs_1 thisApplet = new Api_2_Erh_Facyb_Bs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of tests + boolean bRes; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Null as dstBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + byte[] TLVBuffer=new byte[20]; + byte[] dstBuffer=new byte[20]; + + try { + //initialize the buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + //built the first TLV + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 16); + + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, null, (short)0) ; + } + catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 2 : dstOffset >= dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, dstBuffer, (short)20) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, dstBuffer, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstOffset + length > dstBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, dstBuffer, (short)5) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : length > dstBufferLength + testCaseNb = (byte) 5 ; + bRes = false ; + + dstBuffer=new byte[15]; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, dstBuffer, (short)0) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Unavailable element + testCaseNb = (byte) 6 ; + bRes = false ; + + TLVBuffer[0]=(byte)11; + TLVBuffer[1]=(byte)22; + + EnvRespHdlr.clear(); + //built the first tlv + EnvRespHdlr.appendTLV((byte)TAG_DEVICE_IDENTITIES,TLVBuffer,(short) 0x00, (short) 2); + + // Select a TLV + EnvRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + try { + EnvRespHdlr.findAndCopyValue((byte)0x03, dstBuffer, (short)0) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false; + } + + // Verify there is no current TLV + try { + EnvRespHdlr.getValueLength() ; + } + catch (ToolkitException e) { + bRes &= (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + dstBuffer=new byte[20]; + try { + //initialize the buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + //built the second TLV + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 17); + + if(EnvRespHdlr.findAndCopyValue((byte)0x0D, dstBuffer, (short)0)==(short)17) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Compare buffer + testCaseNb = (byte) 8 ; + bRes = false ; + try { + if(Util.arrayCompare(TLVBuffer, (short)0,dstBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 9 : Successful call + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + // Initialise dstBuffer + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)dstBuffer.length,(byte)0x55); + + if(EnvRespHdlr.findAndCopyValue((byte)0x0D, dstBuffer, (short)2)==(short)19) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Compare buffer + testCaseNb = (byte) 10 ; + bRes = false ; + + // Initialise compareBuffer + Util.arrayFillNonAtomic(TLVBuffer,(short)0,(short)TLVBuffer.length,(byte)0x55); + TLVBuffer[2] = (byte)4; + for (short i=3; i<19; i++) + TLVBuffer[i] = (byte)(i-3); + + try { + if(Util.arrayCompare(TLVBuffer, (short)0,dstBuffer, (short)0, (short)20)==(short)0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 11 : Successful call with 2 Text String TLV + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + + TLVBuffer[2] = (byte)4; + for (short i=3; i<19; i++) + TLVBuffer[i] = (byte)(i-3); + + //built the first TLV + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 17); + + //built the second TLV + EnvRespHdlr.appendTLV((byte)0x0D,(byte)0x11); + + if(EnvRespHdlr.findAndCopyValue((byte)0x0D, dstBuffer, (short)0)==(short)17) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Compare buffer + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + if(Util.arrayCompare(TLVBuffer, (short)0,dstBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successful call, tag = 8Dh + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 17); + + if(EnvRespHdlr.findAndCopyValue((byte)0x8D, dstBuffer, (short)0)==(short)17) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Compare buffer + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + if(Util.arrayCompare(TLVBuffer, (short)0,dstBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Successful call, tag = 8Fh + testCaseNb = (byte) 15 ; + bRes = false ; + + dstBuffer = new byte[131]; + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)dstBuffer.length,(byte)0x55); + + try { + // Append TLV with tag 0Fh + EnvRespHdlr.appendTLV((byte)0x0F,ref_data,(short) 0x00, (short) 0x80); + + // Search tag 8Fh + if(EnvRespHdlr.findAndCopyValue((byte)0x8F, dstBuffer, (short)3)==(short)0x83) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Compare buffer (with the length = 0 and the offset = length of the destination buffer) + testCaseNb = (byte) 16 ; + bRes = false ; + + // Initialise the comparison buffer + TLVBuffer = new byte [131]; + Util.arrayFillNonAtomic(TLVBuffer,(short)0,(short)TLVBuffer.length,(byte)0x55); + Util.arrayCopyNonAtomic(ref_data,(short)0,TLVBuffer,(short)3,(short)0x80); + + try { + if(Util.arrayCompare(TLVBuffer, (short)0,dstBuffer, (short)0, (short)dstBuffer.length)==0) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 17 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.findAndCopyValue((byte)0x8F, dstBuffer, (short)0); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes = true; + } else { + bRes = false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/Test_Api_2_Erh_Facyb_Bs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/Test_Api_2_Erh_Facyb_Bs.java new file mode 100644 index 0000000..e8afd5e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/Test_Api_2_Erh_Facyb_Bs.java @@ -0,0 +1,106 @@ +//----------------------------------------------------------------------------- +//Test_Api_Erh_Facyb_Bs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_facyb_bs; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_facyb_bs + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Facyb_Bs extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_facyb_bs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Facyb_Bs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 17 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "11CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/applet.opt new file mode 100644 index 0000000..6cde6e2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_facyb_bs.Api_2_Erh_Facyb_Bs_1 +uicc.test.toolkit.api_2_erh_facyb_bs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/javacard/api_2_erh_facyb_bs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facyb_bs/javacard/api_2_erh_facyb_bs.cap new file mode 100644 index 0000000000000000000000000000000000000000..1c13131d452497dd9fd7dfea494e53d1ae61333e GIT binary patch literal 5979 zcmb7|30zcF8;8%Gxik090{l@15W+1@ToKfy5CuV$5Jl8f3=t6(K|w%Gv>H%zK@la( ztu)QbaxFBo+|$z3Tyi(dB{P>ot<Bl24x}B(Yc?em=cIgw|GP*}pKx}xA=%_Be`?QLU`e(loYvN-w3tD?`D=Dj&cg}T> z=fcHX8yuUGI(pcG#OSFPeJuT(MwS0tPv0`G@r5^(q+zxAWx?@R3iPYY8*1*JL8@;w9%a=Q-dGT9M zlth0tXw2yqP4C7oo#EDL`OcRw1Oz2cTt3j~*R1o^(MKaa+P3joeRW>AdDPvxqIAXd zWqu={*nR1wU$2mYM2}T5mtORb>y`8Q{%ehHz1}oI8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=|IJ~{aIvc zPD*xK7H#J_8heQy0fTj;AX2Kx>^2WItnZjN*8lVvpjhbv7OQ;fiAv#{&|3 zlyy!=aXc<@jOBQ?VUIPKR+e)U6j6E7;TXj6NW&iFkkdiz2ON%396vqnQTD;vR2)7_ z9YZ;OfZ9XRcaxK&=J0Xq7|QX(%^ph7A)9j(RP&=QE=EV^WI~wer$5cZP1~W}{{V01 Br&|C3 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/Api_2_Erh_Facybbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/Api_2_Erh_Facybbs_Bss_1.java new file mode 100644 index 0000000..6ef6c53 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/Api_2_Erh_Facybbs_Bss_1.java @@ -0,0 +1,637 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Facybbs_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_facybbs_bss; + +import javacard.framework.Util; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_facybbs_bss + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Facybbs_Bss_1 extends TestToolkitApplet { + + + // Number of tests + byte testCaseNb = (byte) 0x00; + + byte[] ref_data = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4,(byte)0xC5,(byte)0xC6,(byte)0xC7,(byte)0xC8,(byte)0xC9,(byte)0xCA,(byte)0xCB,(byte)0xCC,(byte)0xCD,(byte)0xCE,(byte)0xCF,(byte)0xD0, + (byte)0xD1,(byte)0xD2,(byte)0xD3,(byte)0xD4,(byte)0xD5,(byte)0xD6,(byte)0xD7,(byte)0xD8,(byte)0xD9,(byte)0xDA,(byte)0xDB,(byte)0xDC,(byte)0xDD,(byte)0xDE,(byte)0xDF,(byte)0xE0, + (byte)0xE1,(byte)0xE2,(byte)0xE3,(byte)0xE4,(byte)0xE5,(byte)0xE6,(byte)0xE7,(byte)0xE8,(byte)0xE9,(byte)0xEA,(byte)0xEB,(byte)0xEC,(byte)0xED,(byte)0xEE,(byte)0xEF,(byte)0xF0, + (byte)0xF1,(byte)0xF2,(byte)0xF3,(byte)0xF4,(byte)0xF5,(byte)0xF6,(byte)0xF7,(byte)0xF8,(byte)0xF9,(byte)0xFA,(byte)0xFB,(byte)0xFC,(byte)0xFD,(byte)0xFE,(byte)0xFF,(byte)0x00 + }; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Facybbs_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Facybbs_Bss_1 thisApplet = new Api_2_Erh_Facybbs_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + // Result of tests + boolean bRes, bRes2 ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Null as dstBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + byte[] TLVBuffer=new byte[20]; + byte[] dstBuffer=new byte[5]; + + try { + //initialize the buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 16); + + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (byte)0, null, (byte)0, (byte)1) ; + + } + catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : dstOffset >= dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (byte)0, dstBuffer, (byte)5, (byte)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (byte)0, dstBuffer, (byte)-1, (byte)1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)0, dstBuffer, (short)0, (short)6) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)0, dstBuffer, (short)3, (short)3) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)0, dstBuffer, (short)0, (short)-1) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : valueOffset >= Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + dstBuffer=new byte[15]; + + try { + // Initialise the handler + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 6); + + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)6, dstBuffer, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)-1, dstBuffer, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : dstLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)0, dstBuffer, (short)0, (short)7) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + dstLength > Text String Length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)2, dstBuffer, (short)0, (short)5) ; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Unavailable Element + testCaseNb = (byte) 11 ; + bRes = false ; + + // Initialise the handler + EnvRespHdlr.clear(); + TLVBuffer[0]=(byte)0x11; + TLVBuffer[2]=(byte)0x22; + EnvRespHdlr.appendTLV((byte)0x02,TLVBuffer,(short) 0x00, (short) 2); + + // Select a TLV + EnvRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + try { + EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)2, (short)0, dstBuffer, (short)0, (short)1) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false; + } + + // Verify there is no current TLV + try { + EnvRespHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes &= (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 12 : Successful call + testCaseNb = (byte) 12 ; + bRes = false ; + dstBuffer = new byte[17]; + + try { + // Initialise buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + // Initialise the handler + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 17); + + if(EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)0, dstBuffer, (short)0, (short)17)==(short)17) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare buffer + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + if(Util.arrayCompare(TLVBuffer, (short)0, dstBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successful call + testCaseNb = (byte) 14 ; + bRes = false ; + dstBuffer=new byte[20]; + try { + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)dstBuffer.length,(byte)0x55); + + if(EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)2, dstBuffer, (short)3, (short)12)==15) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Compare buffer + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + Util.arrayFillNonAtomic(TLVBuffer,(short)0,(short)TLVBuffer.length,(byte)0x55); + // Initialise compare buffer + for (short i=3; i<15; i++) + TLVBuffer[i] = (byte)(i-2) ; + + if(Util.arrayCompare(TLVBuffer, (short)0, dstBuffer, (short)0, (short)20)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Successful call with 2 Text String TLV + testCaseNb = (byte) 16 ; + bRes = false ; + + dstBuffer=new byte[17]; + try { + + TLVBuffer[0] = (byte) 0x00 ; + TLVBuffer[1] = (byte) 0x11 ; + TLVBuffer[2] = (byte) 0x22 ; + TLVBuffer[3] = (byte) 0x33 ; + TLVBuffer[4] = (byte) 0x44 ; + TLVBuffer[5] = (byte) 0x55 ; + + //add a second TLV + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 6); + + if(EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)1, (short)0, dstBuffer, (short)0, (short)17)==(short)17) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Compare buffer + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + //initialize the compare buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + if(Util.arrayCompare(TLVBuffer, (short)0, dstBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : Successful call with 2 Text String TLV + testCaseNb = (byte) 18 ; + bRes = false ; + + dstBuffer=new byte[6]; + + try { + if(EnvRespHdlr.findAndCopyValue((byte)0x0D, (byte)2, (short)0, dstBuffer, (short)0, (short)6)==(short)6) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 19 : Compare buffer + testCaseNb = (byte) 19 ; + bRes = false ; + + try { + TLVBuffer[0] = (byte) 0x00 ; + TLVBuffer[1] = (byte) 0x11 ; + TLVBuffer[2] = (byte) 0x22 ; + TLVBuffer[3] = (byte) 0x33 ; + TLVBuffer[4] = (byte) 0x44 ; + TLVBuffer[5] = (byte) 0x55 ; + + if(Util.arrayCompare(TLVBuffer, (short)0, dstBuffer, (short)0, (short)6)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + // -------------------------------------------- + // Test Case 20 : Successful call, tag = 8Dh + testCaseNb = (byte) 20 ; + bRes = false ; + + dstBuffer=new byte[17]; + + //initialize the compare buffer + for(short i=1;i<17;i++) + TLVBuffer[i]=(byte)(i-1); + TLVBuffer[0]=(byte)4; + + try { + // Initialise handler + EnvRespHdlr.clear(); + //add the first TLV + EnvRespHdlr.appendTLV((byte)0x0D,TLVBuffer,(short) 0x00, (short) 17); + + if(EnvRespHdlr.findAndCopyValue((byte)0x8D, (byte)1, (short)0, dstBuffer, (short)0, (short)17)==(short)17) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 21 : Compare buffer + testCaseNb = (byte) 21 ; + bRes = false ; + + try { + + if(Util.arrayCompare(TLVBuffer, (short)0,dstBuffer, (short)0, (short)17)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 22 : Successful call, tag = 8Fh + testCaseNb = (byte) 22 ; + bRes = false ; + + dstBuffer = new byte[131]; + Util.arrayFillNonAtomic(dstBuffer,(short)0,(short)dstBuffer.length,(byte)0x55); + + try { + + // Append TLV with tag 0Fh + EnvRespHdlr.appendTLV((byte)0x0F,ref_data,(short) 0x00, (short) 0x80); + + // Search tag 8Fh + if(EnvRespHdlr.findAndCopyValue((byte)0x8F, (byte)1, (short)0, dstBuffer, (short)0, (short)0x80)==(short)0x80) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 23 : Compare buffer + testCaseNb = (byte) 23 ; + bRes = false ; + + // Initialise the comparison buffer + TLVBuffer = new byte [131]; + Util.arrayFillNonAtomic(TLVBuffer,(short)0,(short)TLVBuffer.length,(byte)0x55); + Util.arrayCopyNonAtomic(ref_data,(short)0,TLVBuffer,(short)0,(short)0x80); + + try { + + if(Util.arrayCompare(TLVBuffer, (short)0,dstBuffer, (short)0, (short)dstBuffer.length)==0) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 24 : Successful call (with the length = 0 and the offset = length of the comparaison buffer) + testCaseNb = (byte) 24 ; + bRes = false ; + + try { + // Search tag 8Fh + if(EnvRespHdlr.findAndCopyValue((byte)0x8F, (byte)0x01, (short)0, dstBuffer, (short)dstBuffer.length, (short)0)==(short)dstBuffer.length) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 25 : BAD INPUT PARAMETER, occurence = 0 + testCaseNb = (byte) 25 ; + bRes = false ; + + try { + try { + EnvRespHdlr.findAndCopyValue((byte)0x8F, (byte)0, (short)0, dstBuffer, (short)0, (short)0); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) { + bRes = true; + } else { + bRes = false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 26 : ToolkitException HANDLER_NOT_AVAILABLE + testCaseNb = (byte) 26 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.findAndCopyValue((byte)0x8F, (byte)1, (short)0, dstBuffer, (short)0, (short)0); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes = true; + } else { + bRes = false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/Test_Api_2_Erh_Facybbs_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/Test_Api_2_Erh_Facybbs_Bss.java new file mode 100644 index 0000000..1f3276f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/Test_Api_2_Erh_Facybbs_Bss.java @@ -0,0 +1,106 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Facybbs_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_facybbs_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_facybbs_bss + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Facybbs_Bss extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_facybbs_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Facybbs_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 26 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "1ACCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/applet.opt new file mode 100644 index 0000000..ad0a812 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_facybbs_bss.Api_2_Erh_Facybbs_Bss_1 +uicc.test.toolkit.api_2_erh_facybbs_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/javacard/api_2_erh_facybbs_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_facybbs_bss/javacard/api_2_erh_facybbs_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..9c030bf2f46e8ffc174de0ccbded4e8ad8fd6050 GIT binary patch literal 6867 zcmbW530zcF8;8%GJ9FpG{vVkc2FN9I!8A~`oIp~-4N*hQHY)|hL_`S4(zXj~X$n%B z=9){ErWK}{nM;dHS!P+5nOSOSi>7H=X2SQr131onXv*+A&ol4bbI*Iux#wPHPFkw0 zcL|mL!p5dtFD`hwgkJRNc5BjgDSf-g_DSlS(!JY&TVwikuiP%gEB*WAm9+J4oOYt| z*nRdbYvNzpu<-NES)+!{z9(hE!ASQVgGwvUx{nx}NN*n9m3DIdqx+9!e%#bqu;hSo zX0Odo!=9uyyJybLZuHLno6db!Q1N7=cfTzPD_(gbYsKkar{2&l{@}siaz9#g@7J>j zR5&+&_vzs`o+vxCyZ=v0>i8a=VmfaqKXdlX-D3)ujQn+0Zp6{{5$}8!KPhW_hxE#4 zuJdjFv|(aDZM3!D>f{NFAFdp`U|63DOLAeWtLC}fo^7jEob&B1NN#()We{FJ0+ zYxk8W6eq7d7`}YsxK-M;@pBAAN8fOlS@(f7;UmM8raQuio%^{(%DHjJ|IN9knIqb} zF81@J`;R5h9hT(_%kF!~r_0-@EVZ1Fx8&|Us#Ok&m-P!r&svnazHj7fg;Ty-R{B>) z(Tjt3%+~#|{0=F%a=`6vm;JQe-FjI@?zF-YZ;e`;^7_HO6VI;PmFVr*cB^gb)<378 z+}^S>?WOg5cf}uwES-g(%~uc1+jjkd?7t5$9keOCTcZ(!zDr9rs`Kw$^6X=h5I^dL zNTX|L_Fp-^h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XpD|IZ@|C|aZXSnoJ;?ncfz~4os`i`kt4K=qfl)C07tY&Whb2Qa? zm5WS`D=;;e?tbuXe14gf>g$@Dpq1#Z>8XD?1-cPb$HR5#+fW_r#PNzG)0d~(bvf0a zkU!w(E4gNJf|?5tG^fxNch{~TYKlTSsZ@j|@B#mlyhxwC{(c+a&qym*_GhFwb!CjG ztt@k+)m0Pn-O(nuiJxlr9EI*58l(TQ7Sz|s>N9KZLOuN}vWL?WtR81=L#~>J3>R%@ zZ19iooE>}Kw9$`lE?w&L<9k3+dQo;}_w1~Z{vX6D?bDop1*d8;HRsTLI>x07l`H<8 z-#=?u@4QS(mp6)kdz)xO$XPXjx1*}6iW~a1Bvm|NR4?tthee_b0>R582!2Y zrGXumNS7tj?Wfgig2iL?#@gX=hJ_QFg>`}_CM?R+A*}jCufrMcwb{Zv;Vw&*RdrY* zgU8;W@3Wq1G-fWH>ofMQS%sMe+4;0R#zVJ=a@rLVLZ;0QxmZ`C(jJHZ)rPlcBuy5@ zQi_OE#`A}g$+%N=5Lfeivt&FedMoQiD+*lVTG2+tR8@&MIvywDs^^0#I#NlX-K{R7 ztLQ1Ul`0Iwo0Ln?uWmmx+tqxCmU8Lv%Bh&(o!Xzi<+$6NWO4;k~flrUl-d} z=2px#OQ^1`%s?xfX{1-Yf&v?xp@~9wF9V6ykV9PQzQRuc~Akn7!BnsVx3{4lhV;D$RNDJ+XS4DE|{$XgI(2c@Co*(Ly zC$Mc8nke)s97uE`tR4djc_xQu3w;m=vJG<8BU{L0IW$}7qc4!{c6U9p1wRPWQVj|> OXraH+bWM7AIQk#G9W&hk literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/Api_2_Erh_Find_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/Api_2_Erh_Find_1.java new file mode 100644 index 0000000..1cee9b5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/Api_2_Erh_Find_1.java @@ -0,0 +1,322 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Find_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_find; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_find + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Find_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Find_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Find_1 thisApplet = new Api_2_Erh_Find_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : invalid input parameter (occurrence = 0) + testCaseNb = (byte) 1 ; + bRes = false ; + + byte[] data = new byte[0x03]; + + //initialize the buffer + data[0]=(byte)11; + data[1]=(byte)22; + data[2]=(byte)33; + + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x81,data,(short) 0x00, (short) 0x03); + + + //initialize the buffer + data[0]=(byte)99; + data[1]=(byte)77; + + //built the second tlv + EnvRespHdlr.appendTLV((byte)0x82,data,(short) 0x00, (short) 0x02); + + try { + EnvRespHdlr.findTLV((byte)0x01, (byte) 0x00) ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Search 1st TLV + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + if(EnvRespHdlr.findTLV((byte)0x01, (byte) 0x01)==TLV_FOUND_CR_SET) + bRes =true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Verify selected TLV + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + if((short)0x03==EnvRespHdlr.getValueLength()) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Search 2nd TLV + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + if(EnvRespHdlr.findTLV((byte)0x02, (byte) 0x01)==TLV_FOUND_CR_SET) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Verify selected TLV + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + if((short)0x02==EnvRespHdlr.getValueLength()) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Search a wrong tag + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + // Select a correct TLV + EnvRespHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)0x02) ; + if(EnvRespHdlr.findTLV((byte)0x03, (byte) 0x01)==TLV_NOT_FOUND) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Verify the current TLV is no longer defined + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + if(EnvRespHdlr.getValueLength()==0) + bRes=false; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Search a tag with a wrong occurence + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + if(EnvRespHdlr.findTLV((byte)0x01, (byte) 0x02)==TLV_NOT_FOUND) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Verify the current TLV is no longer defined + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + if(EnvRespHdlr.getValueLength()==0) + bRes=false; + } + catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Search a TLV with occurence=2 + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + // Append Tag 0x02 + EnvRespHdlr.appendTLV((byte)0x02, (byte)0x00) ; + // Search the tag + if(EnvRespHdlr.findTLV((byte)0x02, (byte) 0x02)==TLV_FOUND_CR_NOT_SET) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Search a TLV + testCaseNb = (byte) 11 ; + bRes = false ; + try { + // Append Tag 0x04 + EnvRespHdlr.appendTLV((byte)0x04, (byte)0x00) ; + + // Search the tag + if(EnvRespHdlr.findTLV((byte)0x04, (byte) 0x01)==TLV_FOUND_CR_NOT_SET) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Search tag 81h + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + // Search the tag + if(EnvRespHdlr.findTLV((byte)0x81, (byte) 0x01)==TLV_FOUND_CR_SET) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Search tag 84h + + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + // Search the tag + if(EnvRespHdlr.findTLV((byte)0x84, (byte) 0x01)==TLV_FOUND_CR_NOT_SET) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : ToolkitException HANDLER_NOT_AVAILABLE + + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.findTLV((byte)0x81, (byte) 0x01); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/Test_Api_2_Erh_Find.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/Test_Api_2_Erh_Find.java new file mode 100644 index 0000000..18bc263 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/Test_Api_2_Erh_Find.java @@ -0,0 +1,105 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Find.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_find; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_find + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Find extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_find"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Find() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 14 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0ECCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/applet.opt new file mode 100644 index 0000000..e40844d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_find.Api_2_Erh_Find_1 +uicc.test.toolkit.api_2_erh_find +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/javacard/api_2_erh_find.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_find/javacard/api_2_erh_find.cap new file mode 100644 index 0000000000000000000000000000000000000000..3ccc0c7d59239285be6d735b77df3fcde8a9ed7d GIT binary patch literal 3633 zcmb7G4@?th6o2=xz4mB5w1t90go#6qR4SVYQ9%U9u%;0It9==&Fu7!G8}HW z9beU{J+Wu&#zU#wR6ll}9(7=iVntceJ1vHLw~9N9vX++r+Op-^f(HkGI{9f*;`M#r zT{EsHnv;)4nKZ@jZS&b%<4?u!sbM_K&WDLqVdSZ_p6~S~H;xue?7oyXmFx4@o;NpWerfA}wse1FLp9(yJC9pn?lmbF62=~XeMC)zeZs%S%J4rMrf&bB z>*K<2|GRx6=JJs*bK+*lZnhLC`J{-X!<7_32Mb`qtyB9pjBMQxo#Qg%a7HK%snTJy z89nw2kJ00F&M9+vj8>PU#8hH;&nlVeC@(e6w!Uw*S>2_^SMAnPyF0~Zbx{!8b*kqk zMYBMO&1gggTn~=rgAp?f<)9HGzKYjxJeGT-R5z+7Z5}m;vp7E2bquoQA{eR zArH+tk#Mk-4A$9lttA=-gu;t5+vS>L_Yh15bk9UbK~r#i<;J?p;}L{VctH7cT~43+dzYeQS?-T-p;ri0us@F$b##qGF`*2k(DR++EU)lb%RLtS3`qDK zuGi9Nf|d{sxdLD{BLR)XE66*q3P}Uh5*ifVe)!A+}LA+5wRE`8x52%SNN2+P?@|4=El+Kq;Bj{*(%V z^uSXpNlm>3Dr$_Rr6waUmLe!S@=Bc7AYY5~FOauM(bO5_T_8~1xUNeQsE44UHIjyY z0r^M}=nUZLk&-|c;CzM@O;;jcihMKj-BLgL8|3GZUj-GzfWU~Te@9AThTwbAuo4so zW*Jm*sr5jQTM10cKtmjxZHP;%1$JO9a08c6bR7*!R2j;cJ^^(y%bJ)}#VR40({qd{ zr0Y3WjKVu7CZy|Gu^Qhh>NpVk5wXoDHWPst=bT@_vP>QNLT9>SlNEYJEkuagGLCgI zOsb1d##FgzL;Rpx&~ON)XIa*#&6cq&kt+gn1#v~s)=?PPvr?sRHP`2A9_3u0t3_g5 z&vKmKRXwZl8?rv*h3E(Jd0}PIyO`dn6weJxB)Axr-|%zHseJN~&8hu<`cf)BahQ8H zAEMyXR6f>J`U85NW`s{utnM>+qQ)U>puX4H>R5Q@>ui8kQk_j)qu5u z%&=ZH!B9vb&sZUkfQfbiIVZF*2nP4`px#iVA>@?C*)XJ$V5CNIvj(rCM7AvzAF`+{ z#w60&mI8{_;Ys_r*?YQ|AkALz=&SW3R@A-Q_q@I%VC4Wt7kYLAU5Fe(-f9F8hT}07 zIzmw6AqSB+76FhgVSxnN3^{_lqX;0V@lXprj6i=ON09dj0ffe|5ab<$97lfa2XKt| z6@?y2&f_LP4j@160{|Ps0tlS_as+uL3n0Yv;e;ToYjPNQF$=&f2@6J6+T<|uniPO} b5vxe(8xmZhECn34h5!OyqcHE?zKZle_ 0x81) && (sCapacity <= 0x102)) + { + envRespHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 3)); + } + else if (sCapacity > 0x102) + { + envRespHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 4)); + } + bRes &= true; + } + catch (Exception e) { + bRes = false; + } + + // clear the handler + try { + envRespHdlr.clear(); + bRes &= true; + } + catch (Exception e) { + bRes = false; + } + + // Fill the handler with the maximum capacity + 1 + try { + if (sCapacity <= 0x81) + { + envRespHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 1)); + } + else if ((sCapacity > 0x81) && (sCapacity <= 0x102)) + { + envRespHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 2)); + } + else if (sCapacity > 0x102) + { + envRespHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 3)); + } + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.HANDLER_OVERFLOW) + bRes &= true ; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/Test_Api_2_Erh_Gcap.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/Test_Api_2_Erh_Gcap.java new file mode 100644 index 0000000..da9cfd9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/Test_Api_2_Erh_Gcap.java @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Gcap.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_gcap; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_gcap + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Gcap extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_gcap"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Gcap() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "01CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/applet.opt new file mode 100644 index 0000000..dcfc677 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_gcap.Api_2_Erh_Gcap_1 +uicc.test.toolkit.api_2_erh_gcap +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/javacard/api_2_erh_gcap.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gcap/javacard/api_2_erh_gcap.cap new file mode 100644 index 0000000000000000000000000000000000000000..deef3d2c884bfe474f9470d33b5d52a7aca9f884 GIT binary patch literal 3177 zcmb7`4NOy46vxkfUwyO%DnczFSRo?crF{5>s90s=%T&;ykMZdaE3V(=G+)FMwh8$=OSAA+%kHbe_!7_xA%9? zJ@=mTjD;*03L<{OT=`irrG)|q#jDrlrsS{5(-r5g$3LeUxNN)EdtIdd+yhr{UI!xv2E8r~Kl= zxVqF5#?xHX+rB$d-TV2rKYC9)T5K2AdkQWdc%|gdQ2A*~(38whyNY`=58wT8hUfO$ zZ`c0S-4;@zAL%e;M1McG{r4Y}j~=uxy_VG+y-)vO|G~X{-#dAAOUx?6cVEnhZSgUc zyQ=z!$F9e^mV5F;8cs%?A#}s5&r(}_bLCuHwKTlRPtOx~1stgoT|=h4}bRsGRt%%+S7!F%p(i8pIBM^(@bNbOjNdaR_!1FgB*YnV<(@87>(WKn>kCO@Qx}IwcTnq>ztN4 zr_O1&*Hl}bI+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ne$sH= IV?}!R4|(fJs{jB1 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/Api_2_Erh_Glen_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/Api_2_Erh_Glen_1.java new file mode 100644 index 0000000..17f8bc5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/Api_2_Erh_Glen_1.java @@ -0,0 +1,191 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Glen_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_glen; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_glen + * + * @version 0.0.1 - 5 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Glen_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + byte[] data = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4,(byte)0xC5,(byte)0xC6,(byte)0xC7,(byte)0xC8,(byte)0xC9,(byte)0xCA,(byte)0xCB,(byte)0xCC,(byte)0xCD,(byte)0xCE,(byte)0xCF,(byte)0xD0, + (byte)0xD1,(byte)0xD2,(byte)0xD3,(byte)0xD4,(byte)0xD5,(byte)0xD6,(byte)0xD7,(byte)0xD8,(byte)0xD9,(byte)0xDA,(byte)0xDB,(byte)0xDC,(byte)0xDD,(byte)0xDE,(byte)0xDF,(byte)0xE0, + (byte)0xE1,(byte)0xE2,(byte)0xE3,(byte)0xE4,(byte)0xE5,(byte)0xE6,(byte)0xE7,(byte)0xE8,(byte)0xE9,(byte)0xEA,(byte)0xEB,(byte)0xEC,(byte)0xED,(byte)0xEE,(byte)0xEF,(byte)0xF0, + (byte)0xF1,(byte)0xF2,(byte)0xF3,(byte)0xF4,(byte)0xF5,(byte)0xF6,(byte)0xF7,(byte)0xF8,(byte)0xF9,(byte)0xFA,(byte)0xFB,(byte)0xFC,(byte)0xFD,(byte)0xFE,(byte)0xFF,(byte)0x00 + }; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Glen_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Glen_1 thisApplet = new Api_2_Erh_Glen_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + // Result of tests + boolean bRes ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + + switch ( testCaseNb ) { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : length = 0 + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + bRes = (EnvRespHdlr.getLength() == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + return; + + case (byte) 1 : + + // -------------------------------------------- + // Test Case 2 : length = 7 + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + EnvRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short) 0x07); + bRes = (EnvRespHdlr.getLength() == (short)9) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + return; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : length = getCapacity() + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short)(EnvRespHdlr.getCapacity()- 3)); + bRes = (EnvRespHdlr.getLength() == (short)EnvRespHdlr.getCapacity()) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + return; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : length = 7Fh + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + EnvRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short) 0x7F); + bRes = (EnvRespHdlr.getLength() == (short)0x0081) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + return; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5 : length = 80h + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + EnvRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short) 0x80); + bRes = (EnvRespHdlr.getLength() == (short)0x0083) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + return; + + case (byte)5: + // -------------------------------------------- + // Test Case 6 : ToolkitException HANDLER_NO_AVAILABLE + testCaseNb=(byte)6; + bRes=false; + + try { + EnvRespHdlr.post(true); + try { + EnvRespHdlr.getLength(); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + return; + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/Test_Api_2_Erh_Glen.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/Test_Api_2_Erh_Glen.java new file mode 100644 index 0000000..645142e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/Test_Api_2_Erh_Glen.java @@ -0,0 +1,122 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Glen.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_glen; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_glen + * + * @version 0.0.1 - 5 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Glen extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_glen"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Glen() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 + test.unrecognizedEnvelope(); + + // Test case 2 + test.unrecognizedEnvelope(); + + // Test case 3 + test.unrecognizedEnvelope(); + + // Test case 4 + test.unrecognizedEnvelope(); + + // Test case 5 + test.unrecognizedEnvelope(); + + // Test case 6 + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "06CCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/applet.opt new file mode 100644 index 0000000..1d9a6ec --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_glen.Api_2_Erh_Glen_1 +uicc.test.toolkit.api_2_erh_glen +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/javacard/api_2_erh_glen.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_glen/javacard/api_2_erh_glen.cap new file mode 100644 index 0000000000000000000000000000000000000000..e4ba602be04d5af7bafc4f14037693c9723da327 GIT binary patch literal 4930 zcmb7{30PEB8^_O`<<1Q2UqL_+MMT1lML|Xp5>XTo#g)tz$3YN;2}Vmy1>8k(H_bB3 zG_@o%*WCBi+%4Bktu#}Uaw(Uf_r-GLexJ_+m*@O`Gk5#nbM8Ec^Cl&zHLgNWe{Okk zVd90&RcJ(Fhn~^R;=05JB}R9Ni|x>(XJBG%*c?Z4PPg`d?`{ zOUw{;(Z=sPVKiksb)GP3__X3Jp5~GRZD zhK>Bf>1a&94c*W6aci+^-7!OXYJ}EnavQ@pyb+)^M(z_o><~H z*V|z<-3lMEGG@dbm!t%p-hbJS!6PLhPH2QkqIYLk@y7Vw9l8|R+MB*{3#B$9-DC=~ znsco|*6i%ejC5;IiY0wu^MU4^w1Go2%~?UiQbwkjQgVg_buy<6G3NxDQY@12ynML) zj-=8E2}|iF2B9sdZK@ANR*rKzSbEx*&fpeKt?F^@({s!wYj(~kPE?6{!jqb-h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6ch>LtgY^gQvF_nM>pmW^9^fJCA^v3jiN9EX z;SuW*9&m8qEJYU5-nPa85*s3WHfO`w;DwJdBEIOch1D^Ag@k<`!?YlVaJv(sV7c*zCw^Lsja@nsd~JIFCFT>Na;%Wj~v zC60UHBAR1fc7^`=6*M1Jx@7#zF2S?M)X*3?xIgPsgvB*LQ%h4MoU|FTCd5)P4$AS! ztGp1)IC^fABMmFJR@GXC^suH_(@nAI=FEzvh@O_Z&$r4M(O*U{j;CYXs+ZB-oZ30t zL^;`6yxcL+V%oDEFX79}3%s4(Jq@z2!J(-^ZeWo8?1DrioxWm|pPf>qanR^>_1$aA zwH@qrvP>U5U1U!u+1|7A1D*)q`g9CE95*AisxSK5n{!P$=@wf5^Yht@JX!<`p{CWJ zx$U8-2QJ+8CN%A$(Qc4tjzO(QVzQV7(Tm;bZ z01@!4H=-Hs2@#=Eu(Vd2<}*uzW_<{KXsd1xsjVtHDM3=XQswbq_4{IN#no@+?Pawv z-^K3VSNZ?yFxy?WQJ<AaYza+hNniDZN`;s*L|JIrLO!Zih^_2WCMYW` zTY|m1I^D31068vbQt9lm{bDT0pIkDMdrc^6NG0iDsl+%+frjb*1dQ*9_N=ndDnJk1o{RPvw JKc#yK@ef2$?bHAO literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/Api_2_Erh_Gvby_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/Api_2_Erh_Gvby_1.java new file mode 100644 index 0000000..a88bfc1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/Api_2_Erh_Gvby_1.java @@ -0,0 +1,261 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Gvby_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_gvby; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_gvby + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Gvby_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Gvby_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Gvby_1 thisApplet = new Api_2_Erh_Gvby_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Unavailable Element + testCaseNb = (byte) 1 ; + bRes = false ; + byte[] data = new byte[0xFF]; + + try { + //preparation of the append TLV + data[0]=(byte)0x81; + data[1]=(byte)0x82; + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x82,data,(short) 0x00, (short) 0x02); + + data[0]=(byte)0x11; + data[1]=(byte)0x22; + data[2]=(byte)0xFE; + //built the second TLV + EnvRespHdlr.appendTLV((byte)0x81,data,(short) 0x00, (short) 0x03); + + // Find Text String TLV + if((EnvRespHdlr.findTLV((byte)0x03, (byte)1)==TLV_NOT_FOUND)&& + (EnvRespHdlr.getValueByte((short)0)==0)) + bRes=false; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Out of TLV Boundaries + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + // Find String TLV + if((EnvRespHdlr.findTLV((byte)0x01, (byte)1)==TLV_FOUND_CR_SET)&& + (EnvRespHdlr.getValueByte((short)3)==0)) + bRes=false; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + // Find String TLV + if((EnvRespHdlr.findTLV((byte)0x01, (byte)1)==TLV_FOUND_CR_SET)&& + (EnvRespHdlr.getValueByte((short)2)==(byte)0xFE)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + // Find String TLV + if((EnvRespHdlr.findTLV((byte)0x02, (byte)1)==TLV_FOUND_CR_SET)&& + (EnvRespHdlr.getValueByte((short)0)==(byte)0x81)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Successful call + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + //preparation of the append TLV + for(short i=0;i<0x00FF;i++) + data[i]=(byte)i; + + //built the third TLV + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0x7E); + + // get the value byte + if((EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET)&& + (EnvRespHdlr.getValueByte((short)0x7D)==(byte)0x7D)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Successful call + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + //built the first TLV + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0x80); + + // get the value byte + if((EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET)&& + (EnvRespHdlr.getValueByte((short)0x7E)==(byte)0X7E)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + // get the value byte + if((EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET)&& + (EnvRespHdlr.getValueByte((short)0x7F)==(byte)0x7F)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successful call + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + //preparation of the append TLV + //built the first TLV + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0xF1); + + // get the value byte + if((EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET)&& + (EnvRespHdlr.getValueByte((short)0xF0)==(byte)0xF0)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 9 : Successful call + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + //preparation of the append TLV + //built the first TLV + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.getValueByte((short)0); + bRes= false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/Test_Api_2_Erh_Gvby.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/Test_Api_2_Erh_Gvby.java new file mode 100644 index 0000000..a2e563b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/Test_Api_2_Erh_Gvby.java @@ -0,0 +1,104 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Gvby.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_gvby; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_gvby + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Gvby extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_gvby"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Gvby() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 9 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "09CCCCCC CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/applet.opt new file mode 100644 index 0000000..7d68d0e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_gvby.Api_2_Erh_Gvby_1 +uicc.test.toolkit.api_2_erh_gvby +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/javacard/api_2_erh_gvby.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvby/javacard/api_2_erh_gvby.cap new file mode 100644 index 0000000000000000000000000000000000000000..20fa9859d13db6cf580085a724da3abc6da7d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rC5K0_4Ys}xsUa;fSECYk{J_t zjhT)0!oWagE7m7K&722;*&j$_Zev?#s07}?u7py~v<8@wmB6MY8j@(HA*uIjpoy!2 zOI%KvDh3odB!xA90IF0<&8#UJTGy&mIX%bf%7^MXstXR);{)4V6$k1rVn=jaM^Aim zy60kdIlkpX-IS+QELvla(o+`otEru`CU1Nyujf~ThIet)%i;?mRe?{&(7oGg&~gaY zQyQ8{T{xAOrY5vc)d?NW<-_Od^ptCxt9$OEROIjyN6|Kxd%?l6Arp1wuZ|UPEZdj& zYV}+!AIrZpbS6(?d0ZZMGkT0~SzTGX%Q|gHBj<|7uB9RT(pOdLLbg^BP;1+DL_?rM zC1oKcWgRF9IT6lW78<^+gW;kddK%7r_zJVDo<>7+NK11ET9hwqq2jo>7mJsU>l@R) zN1ThtH5WIW319ir@FVMLXxy*GlP1crh>q-3zujNxuoODoZKp}VNc~?4XKXuqAY}~p zi4qxOigWG+j{`ZLBJsp3@h)KIC&4gKAzo{yXUfl&B zQEjzWuNDMte7IrBUtPc9L!(3)iqiRbHP%_|@D+OT+7j(jg9l?b0E-W{oCyjTuf!5y zp&abc3-3)VL-&! zdrbHvgJiH~9g}IxB}@$7k}p!Vm-7HIRSPfwm$->qRPFoLQO+P~IgH+Qes!b_LQasU z2@;_nM)J-R!jc9#M4l8#kot%qQi>oa$g=^7pkX6%L&^>01o{0g5jI9dkl*%lj{M4& zI41lTb$&y#UR>aEfc&PG02?9#NcXm!AP->@;U*r#&buHBXmX4^ibee(eg@#WZ*Pl8{{jR>hC2WN literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/Api_2_Erh_Gvle_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/Api_2_Erh_Gvle_1.java new file mode 100644 index 0000000..74a21ed --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/Api_2_Erh_Gvle_1.java @@ -0,0 +1,228 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Gvle_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_gvle; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_gvle + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Gvle_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Erh_Gvle_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Gvle_1 thisApplet = new Api_2_Erh_Gvle_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Unavailable Element + testCaseNb = (byte) 1 ; + bRes = false ; + + // prepare the TLV before updating + byte[] data=new byte[0xFF]; + for( short i=0;i<(short)0xFF;i++) + data[i]=(byte)2; + + try { + + //append tlv and find a bad TLV + EnvRespHdlr.appendTLV((byte)0x33,data,(short) 0x00, (short) 0x04); + EnvRespHdlr.findTLV((byte)0x03,(byte)1) ; + EnvRespHdlr.getValueLength() ; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Successful call with length=0 + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + //append tlv with a length of 0 + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0x00); + // Search the TLV + if( (EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET) + && (EnvRespHdlr.getValueLength()==0)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Successful call with length=2 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + // clear the handler and append TLV with the new + EnvRespHdlr.clear(); + //append tlv with a length of 02 + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0x02); + // Search Text String TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)1) ; + // Get length + if(EnvRespHdlr.getValueLength()==2) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Successful call with length=0x7F + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + // clear the handler and append TLV with the new + EnvRespHdlr.clear(); + + //append tlv with a length of 7F + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0x7F); + + // Search Text String TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)1) ; + + // Get length + if(EnvRespHdlr.getValueLength()==0x7F) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Successful call with length=0x80 + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + // clear the handler and append TLV with the new + EnvRespHdlr.clear(); + + //append tlv with a length of 80 + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0x80); + + // Search Text String TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)1) ; + + // Get length + if(EnvRespHdlr.getValueLength()==0x80) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Successful call with length=0xF1 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + // clear the handler and append TLV with the new + EnvRespHdlr.clear(); + + //append tlv with a length of FA + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0xFA); + + // Search Text String TLV + EnvRespHdlr.findTLV((byte)0x0D, (byte)1) ; + + // Get length + if(EnvRespHdlr.getValueLength()==0xFA) + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 7 : ToolkitException HANDLER_NO_AVAILABLE + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.getValueLength(); + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/Test_Api_2_Erh_Gvle.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/Test_Api_2_Erh_Gvle.java new file mode 100644 index 0000000..a4d8765 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/Test_Api_2_Erh_Gvle.java @@ -0,0 +1,105 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Gvle.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_gvle; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_gvle + * + * @version 0.0.1 - 6 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Gvle extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_gvle"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Gvle() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 7 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "07CCCCCC CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/applet.opt new file mode 100644 index 0000000..8e6c2bf --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_gvle.Api_2_Erh_Gvle_1 +uicc.test.toolkit.api_2_erh_gvle +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/javacard/api_2_erh_gvle.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvle/javacard/api_2_erh_gvle.cap new file mode 100644 index 0000000000000000000000000000000000000000..b3b32a808f90ce54f4f4bd51661ea783b9b67579 GIT binary patch literal 3398 zcmb7G4NOy46h7~_udf!0wiR#)V<=@zN~=bJpdiXbL=hOnzhGCZ)*`K?!->iEsGHlQ z0}}V+&z1lZ!?L)UsSG1q)I~BB7DvQ6f2Wx8G;#HZzt3Bg*J0n+kjb~6H)umbSM{dh6?;1Q z*0*t2UcYnIxA*et`k?NE3v;s-Tt`aG<#Gbx6b+DzvEv6LCdRJ)LTYjZzKNKEc-3yT z8a=i$kJ00FmN@Jlqs3(}HW%C6Yl>Hwm)MMJE#(%g#l6xv*JfF1b0=6WE&{?YofzmL zNE!%D9V$@*Gl1>gD5UhKYp#!77mYJSOhb&EZnoWRvwEEFjUponkr0m1LJA~(E z8I%tqQ3WX=8}=+f79{|Q;8^jSSBX#qv6%$c8;s91P+m2G<4S*{-YkqN3PTMdCL;nc zs>D)OCR)RSK0^Rv0C>@q4V5H#IfC~pWO1MMNrtHqjTRADIC5;BHO`eHm4eJyLLF|l zqnPgMgh=SZ{e4xKKqx^;gbDFPCiaEGB;qaXKM;&W8}>g6Mv?<1X#kEiBXAyx^GHpo z57X37)-1GOpx zL&dQ!m5$M~%=E=9p=a@P$!#62nXF?dMKuGeU>(iU)fA}66dhenfQm|Sg&7n&MHP%< z9SrTFD3gmbaCj#}Bga>PnnCTTL5&)yAq^V!0~L%zJ*31!)1sI{5@QF&L1VY^&xwt;pjn6%T|GQ!SYn0cHg^)L5P#MRUpoC8yGBczz78<~c1N#B(}6nCJAW z!5gPgh51|bZ%ouyH(Db?%-$o<1G8;qR=3@S_1)0afECm{_p{{bIOXi5M8 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/Api_2_Erh_Gvsh_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/Api_2_Erh_Gvsh_1.java new file mode 100644 index 0000000..654f8fa --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/Api_2_Erh_Gvsh_1.java @@ -0,0 +1,259 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Gvsh_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_gvsh; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_gvsh + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Gvsh_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + private byte[] Buffer; + /** + * Constructor of the applet + */ + public Api_2_Erh_Gvsh_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Gvsh_1 thisApplet = new Api_2_Erh_Gvsh_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event){ + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the EnvelopeResponseHandler class + EnvelopeResponseHandler EnvRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Unavailable Element + testCaseNb = (byte) 1 ; + bRes = false ; + byte[] data=new byte[0xFF]; + + try { + //preparation of the append TLV + data[0]=(byte)0x81; + data[1]=(byte)0x82; + //built the first tlv + EnvRespHdlr.appendTLV((byte)0x82,data,(short) 0x00, (short) 0x02); + + data[0]=(byte)0x11; + data[1]=(byte)0x22; + data[2]=(byte)0xFE; + //built the second TLV + EnvRespHdlr.appendTLV((byte)0x81,data,(short) 0x00, (short) 0x03); + + // Find Text String TLV + if((EnvRespHdlr.findTLV((byte)0x03, (byte)1)==TLV_NOT_FOUND)&& + (EnvRespHdlr.getValueShort((short)0)==0)) + bRes=false; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 2 : Out of TLV Boundaries + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + // Find String TLV + if((EnvRespHdlr.findTLV((byte)0x01, (byte)1)==TLV_FOUND_CR_SET) + &&(EnvRespHdlr.getValueShort((short)3)==0)) + bRes=false; + } + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 3 : Successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + // Find String TLV + if((EnvRespHdlr.findTLV((byte)0x01, (byte)1)==TLV_FOUND_CR_SET) + &&(EnvRespHdlr.getValueShort((short)1)==(short)0x22FE)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + // Find String TLV + if((EnvRespHdlr.findTLV((byte)0x02, (byte)1)==TLV_FOUND_CR_SET) + &&(EnvRespHdlr.getValueShort((short)0)==(short)0x8182)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Successful call + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + //preparation of the append TLV + for(short i=0;i<0x00FF;i++) + data[i]=(byte)i; + + //built the third TLV + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0x7E); + + // get the value byte + if((EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET) + &&(EnvRespHdlr.getValueShort((short)0x7C)==(short)0x7C7D)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Successful call + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + //built the first TLV + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0x81); + + // get the value byte + if((EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET) + &&(EnvRespHdlr.getValueShort((short)0x7D)==(short)0X7D7E)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + // get the value byte + if((EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET) + &&(EnvRespHdlr.getValueShort((short)0x7F)==(short)0x7F80)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successful call + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + //preparation of the append TLV + //built the first TLV + EnvRespHdlr.clear(); + EnvRespHdlr.appendTLV((byte)0x0D,data,(short) 0x00, (short) 0xF1); + + // get the value byte + if((EnvRespHdlr.findTLV((byte)0x0D, (byte)1)==TLV_FOUND_CR_NOT_SET) + &&(EnvRespHdlr.getValueShort((short)0xEF)==(short)0xEFF0)) + bRes=true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 9 : Successful call + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + //preparation of the append TLV + //built the first TLV + EnvRespHdlr.clear(); + EnvRespHdlr.post(true); + try { + EnvRespHdlr.getValueShort((short)0); + bRes= false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes= true; + } else { + bRes=false; + } + } + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/Test_Api_2_Erh_Gvsh.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/Test_Api_2_Erh_Gvsh.java new file mode 100644 index 0000000..daa3d88 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/Test_Api_2_Erh_Gvsh.java @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Gvsh.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_gvsh; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_gvsh + * + * @version 0.0.1 - 11 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Gvsh extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_gvsh"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Gvsh() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 to 9 + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "09CCCCCC CCCCCCCC CCCC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/applet.opt new file mode 100644 index 0000000..031878f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_gvsh.Api_2_Erh_Gvsh_1 +uicc.test.toolkit.api_2_erh_gvsh +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/javacard/api_2_erh_gvsh.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_gvsh/javacard/api_2_erh_gvsh.cap new file mode 100644 index 0000000000000000000000000000000000000000..fba68443e093df9e405fc8351354c0c9d74dedaf GIT binary patch literal 3582 zcmb7`3rtgI6oAivU%l;ZYhkn$3G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O`AUj$3zK@G1I=Vz-dE{vr_zSm3Sjii(_D-f|m-XV$=+;Oo~;iv<9`HjZ_O*8B8j* zK^TG$t-sb71fJJK1sk@ar|f7g8YM~^%HX3`j=kDe<#6HUCE6vxN{rwDG=?v_f%5Vg zwJQ5j8B!?+sIj4iVG!5TgY$-?B#PH9wnm^N zgPDwB%i^{Y9djTBUouH1ovNd<$mhlRgo?mR^F`*?H!Tn|x8U-Bd7P+4)q8*gr4W*q zBeKWi~C#-kYC&qpd}=LbdAdi@>nJj{!oOn1zBX1W8~pX n!c6Bw!N`J}93u}-66Q`wnBY)VoX=vG2O!{Y4Ep`BKPLSPh3kj8 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/Api_2_Erh_Poab_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/Api_2_Erh_Poab_1.java new file mode 100644 index 0000000..ec414a4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/Api_2_Erh_Poab_1.java @@ -0,0 +1,305 @@ +//----------------------------------------------------------------------------- +//Api_2_Erh_Poab_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_poab; + +import javacard.framework.APDUException; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_poab + * + * @version 0.0.1 - 4 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Erh_Poab_1 extends TestToolkitApplet { + + // Number of tests + byte testCaseNb = (byte) 0x00; + + byte[] data = {(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0x0A,(byte)0x0B,(byte)0x0C,(byte)0x0D,(byte)0x0E,(byte)0x0F,(byte)0x10, + (byte)0x11,(byte)0x12,(byte)0x13,(byte)0x14,(byte)0x15,(byte)0x16,(byte)0x17,(byte)0x18,(byte)0x19,(byte)0x1A,(byte)0x1B,(byte)0x1C,(byte)0x1D,(byte)0x1E,(byte)0x1F,(byte)0x20, + (byte)0x21,(byte)0x22,(byte)0x23,(byte)0x24,(byte)0x25,(byte)0x26,(byte)0x27,(byte)0x28,(byte)0x29,(byte)0x2A,(byte)0x2B,(byte)0x2C,(byte)0x2D,(byte)0x2E,(byte)0x2F,(byte)0x30, + (byte)0x31,(byte)0x32,(byte)0x33,(byte)0x34,(byte)0x35,(byte)0x36,(byte)0x37,(byte)0x38,(byte)0x39,(byte)0x3A,(byte)0x3B,(byte)0x3C,(byte)0x3D,(byte)0x3E,(byte)0x3F,(byte)0x40, + (byte)0x41,(byte)0x42,(byte)0x43,(byte)0x44,(byte)0x45,(byte)0x46,(byte)0x47,(byte)0x48,(byte)0x49,(byte)0x4A,(byte)0x4B,(byte)0x4C,(byte)0x4D,(byte)0x4E,(byte)0x4F,(byte)0x50, + (byte)0x51,(byte)0x52,(byte)0x53,(byte)0x54,(byte)0x55,(byte)0x56,(byte)0x57,(byte)0x58,(byte)0x59,(byte)0x5A,(byte)0x5B,(byte)0x5C,(byte)0x5D,(byte)0x5E,(byte)0x5F,(byte)0x60, + (byte)0x61,(byte)0x62,(byte)0x63,(byte)0x64,(byte)0x65,(byte)0x66,(byte)0x67,(byte)0x68,(byte)0x69,(byte)0x6A,(byte)0x6B,(byte)0x6C,(byte)0x6D,(byte)0x6E,(byte)0x6F,(byte)0x70, + (byte)0x71,(byte)0x72,(byte)0x73,(byte)0x74,(byte)0x75,(byte)0x76,(byte)0x77,(byte)0x78,(byte)0x79,(byte)0x7A,(byte)0x7B,(byte)0x7C,(byte)0x7D,(byte)0x7E,(byte)0x7F,(byte)0x80, + (byte)0x81,(byte)0x82,(byte)0x83,(byte)0x84,(byte)0x85,(byte)0x86,(byte)0x87,(byte)0x88,(byte)0x89,(byte)0x8A,(byte)0x8B,(byte)0x8C,(byte)0x8D,(byte)0x8E,(byte)0x8F,(byte)0x90, + (byte)0x91,(byte)0x92,(byte)0x93,(byte)0x94,(byte)0x95,(byte)0x96,(byte)0x97,(byte)0x98,(byte)0x99,(byte)0x9A,(byte)0x9B,(byte)0x9C,(byte)0x9D,(byte)0x9E,(byte)0x9F,(byte)0xA0, + (byte)0xA1,(byte)0xA2,(byte)0xA3,(byte)0xA4,(byte)0xA5,(byte)0xA6,(byte)0xA7,(byte)0xA8,(byte)0xA9,(byte)0xAA,(byte)0xAB,(byte)0xAC,(byte)0xAD,(byte)0xAE,(byte)0xAF,(byte)0xB0, + (byte)0xB1,(byte)0xB2,(byte)0xB3,(byte)0xB4,(byte)0xB5,(byte)0xB6,(byte)0xB7,(byte)0xB8,(byte)0xB9,(byte)0xBA,(byte)0xBB,(byte)0xBC,(byte)0xBD,(byte)0xBE,(byte)0xBF,(byte)0xC0, + (byte)0xC1,(byte)0xC2,(byte)0xC3,(byte)0xC4,(byte)0xC5,(byte)0xC6,(byte)0xC7,(byte)0xC8,(byte)0xC9,(byte)0xCA,(byte)0xCB,(byte)0xCC,(byte)0xCD,(byte)0xCE,(byte)0xCF,(byte)0xD0, + (byte)0xD1,(byte)0xD2,(byte)0xD3,(byte)0xD4,(byte)0xD5,(byte)0xD6,(byte)0xD7,(byte)0xD8,(byte)0xD9,(byte)0xDA,(byte)0xDB,(byte)0xDC,(byte)0xDD,(byte)0xDE,(byte)0xDF,(byte)0xE0, + (byte)0xE1,(byte)0xE2,(byte)0xE3,(byte)0xE4,(byte)0xE5,(byte)0xE6,(byte)0xE7,(byte)0xE8,(byte)0xE9,(byte)0xEA,(byte)0xEB,(byte)0xEC,(byte)0xED,(byte)0xEE,(byte)0xEF,(byte)0xF0, + (byte)0xF1,(byte)0xF2,(byte)0xF3,(byte)0xF4,(byte)0xF5,(byte)0xF6,(byte)0xF7,(byte)0xF8,(byte)0xF9,(byte)0xFA,(byte)0xFB,(byte)0xFC,(byte)0xFD,(byte)0xFE,(byte)0xFF,(byte)0x00 + }; + + private static byte[] displayString = {(byte)'A',(byte)'P',(byte)'P',(byte)'L',(byte)'E',(byte)'T',(byte)'1'}; + + private static final byte DCS_8_BIT_DATA = 0x04; + /** + * Constructor of the applet + */ + public Api_2_Erh_Poab_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Erh_Poab_1 thisApplet = new Api_2_Erh_Poab_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + // Register on EVENT DOWNLOAD CALL CONTROL BY NAA + thisApplet.obReg.setEvent(EVENT_CALL_CONTROL_BY_NAA); + + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Get the system instance of handlers + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + EnvelopeResponseHandler envRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler(); + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : getTheHandler and than post(true) + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + envRespHdlr.postAsBERTLV(true,(byte)0x01); + bRes = true; + } + catch (Exception e){ + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : Append data and post(true) + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + envRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short)0x00FA); + envRespHdlr.postAsBERTLV(true,(byte)0x33); + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : use the methode appendTLV after the using of the post(true) methode + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + envRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short) 0x0010); + envRespHdlr.postAsBERTLV(true,(byte)0x33); + + try { + envRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short) 0x0010); + bRes = false; + } + catch (ToolkitException e){ + if(e.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) + bRes = true ; + } + } + catch (Exception e){ + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 4 : use the methode post(FALSE) and send a display text + testCaseNb = (byte) 4 ; + + bRes = false ; + try { + envRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short) 0x0010); + envRespHdlr.postAsBERTLV(false,(byte)0x75); + + //send the proactive command + proHdlr.initDisplayText((byte)0x80, DCS_8_BIT_DATA, displayString, (short) 0, (short) displayString.length); + proHdlr.send(); + + bRes = true; + } + catch (Exception e){ + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 4 : + // -------------------------------------------- + // Test Case 5: use the methode postAsBERTLV() without appendTLV() and send a display text + testCaseNb = (byte) 5 ; + + bRes = false ; + try { + + envRespHdlr.postAsBERTLV(false,(byte)0x33); + + //send the proactive command + proHdlr.initDisplayText((byte)0x80, DCS_8_BIT_DATA, displayString, (short) 0, (short) displayString.length); + proHdlr.send(); + + bRes = true; + } + + catch (Exception e){ + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 5 : + // -------------------------------------------- + // Test Case 6 : use the postAsBERTLV() methode after a display text command + testCaseNb = (byte) 6 ; + + bRes = false ; + try{ + envRespHdlr.appendTLV((byte)0x01,data,(short) 0x10, (short) 0x0010); + //send the proactive command + proHdlr.initDisplayText((byte)0x80, DCS_8_BIT_DATA, displayString, (short) 0, (short) displayString.length); + proHdlr.send(); + + try { + envRespHdlr.postAsBERTLV(false,(byte)0x33); + bRes = false; + } + + catch (ToolkitException e){ + if(e.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 6 : + // -------------------------------------------- + // Test Case 7 : try to use the methode postAsBERTLV(true) after the using of the methode postAsBERTLV(false) + testCaseNb = (byte) 7 ; + + bRes = false ; + try { + envRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short) 0x0010); + envRespHdlr.postAsBERTLV(false,(byte)0x56); + bRes = false; + try{ + envRespHdlr.postAsBERTLV(true,(byte)0x28); + } + catch (ToolkitException e){ + if(e.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) + bRes = true ; + } + } + catch (Exception e){ + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 7 : + // -------------------------------------------- + // Test Case 8 : In case of CALL_CONTROL the CAT Runtime Environment set the boolean value always to true + testCaseNb = (byte) 8 ; + + bRes = false ; + try { + envRespHdlr.appendTLV((byte)0x01,data,(short) 0x00, (short) 0x0010); + envRespHdlr.postAsBERTLV(false,(byte)0x33); + bRes = true; + } + catch (Exception e){ + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 8 : + // -------------------------------------------- + // Test Case 9 : In case of CALL_CONTROL the CAT Runtime Environment set the boolean value always to true + testCaseNb = (byte) 9 ; + + bRes = false ; + try { + envRespHdlr.appendTLV((byte)0x01,data,(short)0x0010,(short)0x0010); + envRespHdlr.postAsBERTLV(true,(byte)0x28); + bRes = true; + } + catch (Exception e){ + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 9 : + // -------------------------------------------- + // Test Case 10 : Resulting response length greater than 256. + testCaseNb = (byte) 10 ; + + bRes = false ; + try { + envRespHdlr.appendArray(data,(short) 0x00,(short)0x00FE); + bRes = false; + try{ + envRespHdlr.postAsBERTLV(true,(byte)0x33); + } + catch (APDUException e){ + if(e.getReason()==APDUException.BAD_LENGTH) + bRes = true ; + } + } + catch (Exception e){ + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + } + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/Test_Api_2_Erh_Poab.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/Test_Api_2_Erh_Poab.java new file mode 100644 index 0000000..b03462a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/Test_Api_2_Erh_Poab.java @@ -0,0 +1,184 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Poab.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_poab; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_poab + * + * @version 0.0.1 - 4 avr. 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Poab extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_poab"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Poab() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 + response = test.unrecognizedEnvelope(); + result = response.checkData("0100"); + result &= response.checkSw("9000"); + + // Test case 2 + response = test.unrecognizedEnvelope(); + result &= response.checkData("3381FD" + + "0181FA01 02030405 06070809 0A0B0C0D" + + "0E0F1011 12131415 16171819 1A1B1C1D" + + "1E1F2021 22232425 26272829 2A2B2C2D" + + "2E2F3031 32333435 36373839 3A3B3C3D" + + "3E3F4041 42434445 46474849 4A4B4C4D" + + "4E4F5051 52535455 56575859 5A5B5C5D" + + "5E5F6061 62636465 66676869 6A6B6C6D" + + "6E6F7071 72737475 76777879 7A7B7C7D" + + "7E7F8081 82838485 86878889 8A8B8C8D" + + "8E8F9091 92939495 96979899 9A9B9C9D" + + "9E9FA0A1 A2A3A4A5 A6A7A8A9 AAABACAD" + + "AEAFB0B1 B2B3B4B5 B6B7B8B9 BABBBCBD" + + "BEBFC0C1 C2C3C4C5 C6C7C8C9 CACBCCCD" + + "CECFD0D1 D2D3D4D5 D6D7D8D9 DADBDCDD" + + "DEDFE0E1 E2E3E4E5 E6E7E8E9 EAEBECED" + + "EEEFF0F1 F2F3F4F5 F6F7F8F9 FA"); + + result &= response.checkSw("9000"); + + // Test case 3 + response = test.unrecognizedEnvelope(); + result &= response.checkData("33120110 01020304 05060708 090A0B0C 0D0E0F10"); + result &= response.checkSw("9000"); + + // Test case 4 + response = test.unrecognizedEnvelope(); + result &= response.checkData("75120110 01020304 05060708 090A0B0C 0D0E0F10"); + result &= response.checkSw("6200"); + response = test.envelopeEventDownloadUserActivity(); // Dummy command to get the 91XX status word + result &= response.checkSw("9115"); + response = test.fetch("15"); + result &= response.checkData("D0138103 01218082 0281028D 08044150" + + "504C4554 31"); + test.terminalResponse("81030121 00020282 81030100"); + + // Test case 5 + response = test.unrecognizedEnvelope(); + result &= response.checkData("3300"); + result &= response.checkSw("6200"); + response = test.envelopeEventDownloadUserActivity(); // Dummy command to get the 91XX status word + result &= response.checkSw("9115"); + response = test.fetch("15"); + result &= response.checkData("D0138103 01218082 0281028D 08044150" + + "504C4554 31"); + test.terminalResponse("81030121 00020282 81030100"); + + // Test case 6 + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9115"); + response = test.fetch("15"); + result &= response.checkData("D0138103 01218082 0281028D 08044150" + + "504C4554 31"); + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9000"); + + // Test case 7 + response = test.unrecognizedEnvelope(); + result &= response.checkData("56120110 01020304 05060708 090A0B0C 0D0E0F10"); + result &= response.checkSw("6200"); + + // Test case 8 + response = test.envelopeCallControlByNAA(); + result &= response.checkData("33120110 01020304 05060708 090A0B0C 0D0E0F10"); + result &= response.checkSw("9000"); + + // Test case 9 + response = test.envelopeCallControlByNAA(); + result &= response.checkData("28120110 11121314 15161718 191A1B1C 1D1E1F20"); + result &= response.checkSw("9000"); + + // Test case 10 + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0ACCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/applet.opt new file mode 100644 index 0000000..32e4b12 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_poab.Api_2_Erh_Poab_1 +uicc.test.toolkit.api_2_erh_poab +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/javacard/api_2_erh_poab.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_poab/javacard/api_2_erh_poab.cap new file mode 100644 index 0000000000000000000000000000000000000000..78020486ecf8435ade3c5d98f28bb042d319d213 GIT binary patch literal 5426 zcmb7|30xHA8^_<-Yj$=yew?l#LZ*dsg9jd{2%dnhh-F0~A_j`E!m5e&Z$VQO1T!tu zNU%#Y&CJZKs5C9HGCQo)%rwh9^2*FK`9BY6D`S3w-Ou~|&dlz-zj@yohI!VSq}6!~ zBfb5KhjtS;yu5`@qzp`p4;wmsP((`n@S%eSj!Fwp8FaN?h_$IHBeq6b>LR{-^w>!E zfXSDv#ml`sD}twdcp~*pH~+EK_uqEr^eO9D|Du|+U%ayG{2wz`R7E8veiGxF@mBrp z$ZG#Qtmz_FMP?7?t`~~eYV4zJD=#*W20&K;`H*e5YxobOXeI<+RfMZD^6^e zt~=Q&J+x;1>w8i?`cDf^j~Kf+r*F)O%WJw`bgw&8wZz(I<=A6=|C)7t-`njzt+#bK z=hzV~?XESfa<@Hoxcw>5L#|gk2N^FM_YNqUdM>^Cbb9rQqPSk^Icb-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d}jGq%&bV{k^q(2&!AAI!1kWbjHNEw (short)0x0100) + { + try { + envRespHdlr.appendTLV((byte)0x01,data,(short) 0x00,(short)0x00FB); + bRes = false; + try{ + envRespHdlr.appendTLV((byte)0x02,data,(short) 0x00,(short)0x0001); + envRespHdlr.post(true); + } + catch (APDUException e){ + if(e.getReason()==APDUException.BAD_LENGTH) + bRes = true ; + } + } + catch (Exception e){ + bRes = false ; + } + } + else bRes = true; + reportTestOutcome(testCaseNb, bRes) ; + break; + + } + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/Test_Api_2_Erh_Post.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/Test_Api_2_Erh_Post.java new file mode 100644 index 0000000..bef6690 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/Test_Api_2_Erh_Post.java @@ -0,0 +1,179 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Erh_Post.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_erh_post; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_erh_post + * + * @version 0.0.1 - 24 mars 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Erh_Post extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_erh_post"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Erh_Post() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcases */ + /*********************************************************************/ + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test case 1 + response = test.unrecognizedEnvelope(); + result = response.checkSw("9000"); + + // Test case 2 + response = test.unrecognizedEnvelope(); + result &= response.checkData("0181FA01 02030405 06070809 0A0B0C0D" + + "0E0F1011 12131415 16171819 1A1B1C1D" + + "1E1F2021 22232425 26272829 2A2B2C2D" + + "2E2F3031 32333435 36373839 3A3B3C3D" + + "3E3F4041 42434445 46474849 4A4B4C4D" + + "4E4F5051 52535455 56575859 5A5B5C5D" + + "5E5F6061 62636465 66676869 6A6B6C6D" + + "6E6F7071 72737475 76777879 7A7B7C7D" + + "7E7F8081 82838485 86878889 8A8B8C8D" + + "8E8F9091 92939495 96979899 9A9B9C9D" + + "9E9FA0A1 A2A3A4A5 A6A7A8A9 AAABACAD" + + "AEAFB0B1 B2B3B4B5 B6B7B8B9 BABBBCBD" + + "BEBFC0C1 C2C3C4C5 C6C7C8C9 CACBCCCD" + + "CECFD0D1 D2D3D4D5 D6D7D8D9 DADBDCDD" + + "DEDFE0E1 E2E3E4E5 E6E7E8E9 EAEBECED" + + "EEEFF0F1 F2F3F4F5 F6F7F8F9 FA"); + + result &= response.checkSw("9000"); + + // Test case 3 + response = test.unrecognizedEnvelope(); + result &= response.checkData("01100102 03040506 0708090A 0B0C0D0E 0F10"); + result &= response.checkSw("9000"); + + // Test case 4 + response = test.unrecognizedEnvelope(); + result &= response.checkData("01100102 03040506 0708090A 0B0C0D0E 0F10"); + result &= response.checkSw("6200"); + response = test.envelopeEventDownloadUserActivity(); // Dummy command to get the 91XX status word + result &= response.checkSw("9115"); + response = test.fetch("15"); + result &= response.checkData("D0138103 01218082 0281028D 08044150" + + "504C4554 31"); + test.terminalResponse("81030121 00020282 81030100"); + + // Test case 5 + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9115"); + response = test.fetch("15"); + result &= response.checkData("D0138103 01218082 0281028D 08044150" + + "504C4554 31"); + test.terminalResponse("81030121 00020282 81030100"); + + // Test case 6 + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9115"); + response = test.fetch("15"); + result &= response.checkData("D0138103 01218082 0281028D 08044150" + + "504C4554 31"); + response = test.terminalResponse("81030121 00020282 81030100"); + result &= response.checkSw("9000"); + + // Test case 7 + response = test.unrecognizedEnvelope(); + result &= response.checkData("01100102 03040506 0708090A 0B0C0D0E 0F10"); + result &= response.checkSw("6200"); + + // Test case 8 + response = test.envelopeCallControlByNAA(); + result &= response.checkData("01100102 03040506 0708090A 0B0C0D0E 0F10"); + result &= response.checkSw("9000"); + + // Test case 9 + response = test.envelopeCallControlByNAA(); + result &= response.checkData("01101112 13141516 1718191A 1B1C1D1E 1F20"); + result &= response.checkSw("9000"); + + // Test case 10 + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "0ACCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/applet.opt new file mode 100644 index 0000000..cfb1606 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_erh_post.Api_2_Erh_Post_1 +uicc.test.toolkit.api_2_erh_post +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/javacard/api_2_erh_post.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_erh_post/javacard/api_2_erh_post.cap new file mode 100644 index 0000000000000000000000000000000000000000..621484c1d7ff92cfff3fea055cbfdd24aa87955f GIT binary patch literal 5436 zcmb7|30zdw7sv0L?ae0q*hf%N(^Mo7ltge8L`gynMI%>27=;uD0ZGYaKyyRET+*}> zOKmX)O)JedO))k1rPNHc#THXDv((~$4rn8vf)Zl?-YdlVfeH5FPL>ZBUGXnG9 z@aJbOM`zfw)0d5iQ|}53u&wdEaXIoIQ+a@JfN2rrp#1EM4Id{GB+?b6MvV7NG?VUW&5mt8L z7h|6`*}DANp3-HLOL7OaKRU78&u9(sxLA?fDt@kGw<%%_VorY4PGogxol)Xjb@57A z%fgu6ZU2Y9P&18c02j%&Ly$e54K4OPLVg)Jl6J;f=A-| zKXEDO#HuN?*FA3RdT?pK%<(BLwnbL$KD99_(tArxO=9`B{U=n_ozDmSa{8sj@3*_Y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zQgyd?{SfJ5kIhgz>lmS@e}JO{LK0pmspqZ3+oqLW?jY=))ic3UB$1gUvZ6f4ZpE| z!*$km{LcCvH&{3D2kQ^~$@&vFSvPTubqlvyxA7P2FZ|8=Tg9wVhtHAa5{||xwDb7puN^hTOyzxtD(#)Wp3#!i~L{OQrBLp9~|;C z!c9%Fuv919oBEYX!rc=2?=DEsTl96!H2Tcp7C3uD|DWr+bHCJHnz{rH=$YDr`*+Pb zAOCNJ#QPT9>DxUcd-pp2JrttE0>eK;`cH@MJDoX0Eil#{PowK%rnet^kGff;8@6_C z`C_#+tD1T;%=qTtx@lwN%^VynQ5_^wsEzu zhk7bWxEPVtLXJ*M?AK>d2sNj84~?(~g(5{+4-H_DnocW=GB zm%fSF+e@$4XmuW_r4Q3!_V(5rjRbcey}PT2i{5CdKZ3(1S6o;~{ox3wX!u)vZ(Ckk zZe|V@dE6zFD5KF6Ld~BdRk6NUuBokC1F2D30=WQ@9BNS{#*0wh4BjRgbT{aQz9WA( zN^%>~TeVWS(2A!B5P>47rbdL){!kHG*JE1mDk6zJMK2LZ?j?1SDzzCc7f8@-4xulJ z6jAC>NKvZj#CS>NNlo4T-Q(V>nt%7GzufOv5N^dN?q7jBTiH%MZ20Io>v3fUWzp@- z(2eC~IqH29vrm-Edag$_&bC*_mNQqcSLKXJsB` zq3g`km+qp5Pe{z&vR9cvS>HMnY-&^jXSJ)$pnOg`Gwi3ow}y8?@zhkNQ9dA@X(C)3 nlSc8lRHjirvz%#M(3mv!pJ0jcTKa)R2orre(YXIkZ3*!o^4(Yx literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/Api_2_Ers_Gthd_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/Api_2_Ers_Gthd_1.java new file mode 100644 index 0000000..255d241 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/Api_2_Ers_Gthd_1.java @@ -0,0 +1,150 @@ +//----------------------------------------------------------------------------- +//Api_2_Ers_Gthd_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_ers_gthd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.EnvelopeResponseHandler; +import uicc.toolkit.EnvelopeResponseHandlerSystem; +import uicc.toolkit.ProactiveHandlerSystem; +import uicc.toolkit.ProactiveHandler; +import uicc.toolkit.ToolkitException; +/** + * Test Area : uicc.test.toolkit.api_2_ers_gthd + * + * @version 0.0.1 - 2 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Api_2_Ers_Gthd_1 extends TestToolkitApplet +{ + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + + /** + * Constructor of the applet + */ + public Api_2_Ers_Gthd_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Ers_Gthd_1 thisApplet = new Api_2_Ers_Gthd_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + /** + * Method called by the SIM Toolkit Framework + */ + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + switch ( testCaseNb ) + { + case (byte) 0 : + // -------------------------------------------- + // Test Case 1 : use th methode getTheHandler() Twice + testCaseNb = (byte) 1 ; + + bRes = false ; + try { + EnvelopeResponseHandler EnvRespHdlr1 = EnvelopeResponseHandlerSystem.getTheHandler(); + EnvelopeResponseHandler EnvRespHdlr2 = EnvelopeResponseHandlerSystem.getTheHandler(); + + if (EnvRespHdlr1==EnvRespHdlr2 ) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 1 : + // -------------------------------------------- + // Test Case 2 : verify that the methode getTheHandler return EnvelopeResponseHandler reference + testCaseNb = (byte) 2 ; + + bRes = false ; + try { + EnvelopeResponseHandler EnvRespHdlr1 = EnvelopeResponseHandlerSystem.getTheHandler(); + + if (EnvRespHdlr1 instanceof EnvelopeResponseHandler) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 2 : + // -------------------------------------------- + // Test Case 3 : verify that the methode getTheHandler does not return NULL + testCaseNb = (byte) 3 ; + + bRes = false ; + try { + EnvelopeResponseHandler EnvRespHdlr1 = EnvelopeResponseHandlerSystem.getTheHandler(); + + if (EnvRespHdlr1!=null) + bRes = true; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + + case (byte) 3 : + // -------------------------------------------- + // Test Case 3 : EnvelopeResponseHandler shall not be available after the sending of a proactive command + testCaseNb = (byte) 4 ; + + bRes = false ; + try { + ProactiveHandlerSystem.getTheHandler().initMoreTime(); + ProactiveHandlerSystem.getTheHandler().send(); + bRes = false; + try { + EnvelopeResponseHandler EnvRespHdlr1 = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch(ToolkitException e) + { + bRes = (e.getReason() == ToolkitException.HANDLER_NOT_AVAILABLE); + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + break; + } + } +} + + diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/Test_Api_2_Ers_Gthd.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/Test_Api_2_Ers_Gthd.java new file mode 100644 index 0000000..d4fb91c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/Test_Api_2_Ers_Gthd.java @@ -0,0 +1,116 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Ers_Gthd.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_ers_gthd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +/** + * Test Area : uicc.test.toolkit.api_2_ers_gthd + * + * @version 0.0.1 - 2 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Ers_Gthd extends UiccTestModel +{ + + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_ers_gthd"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Api_2_Ers_Gthd() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Applet installation */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Test cases 1,2,3 + for (byte i = 0; i< 3; i++) + { + response = test.unrecognizedEnvelope(); + } + + // Test case 4 + response = test.unrecognizedEnvelope(); + result = response.checkSw("910B"); + response = test.fetch("0B"); + result &= response.checkData("D0098103 01020082 028182"); + response = test.terminalResponse("81030102 00020282 81030100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "04CCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/applet.opt new file mode 100644 index 0000000..96df82e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_ers_gthd.Api_2_Ers_Gthd_1 +uicc.test.toolkit.api_2_ers_gthd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/javacard/api_2_ers_gthd.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_ers_gthd/javacard/api_2_ers_gthd.cap new file mode 100644 index 0000000000000000000000000000000000000000..180fc4a3bc6e5855a83899c88c4b4cf61d709f16 GIT binary patch literal 3076 zcmb7_e@s(X6vxkfKl&4-K*eGOM7Ioawo*}N?3nX=_L{EE{;k1y@rRK; z9gY(VJ36Vn%+fLA$=yNKO>D*5BG2(a^XJtc-rBVC+Ph!X_zv8@R^MBC(|uv|$#^5x zSi>A!t!ha=vC=R9>{YnY)lBp|%o}&w+uq#JdS_ef9Z%cLHI~}m?YV)s192tyn)Cd9 zn?Lz<|D~n-=m(m@UD`Q~hOIyT9+=E8tE+9dM_oG55`TXU^@d|YoT53p(0!%6`tJ7+ zxV$4tfsCt{UA@-o##1j@EpkQr+UWhu2*7y;z>2X`4Ma?c-M2qanUsJ}g3?hRIPG>L z@9^+O-sLJQb@E0V=Uil3^6?T(95U$`v}DV z(X`+qN?`l3tsRcYVBA7W4?O~B2%3lr9XG@2cG!8Bdxb!xAPI(|w2%qYA&zK31*34e zv5lOht&G@IbjsIhT6?#6YHW zBX8ky6p^=JS44kO}YnN+4Af_K_g-M*+T95-v_Dc}T*1X-m*a6ILE}(i z7*}TVcm%6t5SQfx(hn-Zq{2!H{0gG-%O&x5EUEe@7H0?wFD&^EzQk25pyWiu0_W3! zAJg6zUnK0t{-{q0o!I}0Y40yQ_ZNLBga!qr(X9uWj;;YOn^q6hl=VOx^tuGbtV?)t z9WeTJ!0M|ARY!pwy!6O6@IX5{KtmKvfca3NV`_j-s|A$-mBQ!;Gfsv{iD9BhC$_^g$l?LHidP6&Dh6?!-ecpLAu=Qtf@13Rt2ulZ>UX2hJE*zq!s2?~!f z*RgoE%Z?mZxe!ey<_oncK^;3x9j_X!N{69x1vZ(AiC`3o%#a9Kj9RN^7)Gwp1)I$zN)hrcK8=Ai{7pw?kg;sZ@Q;axX-~tOX|zd$os~?Z z%vKAbw3s`e)bD4jgHXSN+y7N_VHMTmNc~qO5mz~eUWUF)VqK9Eq{TxdjK;(iIw7c( zNFmZvAwqVB1rZB}lpw7UB0)`ubuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + try { + offset = (short)6 ; + length = (short)0 ; + + proHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : offset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + offset = (short)-1 ; + length = (short)1 ; + + proHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : length>buffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + offset = (short)0 ; + length = (short)6 ; + + proHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : offset + length>buffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + offset = (short)3 ; + length = (short)3 ; + + proHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : length < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + try { + offset = (short)0 ; + length = (short)-1 ; + + proHdlr.appendArray(buffer5, offset, length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : handler overflow + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + try { + offset = (short)0 ; + byte[] TempBuffer = new byte[(short)(proHdlr.getCapacity() + 1)]; + Util.arrayFillNonAtomic(TempBuffer,(short)0,(short)TempBuffer.length,(byte)0); + proHdlr.appendArray(TempBuffer, offset,(short) TempBuffer.length) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : A successfull append does not modify the current TLV + testCaseNb = (byte) 8 ; + bRes = false ; + + // Initialise buffer + for (short i=0; i<(short)buffer.length; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; + } + + try { + // Initialise the handler + proHdlr.init((byte)0, (byte)0, (byte)0) ; + + // Select Command Details TLV + proHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append buffer + offset = (short)0 ; + length = (short)buffer.length ; + proHdlr.appendArray(buffer, offset, length) ; + + // Verify current TLV + result = proHdlr.getValueLength() ; + + bRes = (result == (short)3) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Successfull call + testCaseNb = (byte) 9 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)buffer.length; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + compareBuffer[i] = (byte)((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + } + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append buffer + offset = (short)0 ; + length = (short)buffer.length ; + proHdlr.appendArray(buffer, offset, length) ; + + // Copy the handler + offset = (short) 0 ; + length = (short) 8 ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successfull call + testCaseNb = (byte) 10 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)buffer.length; i++) { + buffer[i] = (byte)i ; // 00 01 02 03 04 05 06 07 + + if (i>=(byte)2) { + compareBuffer[(short)(i+6)] = (byte)i ; // FF FE FD FC FB FA F9 F8 02 03 04 05 06 07 + } + } + + try { + + // Append buffer + offset = (short)2 ; + length = (short)6 ; + proHdlr.appendArray(buffer, offset, length) ; + + // Copy the handler + offset = (short)0 ; + length = (short)14 ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Successfull call + testCaseNb = (byte) 11 ; + bRes = false ; + + // Initialise buffers + for (short i=0; i<(short)buffer.length; i++) { + buffer[i] = (byte) ((i+1)*0x11) ; // 11 22 33 44 55 66 77 88 + + if (i>=(byte)2) { + compareBuffer[(short)(i+12)] = (byte)((i+1)*0x11) ; // FF FE FD FC FB FA F9 F8 02 03 04 05 06 07 33 44 55 66 + } + } + + try { + + // Append buffer + offset = (short)2 ; + length = (short)4 ; + proHdlr.appendArray(buffer, offset, length) ; + + // Copy the handler + offset = (short)0 ; + length = (short)18 ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + bRes2 = false ; + + // Initialise buffers + for (short i=0; i<(short)buffer255.length; i++) { + buffer255[i] = (byte)i ; + compareBuffer255[i] = (byte)i ; + } + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append buffer + offset = (short)0 ; + length = (short)253 ; + proHdlr.appendArray(buffer255, offset, length) ; + + // Verify length of the handler + bRes2 = (proHdlr.getLength() == (short)253) ; + + + // Copy the handler + offset = (short) 0 ; + length = (short) proHdlr.getLength() ; + proHdlr.copy(copyBuffer255, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer255, offset, + compareBuffer255, offset, length) ; + + bRes = (bRes2) && (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/Test_Api_2_Pah_Apda.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/Test_Api_2_Pah_Apda.java new file mode 100644 index 0000000..9ae8683 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/Test_Api_2_Pah_Apda.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Apda.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_apda; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_apda + * + * @version 0.0.1 - 17 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Apda extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_apda"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Apda() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 12 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0CCCCCCC CCCCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/applet.opt new file mode 100644 index 0000000..4948ba8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_apda.Api_2_Pah_Apda_1 +uicc.test.toolkit.api_2_pah_apda +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/javacard/api_2_pah_apda.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_apda/javacard/api_2_pah_apda.cap new file mode 100644 index 0000000000000000000000000000000000000000..f26dc88aaef0e414139e655b0ede2bb760430905 GIT binary patch literal 4307 zcmb7HeNa@_6+idg_qn?dc47Cqd}`VdK?@5=HsC7R?E(fBLX54!&>;(KDoWfP*hEEJ zmvyRb5LEuKV$uw0Z0+EXX)Q6dGqs7WBekX>>X=MyYqX8FlSoY`%~vPcp38#EzDY;+ z?fmAvbMJlUcRt?UdtSpT%3DFkUv_uxy)f&t0uOc7YdwXv^)-$T13? z3ox?gTMzCkwti>f)%!nuX#UytAHDn8?y)@k(JHOEminES^A8?Bw=>{*nbbS`9QRE; zyZ!a$H~w5vx9wD?(0u6JuO3id(Mr{IrNfVy0$2XHr{{a#GI5>fK%`>dk?|{Cr=1nI z&X51vsb1K6B&){#>I*+R`r+tvX)V9GHoRgHWN>uMM5}<)!m!k8M$ItvP+L`}3jkmC<*WY+pRq zRzjBCxa-h~H(%_$xcGO1gC6d+E~_>SDX(}VE85D%$+AZv>-jeds?Riyl&*Vk@w)eJ zH0?`yvuJqdJ)d6x;7Rv?qoKRsn*8_JYa6%xqJQ|Iu|@wWs6RL|c>Y@D^3b9)J8m9& zA;d8;9?UjC8vFDzPWtGsdN|F~k&Wvv* z024f*PI<#r%~<{>nqfDpy&2Mh2%k?!^NH$MIfjxyYb zm^)ond#ArO6zJT>7&({^nFuSmU?XUP3I^DU<|Yt$@kB>k{Zh%wc{st4T$G+*u)`l> zoD{6O=m-$Fk{I7+NB`wYBw6qpmU0d2bVsPx6m9%q#+b71ZfkpoQ9(?JqaYy zpDp_)ESbbfa^qn zK^g`QA&YD*q5#1*HJEMiG0=ltxs7Qdhm&>zfW_phboyh$MpO@O5=D z??uqOVSGts1G+}I9u6WhF+?OClRDP?zF7cZNUnT!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`WQV*2P8pw)!<>Rb2~+5SL2P=em@T5f6>!5{?A}1o z@LFDhbW}3Isr!|~(r6T)b0aEQ%NV=Bi=!)GCDcO$`8g>THZ0gr%=~Bx-ZaosvoPv) z6Sp`z>g7BQs|aVsMsVhHWOl2|K1UL-|MzjitQe->s4r`a<5o^$`sSYgc$2JW(09Ud zhC)p6+!+%3Vm*nz?~RijNs1)i1?w5~4R4%5rOAX5Z-4a+`W80M@S~&{^bM_^N8e?} zd0Ox-ntMUKGd-uCK;K-(3C<-&5N|d04EoJA&QOG#<=jKiZMAwD{r(!K8Aysox7+Gz f^qXFsrp=g4G>Kba!zuy4OaP4dE5^L{nV9xJQmFFY literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/Api_2_Pah_Aptlb_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/Api_2_Pah_Aptlb_Bss_1.java new file mode 100644 index 0000000..c0bd1b4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/Api_2_Pah_Aptlb_Bss_1.java @@ -0,0 +1,512 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Aptlb_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlb_bss; + +import javacard.framework.*; +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlb_bss + * + * @version 0.0.1 - 17 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Aptlb_Bss_1 extends TestToolkitApplet +{ + private byte compareBuffer[] = new byte[256] ; + private byte buffer5[] = new byte[5] ; + private byte buffer256[] = new byte[256] ; + private byte buffer[] = new byte[32] ; + private byte copyBuffer[] = new byte[256] ; + + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Aptlb_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Aptlb_Bss_1 thisApplet = new Api_2_Pah_Aptlb_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Result of each test + boolean bRes = false ; + boolean bRes2 = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + short result = (short) 0 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + short length = 0 ; + short offset = 0 ; + short valueLength = 0 ; + short valueOffset = 0 ; + + + // -------------------------------------------- + // Test Case 1 : Null value + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)1 ; + + try { + proHdlr.appendTLV(tag, null, valueOffset, valueLength) ; + } catch (NullPointerException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : valueOffset > value.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)6 ; + valueLength = (short)0 ; + + try { + proHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : valueOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)-1 ; + valueLength = (short)1 ; + + try { + proHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : valueLength > value.Length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)6 ; + + try { + proHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : valueOffset + valueLength > value.Length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)3 ; + valueLength = (short)3 ; + + try { + proHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : valueLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)-1 ; + + try { + proHdlr.appendTLV(tag, buffer5, valueOffset, valueLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : handler overflow + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + byte[] TempBuffer = new byte[(short)(proHdlr.getCapacity() - 1)]; + Util.arrayFillNonAtomic(TempBuffer,(short)0,(short)TempBuffer.length,(byte)0); + try { + proHdlr.appendTLV(tag, TempBuffer, valueOffset, (short)TempBuffer.length); + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : bad input parameter + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + tag = (byte)1 ; + valueOffset = (short)0 ; + valueLength = (short)256 ; + + try { + proHdlr.appendTLV(tag, buffer256, valueOffset, valueLength) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : the current TLV is not modified + testCaseNb = (byte) 9 ; + bRes = false ; + + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + } + + try { + + // Initialise the handler + proHdlr.init((byte)0, (byte)0, (byte)0) ; + + // Select tag 02h + proHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + tag = (byte)0x04 ; + valueOffset = (short)0 ; + valueLength = (short)8 ; + proHdlr.appendTLV(tag, buffer, valueOffset, valueLength) ; + + // Verify current TLV + result = proHdlr.getValueLength() ; + bRes = (result == (short)3) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successfull call + testCaseNb = (byte) 10 ; + bRes = false ; + + tag = (byte)4 ; + + // Initialise buffers + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + compareBuffer[(short)(i+2)] = (byte)((byte)0xFF-i) ; // 04 08 FF FE FD FC FB FA F9 F8 + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)8 ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append buffer + valueOffset = (short)0 ; + valueLength = (short)8 ; + proHdlr.appendTLV(tag, buffer, valueOffset, valueLength) ; + + // Copy the handler + offset = (short) 0 ; + length = (short) proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Successfull call + testCaseNb = (byte) 11 ; + bRes = false ; + + tag = (byte)0x85 ; + + // Initialise buffers + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte)i ; // 00 01 02 03 04 05 06 07 + } + compareBuffer[10] = tag ; + compareBuffer[11] = (byte)0x06 ; + for (short i=0; i<(short)6; i++) { + compareBuffer[(short)(12+i)] = (byte)(i+2) ; // 04 08 FF FE FD FC FB FA F9 F8 85 06 02 03 04 05 06 07 + } + + + try { + + // Append buffer + valueOffset = (short)2 ; + valueLength = (short)6 ; + proHdlr.appendTLV(tag, buffer, valueOffset, valueLength) ; + + // Copy the handler + offset = (short)0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + + tag = (byte) 0x01 ; + // Initialise buffers + for (short i=0; i<8; i++) { + buffer[i] = (byte) ((i+1)*0x11) ; // 11 22 33 44 55 66 77 88 + } + + compareBuffer[18] = tag ; + compareBuffer[19] = (byte) 0x04 ; + compareBuffer[20] = (byte) 0x33 ; + compareBuffer[21] = (byte) 0x44 ; + compareBuffer[22] = (byte) 0x55 ; + compareBuffer[23] = (byte) 0x66 ; + + try { + + // Append buffer + valueOffset = (short)2 ; + valueLength = (short)4 ; + proHdlr.appendTLV(tag, buffer, valueOffset, valueLength) ; + + // Copy the handler + offset = (short)0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successfull call + testCaseNb = (byte) 13 ; + bRes = false ; + + tag = (byte)04 ; + + // Initialise buffers + for (short i=0; i<(short)81; i++) { + buffer256[i] = (byte)i ; + compareBuffer[(short)(i+3)] = (byte)i ; + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0x80 ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append buffer + valueOffset = (short)0 ; + valueLength = (short)0x80 ; + proHdlr.appendTLV(tag, buffer256, valueOffset, valueLength) ; + + // Copy the handler + offset = (short) 0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successfull call (limit case) + testCaseNb = (byte) 14 ; + bRes = false ; + bRes2 = false ; + + tag = (byte)04 ; + + // Initialise buffers + for (short i=0; i<(short)0xFA; i++) { + buffer256[i] = (byte)i ; + compareBuffer[(short)(i+3)] = (byte)i ; + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0xFA ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append buffer + valueOffset = (short)0 ; + valueLength = (short)250 ; + proHdlr.appendTLV(tag, buffer256, valueOffset, valueLength) ; + + // Verify length of the handler + bRes2 = (proHdlr.getLength() == (short)253) ; + + + // Copy the handler + offset = (short) 0 ; + length = (short) proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (bRes2) && (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/Test_Api_2_Pah_Aptlb_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/Test_Api_2_Pah_Aptlb_Bss.java new file mode 100644 index 0000000..4f1b1de --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/Test_Api_2_Pah_Aptlb_Bss.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Aptlb_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlb_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlb_bss + * + * @version 0.0.1 - 17 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Aptlb_Bss extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_aptlb_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Aptlb_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 14 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0ECCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/applet.opt new file mode 100644 index 0000000..9843892 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_aptlb_bss.Api_2_Pah_Aptlb_Bss_1 +uicc.test.toolkit.api_2_pah_aptlb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/javacard/api_2_pah_aptlb_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss/javacard/api_2_pah_aptlb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..1750177d84b38255d08233ee5a65eb88c4310dc3 GIT binary patch literal 4784 zcmbVPdr(x@8UM~b_qDrsckeE{mjy)BiGelBQ!9!Zc0j5wB7(KW;9~_08y8q%wLaQ( z!AE02qD^X?JQV+kLpsAGF+R{#TPIG;I3q1hW1Tc@hni^`VtvfCovF3b@4(8kS2J`V_mn2Qdgg%d-%F-B{_w)DKYQ+4r>))&L3u*9rQ$_amqaS~< zX4t5S)wa0(xqrBC5+;`?F1xuEF-96pAvU+oUA1(O!s~v?cKcC*V`;}vN7M*sS zT~Qo7+n2Ze_STuz{Zn_k=6)h^zwMmTwxxUJo=fj6==Zj*p78aNRcErwH=R3od2qv5 z2mPza`~wZ!F7hPttv6@QnfS)-U2k?ApHVGLc%phn*YWqSRwS&OZ8&u7#Toy)d;iI- zdpqB`QS+hDE+5KYcE9)hmZW2AlKQqC_}z5x1#dSbbDyVgEzIU_UOPflj(*^Mv20+~ z!rrSt>|N>YO@IBV)1Nl%9lEEabp7ckXB~mrNvoed`T7rTU0&Wh{Zn_@;q+4frnMz= z-)cB~>WaG|WpPsVM?(Xz^qpK;W=Ol!yU;h4`@r_u#@W}?2af({uxrP!&g^aJ_Wy`0 z_e%24p}^kf3BX@?fO6bJ6aRv=Ys#ih&yf>U(gGqJ9~dK6R`Go(AJGhqHU~1^XSgn zf{8txX47oL`)U(CtX5?snoV6E_%gbyt*A&)!(;Z=2H}T}@VJ!WH8y$ysTQV;<_@1a z`>-~BZfR5qI|?agk$Zga3`3cf2|u^C+gRGmJfr31b9r zj|~YnUb%MKj2}}57OTYhQLPO5LjIZ(e_desQzv5#Hu}U8J^RTo`VV3s!#Id4>Nb=% z)gW0@Bm1TrFw~oOUX&%7Pu(8_1s%t_7cAIKUN;4*>8o$lk?? zlEZ3Eja~5t>EipnxLSt!h&WwaT-Q?5>&0hkMuS=~qo4`sqG(9lSP z?9pE?%p4lR5pxmwETkWKU_Q2bpcodx67nv|7V0PMCn|p;2P@??R~1ea6_P^n#EBx# zQ|=|417q|Dnd8`egk_Gg&o||fY!+kWY&|M>iOzBneH5poqnV7JMxU-kY4Xv(ani&j zFM1|@auQ`a5kFHjRngPvvyv#y6dLz}qB)A5MxSRyX->yaqt80@WcsuqO12q~SDc$v z^dL#lv*@#dD9ab|vqW= value1.length + testCaseNb = (byte) 3 ; + bRes = false ; + + tag = (byte)1 ; + value1Offset = (short)5 ; + value1Length = (short)1 ; + value2Offset = (short)0 ; + value2Length = (short)1 ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : value1Offset < 0 + testCaseNb = (byte) 4 ; + bRes = false ; + + tag = (byte)1 ; + value1Offset = (short)(-1) ; + value1Length = (short)1 ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 5 : value1length > value1.length + testCaseNb = (byte) 5 ; + bRes = false ; + + tag = (byte)1 ; + value1Offset = (short)0 ; + value1Length = (short)6 ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // ---------------------------------------------------------- + // Test Case 6 : value1Length + value1Offset > value1.length + testCaseNb = (byte) 6 ; + bRes = false ; + + tag = (byte)1 ; + value1Offset = (short)3 ; + value1Length = (short)3 ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // ------------------------------- + // Test Case 7 : value1Length < 0 + testCaseNb = (byte) 7 ; + bRes = false ; + + tag = (byte)1 ; + value1Offset = (short)0 ; + value1Length = (short)(-1) ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 8 : value2Offset >= value2.length + testCaseNb = (byte) 8 ; + bRes = false ; + + tag = (byte)1 ; + value1Offset = (short)0 ; + value1Length = (short)1 ; + value2Offset = (short)5 ; + value2Length = (short)1 ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 9 : value2Offset < 0 + testCaseNb = (byte) 9 ; + bRes = false ; + + value2Offset = (short)(-1) ; + value2Length = (short)1 ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 10 : value2Length > value2.length + testCaseNb = (byte) 10 ; + bRes = false ; + + value2Offset = (short)0 ; + value2Length = (short)6 ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------------------- + // Test Case 11 : value2Offset + value2Length > value2.length + testCaseNb = (byte) 11 ; + bRes = false ; + + value2Offset = (short)3 ; + value2Length = (short)3 ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------- + // Test Case 12 : value2Length < 0 + testCaseNb = (byte) 12 ; + bRes = false ; + + value2Offset = (short)0 ; + value2Length = (short)(-1) ; + + try { + proHdlr.appendTLV(tag,buffer5, value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // -------------------------------- + // Test Case 13 : Handler overflow + testCaseNb = (byte) 13 ; + bRes = false ; + + value1Offset = (short)0; + value2Offset = (short)0 ; + value2Length = (short)1 ; + + try { + byte[] TempBuffer = new byte[(short)(proHdlr.getCapacity()-1)]; + value1Length = (short)TempBuffer.length; + Util.arrayFillNonAtomic(TempBuffer,(short)0,(short)TempBuffer.length,(byte)0); + proHdlr.appendTLV(tag,TempBuffer,value1Offset,value1Length,buffer5,value2Offset,value2Length) ; + } + catch (ToolkitException e) { + if(e.getReason() == ToolkitException.HANDLER_OVERFLOW) + bRes = true; + else + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // --------------------------------------- + // Test Case 14 : Bad Parameter exception + testCaseNb = (byte) 14 ; + bRes = false ; + + value1Offset = (short)0; + value1Length = (short)256 ; + value2Offset = (short)0 ; + value2Length = (short)1 ; + + try { + proHdlr.appendTLV(tag,buffer256,value1Offset,value1Length,buffer256,value2Offset,value2Length) ; + } + catch (ToolkitException e) { + if(e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) + bRes = true; + else + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // --------------------------------------- + // Test Case 15 : Bad Parameter exception + testCaseNb = (byte) 15 ; + bRes = false ; + + value1Offset = (short)0; + value1Length = (short)1 ; + value2Offset = (short)0 ; + value2Length = (short)256 ; + + try { + proHdlr.appendTLV(tag,buffer256,value1Offset,value1Length,buffer256,value2Offset,value2Length) ; + } + catch (ToolkitException e) { + if(e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) + bRes = true; + else + bRes = false; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // --------------------------------------- + // Test Case 16 : successful call does not modify the current TLV + testCaseNb = (byte) 16 ; + bRes = false ; + + buffer5[0] = (byte)0x11; + buffer5[1] = (byte)0x22; + buffer5[2] = (byte)0x33; + buffer5[3] = (byte)0x99; + buffer5[4] = (byte)0x77; + + for(byte i = 0; i <= 0x0F ; i++) + buffer[i] = (byte)(0xFF-i); + + try { + proHdlr.clear(); + proHdlr.appendTLV((byte)0x81,buffer5,(short)0,(short)3); + proHdlr.appendTLV((byte)0x82,buffer5,(short)3,(short)2); + proHdlr.findTLV((byte)0x81,(byte)1); // Select the first TLV + + value1Offset = (short)0; + value1Length = (short)8; + value2Offset = (short)8; + value2Length = (short)8; + proHdlr.appendTLV((byte)0x04,buffer,value1Offset,value1Length,buffer,value2Offset,value2Length); + bRes = (proHdlr.getValueLength() == (short)3); // Check the current TLV + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // --------------------------------------- + // Test Case 17 : successful call + testCaseNb = (byte) 17 ; + bRes = false ; + // Init compareBuffer + compareBuffer = new byte[0x12]; + Util.arrayCopyNonAtomic(buffer,(short)0,compareBuffer,(short)2,(short)0x10); + compareBuffer[0] = (byte)0x04; + compareBuffer[1] = (byte)0x10; + + copyBuffer = new byte[0x12]; + + try { + proHdlr.clear(); + proHdlr.appendTLV((byte)0x04,buffer,value1Offset,value1Length,buffer,value2Offset,value2Length); + proHdlr.copy(copyBuffer,(short)0,(short)copyBuffer.length); + bRes = (Util.arrayCompare(copyBuffer,(short)0,compareBuffer,(short)0,(short)compareBuffer.length)== 0); + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // --------------------------------------- + // Test Case 18 : successful call + testCaseNb = (byte) 18 ; + bRes = false ; + + buffer = new byte[0x10]; + for(byte i = 0; i < (byte)buffer.length ; i++) + buffer[i] = i; + + // Init compareBuffer + compareBuffer = new byte[0x20]; + short offset = Util.arrayCopyNonAtomic(copyBuffer,(short)0,compareBuffer,(short)0,(short)copyBuffer.length); + compareBuffer[offset++] = (byte)0x85; + compareBuffer[offset++] = (byte)0x0C; + offset = Util.arrayCopyNonAtomic(buffer,(short)0x02,compareBuffer,offset++,(short)6); + Util.arrayCopyNonAtomic(buffer,(short)0x0A,compareBuffer,offset,(short)6); + + // Init copyBuffer + copyBuffer = new byte[0x20]; + try { + value1Offset = (byte)0x02; + value1Length = (byte)0x06; + value2Offset = (byte)0x0A; + value2Length = (byte)0x06; + proHdlr.appendTLV((byte)0x85,buffer,value1Offset,value1Length,buffer,value2Offset,value2Length); + proHdlr.copy(copyBuffer,(short)0,(short)copyBuffer.length); + bRes = (Util.arrayCompare(copyBuffer,(short)0,compareBuffer,(short)0,(short)compareBuffer.length)== 0); + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // --------------------------------------- + // Test Case 19 : successful call + testCaseNb = (byte) 19 ; + bRes = false ; + + for(byte i = 1; i <= (byte)(buffer.length -1); i++) + buffer[(byte)(i-1)] = (byte)(i * 0x11); + buffer[0x0F] = (byte)0; + + // Init compareBuffer + compareBuffer = new byte[0x2A]; + offset = Util.arrayCopyNonAtomic(copyBuffer,(short)0,compareBuffer,(short)0,(short)copyBuffer.length); + compareBuffer[offset++] = (byte)0x01; + compareBuffer[offset++] = (byte)0x08; + offset = Util.arrayCopyNonAtomic(buffer,(short)0x02,compareBuffer,offset++,(short)4); + Util.arrayCopyNonAtomic(buffer,(short)0x0A,compareBuffer,offset,(short)4); + + // Init copyBuffer + copyBuffer = new byte[0x2A]; + try { + value1Offset = (byte)0x02; + value1Length = (byte)0x04; + value2Offset = (byte)0x0A; + value2Length = (byte)0x04; + proHdlr.appendTLV((byte)0x01,buffer,value1Offset,value1Length,buffer,value2Offset,value2Length); + proHdlr.copy(copyBuffer,(short)0,(short)copyBuffer.length); + bRes = (Util.arrayCompare(copyBuffer,(short)0,compareBuffer,(short)0,(short)compareBuffer.length)== 0); + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // --------------------------------------- + // Test Case 20 : successful call + testCaseNb = (byte) 20 ; + bRes = false ; + + buffer = new byte[0xFA]; + for(short i = 0; i < (short)buffer.length ; i++) + buffer[i] = (byte)i; + + // Init compareBuffer + compareBuffer = new byte[0xFD]; + compareBuffer[0] = (byte)0x04; + compareBuffer[1] = (byte)0x81; + compareBuffer[2] = (byte)0xFA; + Util.arrayCopyNonAtomic(buffer,(short)0,compareBuffer,(short)3,(short)buffer.length); + + // Init copyBuffer + copyBuffer = new byte[0xFD]; + try { + proHdlr.clear(); + value1Offset = (short)0; + value1Length = (short)0x0080; + value2Offset = (short)0x0080; + value2Length = (short)0x007A; + proHdlr.appendTLV((byte)0x04,buffer,value1Offset,value1Length,buffer,value2Offset,value2Length); + proHdlr.copy(copyBuffer,(short)0,(short)copyBuffer.length); + bRes = (Util.arrayCompare(copyBuffer,(short)0,compareBuffer,(short)0,(short)compareBuffer.length)== 0); + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/Test_Api_2_Pah_Aptlb_Bss_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/Test_Api_2_Pah_Aptlb_Bss_Bss.java new file mode 100644 index 0000000..3babbbe --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/Test_Api_2_Pah_Aptlb_Bss_Bss.java @@ -0,0 +1,102 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Aptlb_Bss_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlb_bss_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlb_bss_bss + * + * @version 0.0.1 - 21 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Aptlb_Bss_Bss extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_aptlb_bss_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Aptlb_Bss_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 20 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "14CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/applet.opt new file mode 100644 index 0000000..5f3abac --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_aptlb_bss_bss.Api_2_Pah_Aptlb_Bss_Bss_1 +uicc.test.toolkit.api_2_pah_aptlb_bss_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/javacard/api_2_pah_aptlb_bss_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlb_bss_bss/javacard/api_2_pah_aptlb_bss_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..f94e4b549696e43174122ba1dfbbcdb1038d33c0 GIT binary patch literal 5484 zcmbVQ4OA4@6}~g?&CmYNuI#YLK?McbSOr#-P*EeUa6r^>)Z}Qf(iOG^-LP9&Z0kwV zWsUV0wAj|f($pBW#<)#RYJ-LZ>p4BPNi?xGKgOO~Pd#aphMdsY=!t1V@7n>EooER= zvv=NnZ{EA#yZ63%^X^tx5t;@vo_QN9?}QOY8c_0!^Z>oRvo0XgYKHk34T|V%+^DgJ3rQLn! zf7E&7@{Qh!E&KYnzU$~M`th|{*^pWBcHs1p`s}X0S0@tkc>`^FF^6lJuyxko-s^mz z`O1{G?>@c$h3kv&-WiEXrS~3focq|}f9-p9!nqT{n;8$?Xw18M=+xP3pS*u*@?V!V zEVnQC&YnXDe&5{q?BQu*(eW;cKi`oP-EgF}eOImbfGYIlFWdE2Ywi7IA6=h)^cQ(G zhrcC+%U*aldmQaL^mfB@tBbD|m2C5mKd~mXKXhl?rPsDs?TEZn_Pfd{HBWu|QqHtb zH$Bt$s>-^#S+vi+zrs_H`ScxP0G}q1HElwQ`j@^Qk{Rw5{>J z3nv%Ne!8>iz`<#+fA;u23y;3st-2pP_J{P9Zv_fVs-(TbXNK=L^j_*a9c=#7*WUc? zz13Bce0RmXPa+(^hZLY1qiBrBjz#f{=Lbr%5HXpH(%M*8R}l8MgbTvKU|@Y?xWE@` zto77}d=0g}P&lx*c5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ss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/Api_2_Pah_Aptlbb_Bss_1.java new file mode 100644 index 0000000..ef45cec --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/Api_2_Pah_Aptlbb_Bss_1.java @@ -0,0 +1,525 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Aptlbb_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlbb_bss; + +import javacard.framework.Util; +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlbb_bss + * + * @version 0.0.1 - 17 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Aptlbb_Bss_1 extends TestToolkitApplet +{ + private byte compareBuffer[] = new byte[256] ; + private byte buffer5[] = new byte[5] ; + private byte buffer256[] = new byte[256] ; + private byte buffer[] = new byte[32] ; + private byte copyBuffer[] = new byte[256] ; + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Aptlbb_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Aptlbb_Bss_1 thisApplet = new Api_2_Pah_Aptlbb_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Result of each test + boolean bRes = false ; + boolean bRes2 = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + short result = (short) 0 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + short length = 0 ; + short offset = 0 ; + byte value1 = 0 ; + short value2Length = 0 ; + short value2Offset = 0 ; + + + // -------------------------------------------- + // Test Case 1 : Null value + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)1 ; + + try { + proHdlr.appendTLV(tag, value1, null, value2Offset, value2Length) ; + } catch (NullPointerException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : value2Offset > value2.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)6 ; + value2Length = (short)0 ; + + try { + proHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : value2Offset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)-1 ; + value2Length = (short)1 ; + + try { + proHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : value2Length > value2.Length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)6 ; + + try { + proHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : value2Offset + value2Length > value2.Length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)3 ; + value2Length = (short)3 ; + + try { + proHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : valueLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)-1 ; + + try { + proHdlr.appendTLV(tag, value1, buffer5, value2Offset, value2Length) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : handler overflow + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)254 ; + byte[] TempBuffer = new byte[(short)(proHdlr.getCapacity() - 1)]; + Util.arrayFillNonAtomic(TempBuffer,(short)0,(short)TempBuffer.length,(byte)0); + proHdlr.appendArray(TempBuffer,(short)0,(short)TempBuffer.length); + try { + proHdlr.appendTLV(tag, value1, buffer256, value2Offset, value2Length) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : bad input parameter + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + tag = (byte)1 ; + value2Offset = (short)0 ; + value2Length = (short)256 ; + + try { + proHdlr.appendTLV(tag, value1, buffer256, value2Offset, value2Length) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) ; + } + + } catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : the current TLV is not modified + testCaseNb = (byte) 9 ; + bRes = false ; + + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + } + + try { + + // Initialise the handler + proHdlr.init((byte)0, (byte)0, (byte)0) ; + + // Select tag 02h + proHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Append TLV + tag = (byte)0x04 ; + value1 = (byte)0x05 ; + value2Offset = (short)0 ; + value2Length = (short)8 ; + proHdlr.appendTLV(tag, value1, buffer, value2Offset, value2Length) ; + + // Verify current TLV + result = proHdlr.getValueLength() ; + bRes = (result == (short)3) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successfull call + testCaseNb = (byte) 10 ; + bRes = false ; + + tag = (byte)4 ; + value1 = (byte)0x05 ; + + // Initialise buffers + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte) ((byte)0xFF-i) ; // FF FE FD FC FB FA F9 F8 + compareBuffer[(short)(i+3)] = (byte)((byte)0xFF-i) ; // 04 08 FF FE FD FC FB FA F9 F8 + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)9 ; + compareBuffer[2] = value1 ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append buffer + value2Offset = (short)0 ; + value2Length = (short)8 ; + proHdlr.appendTLV(tag, value1, buffer, value2Offset, value2Length) ; + + // Copy the handler + offset = (short) 0 ; + length = (short) proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Successfull call + testCaseNb = (byte) 11 ; + bRes = false ; + + tag = (byte)0x85 ; + value1 = (byte)0x55 ; + + // Initialise buffers + for (short i=0; i<(short)8; i++) { + buffer[i] = (byte)i ; // 00 01 02 03 04 05 06 07 + } + compareBuffer[11] = tag ; + compareBuffer[12] = (byte)0x07 ; + compareBuffer[13] = value1 ; + + for (short i=0; i<(short)6; i++) { + compareBuffer[(short)(14+i)] = (byte)(i+2) ; // 04 08 FF FE FD FC FB FA F9 F8 85 06 02 03 04 05 06 07 + } + + + try { + + // Append buffer + value2Offset = (short)2 ; + value2Length = (short)6 ; + proHdlr.appendTLV(tag, value1, buffer, value2Offset, value2Length) ; + + // Copy the handler + offset = (short)0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + + tag = (byte) 0x01 ; + value1 = (byte) 0x44 ; + // Initialise buffers + for (short i=0; i<8; i++) { + buffer[i] = (byte) ((i+1)*0x11) ; // 11 22 33 44 55 66 77 88 + } + + compareBuffer[20] = tag ; + compareBuffer[21] = (byte) 0x05 ; + compareBuffer[22] = value1 ; + compareBuffer[23] = (byte) 0x33 ; + compareBuffer[24] = (byte) 0x44 ; + compareBuffer[25] = (byte) 0x55 ; + compareBuffer[26] = (byte) 0x66 ; + + try { + + // Append buffer + value2Offset = (short)2 ; + value2Length = (short)4 ; + proHdlr.appendTLV(tag, value1, buffer, value2Offset, value2Length) ; + + // Copy the handler + offset = (short)0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successfull call + testCaseNb = (byte) 13 ; + bRes = false ; + + tag = (byte)04 ; + value1 = (byte) 0x00 ; + + // Initialise buffers + for (short i=0; i<(short)80; i++) { + buffer256[i] = (byte)(i+1) ; + compareBuffer[(short)(i+4)] = (byte)(i+1) ; + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0x80 ; + compareBuffer[3] = value1 ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append buffer + value2Offset = (short)0 ; + value2Length = (short)0x7F ; + proHdlr.appendTLV(tag, value1, buffer256, value2Offset, value2Length) ; + + // Copy the handler + offset = (short) 0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successfull call (limit case) + testCaseNb = (byte) 14 ; + bRes = false ; + bRes2 = false ; + + tag = (byte)04 ; + value1 = (byte) 0x00 ; + + // Initialise buffers + for (short i=0; i<(short)0xFA; i++) { + buffer256[i] = (byte)(i+1) ; + compareBuffer[(short)(i+4)] = (byte)(i+1) ; + } + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0xFA ; + compareBuffer[3] = value1 ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append buffer + value2Offset = (short)0 ; + value2Length = (short)249 ; + proHdlr.appendTLV(tag, value1, buffer256, value2Offset, value2Length) ; + + // Verify length of the handler + bRes2 = (proHdlr.getLength() == (short)253) ; + + // Copy the handler + offset = (short) 0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(copyBuffer, offset, length) ; + + // Compare buffer + result = javacard.framework.Util.arrayCompare(copyBuffer, offset, + compareBuffer, offset, length) ; + + bRes = (bRes2) && (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/Test_Api_2_Pah_Aptlbb_Bss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/Test_Api_2_Pah_Aptlbb_Bss.java new file mode 100644 index 0000000..65d5c9a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/Test_Api_2_Pah_Aptlbb_Bss.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Aptlbb_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlbb_bss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlbb_bss + * + * @version 0.0.1 - 17 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Aptlbb_Bss extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_aptlbb_bss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Aptlbb_Bss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 14 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0ECCCCCC CCCCCCCC CCCCCCCC CCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/applet.opt new file mode 100644 index 0000000..882ed0b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_aptlbb_bss.Api_2_Pah_Aptlbb_Bss_1 +uicc.test.toolkit.api_2_pah_aptlbb_bss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/javacard/api_2_pah_aptlbb_bss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbb_bss/javacard/api_2_pah_aptlbb_bss.cap new file mode 100644 index 0000000000000000000000000000000000000000..70ca98924f69e7abec3350c91fc0cef3b7e28e50 GIT binary patch literal 4918 zcmbVPdvH|M8UM~b_qDIPcV9P40)&T{thISHKtgyen*bpOHxOF^3)zG)q*;$zbTr0mF?=3x1Y8zq)qd;hQE;^`+fIxf5%S zJ~K3HcZK-(({;YH=K7BYUf}o7tKhHH95kO=_ss*p=088PY^3&t@9ks1>dB~CvbnDz z^Xm&Ae6#HM`p(GV!DYT4DQE8bjDtZ_M%Hp?%f0@ARqel2k9;Bz?5%I!K74<5(HG~l zK7Zh~x+?D8Q~wS=GOz5hl|MCqIQP}2%q8b%`oRK2_Q9M(rp1@eO?*eb{z~EN1I>*? zt3Mc8T|KlmocGe<_s;Jq-8HlK%8uuZ{hxgAl>_f?IrPSpu2WT;yS{tR)Rp@NYbtZj zzV(;aOP9R&?G?AqO2g{QMdud%@Y-wHv;FsPtvlQQ=)N;I4O=shpSygjbx}>r%A|E<8Ifrdca`uwGhf%T1Tc@2ROfz0<$j9eic4@BLMOBp~I z!E5&v>?ea>tGc#x8a`z*4<%L5@}{=NhHz`!;|!OBY{*1$LK&n4|+&xhd4zHVVf>nclS5 za8Zs(`?0Af2%cnjJ3fWjAdqBMAMY(K58yD9g(#_dz}MQ+9uBmG{TL+76atz)gTsYT z2nvTnQFs)Qi{L{X69JCW2yiH}$ewi?fIKasa3})m77#lXYz4q~3}S~$X{Uu?tMg$_ zcGV*ja78AiC@Iqq2HM*hZxJ+K1SAlQNRaRy9CXUW*eU7o9$av=KT<$dP-t1Cf_7qi zI#R>m0}8)0vW!0siZCluDRf}_cBDr1fFgE8Hi(xQ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qz$>bL!jCoz{9V{Sh4pdpQj--GQwK)1QiQu>JTkO4U)xXQaPM QU?&}z@E1gX^eIgHA6ouw`Tzg` literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/Api_2_Pah_Aptlbbb_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/Api_2_Pah_Aptlbbb_1.java new file mode 100644 index 0000000..8a9cb2f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/Api_2_Pah_Aptlbbb_1.java @@ -0,0 +1,249 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Aptlbbb_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlbbb; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +import javacard.framework.*; +import uicc.test.util.*; +import uicc.toolkit.*; + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlbbb + * + * @version 0.0.1 - 3 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Aptlbbb_1 extends TestToolkitApplet +{ + + /** + * Constructor of the applet + */ + public Api_2_Pah_Aptlbbb_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Aptlbbb_1 thisApplet = new Api_2_Pah_Aptlbbb_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Result of each test + boolean bRes = false ; + boolean bRes2 = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + short result = (short) 0 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + byte value1 = 0 ; + byte value2 = 0 ; + short length = 0 ; + short offset = 0 ; + byte[] buffer = new byte[256] ; + byte[] compareBuffer = new byte[256] ; + + // -------------------------------------------- + // Test Case 1 : handler overflow + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + byte[] TmpBuffer = new byte[(short)(proHdlr.getCapacity()-1)]; + Util.arrayFillNonAtomic(TmpBuffer,(short)0,(short)TmpBuffer.length,(byte)0); + proHdlr.appendArray(TmpBuffer,offset,(short)TmpBuffer.length) ; + + // appendTLV + try { + proHdlr.appendTLV(tag, value1, value2) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : the current TLV is not modified + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init((byte)0, (byte)0, (byte)0) ; + + // Select tag 02h + proHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1); + byte command_details_value = proHdlr.getValueByte((short)0); + + // Append TLV + proHdlr.appendTLV(tag, value1, value2) ; + + // Verify current TLV + bRes = (proHdlr.getValueByte((short)0) == command_details_value) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append TLV + tag = (byte)0x84 ; + value1 = (byte)0x00 ; + value2 = (byte)0x01 ; + proHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[0] = tag ; + compareBuffer[1] = (byte)2; + compareBuffer[2] = value1; + compareBuffer[3] = value2; + + // Copy the handler + offset = (short)0 ; + length = (short)4 ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (result == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4; + bRes = false ; + + try { + + // Append TLV + tag = (byte)0x01 ; + value1 = (byte)0xFE ; + value2 = (byte)0xFD ; + proHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[4] = tag ; + compareBuffer[5] = (byte)2; + compareBuffer[6] = value1 ; + compareBuffer[7] = value2; + + // Copy the handler + offset = (short)0 ; + length = (short)8 ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (result == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : successful call + testCaseNb = (byte) 5 ; + bRes = false ; + bRes2 = false ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Initialise buffers + for (short i=0; i<250; i++) { + buffer[i] = (byte)i ; + compareBuffer[i] = (byte)i ; + } + buffer[1] = (byte)0x81 ; + buffer[2] = (byte)0xF6 ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0xF6 ; + tag = (byte)0x84 ; + value1 = (byte)0x00 ; + value2 = (byte)0x01 ; + compareBuffer[249] = tag ; + compareBuffer[250] = (byte)2 ; + compareBuffer[251] = value1 ; + compareBuffer[252] = value2 ; + + // Initialise the handler + offset = (short)0 ; + length = (short)249 ; + proHdlr.appendArray(buffer, offset, length) ; + + // Append TLV + proHdlr.appendTLV(tag, value1, value2) ; + + // Verify length of the handler + bRes2 = (proHdlr.getLength() == (short)253) ; + + // Copy the handler + offset = (short)0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = javacard.framework.Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (bRes2) && (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/Test_Api_2_Pah_Aptlbbb.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/Test_Api_2_Pah_Aptlbbb.java new file mode 100644 index 0000000..220cce7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/Test_Api_2_Pah_Aptlbbb.java @@ -0,0 +1,100 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Aptlbbb.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlbbb; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlbbb + * + * @version 0.0.1 - 3 mars 2006 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Aptlbbb extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_aptlbbb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Aptlbbb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 5 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/applet.opt new file mode 100644 index 0000000..2500ed3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_aptlbbb.Api_2_Pah_Aptlbbb_1 +uicc.test.toolkit.api_2_pah_aptlbbb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/javacard/api_2_pah_aptlbbb.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbb/javacard/api_2_pah_aptlbbb.cap new file mode 100644 index 0000000000000000000000000000000000000000..d97bcf4886fbc2fe4005d410ffcfd315b5cd0266 GIT binary patch literal 3629 zcmbW3YfKbZ6vxlZo!On)-I?7*c0?@|sUoY96^cMasDRKSqM%rPyt*oLSMn9> zi4l(%#9sAeL(2O03xVRU?7urlum00?y=7SEy>4;y-HAIMBy6hONJfh5R?a(jVAi2B zu62dQzoWM8m2=7St1oOH^jG0)En72BEu66R^s*aUs^UBL3fuP|pI-cBXY%Z`d_&Zn zp9U}$1=g&&CFyy)_hlB34lIe>TX17}d{ObLZ%!`S-SwV*4m0ngs^!Nxrt#>goKK7+ zCzQY4JcVpxUKdl1@i$sK&U2erMph}m4c{>4{KL!RM?Y@3b$#(E-Y9OK?YP`|_b?`(=OE&iTvstto9= zVC;A_E#uqrf@uk}Po;F%ubA9=);Rh^S=`3XhQ{v8$+NbUM^CxeeCFLf#WOvw#@n`4 zJK^M;6}JxAHm&*bO0(-`&o1lCJ?*PVQGs6gI~TgE z6I@Oo1A{Lg@4dmW959w`Xh#IT7mp8OkQz?RFe`QT*9k3`tN3R7$lmtuz3%Y=eZ60*>7D56NgZGHoRxQoR z6O+gwv_zGH(&k&Gv!;eRr2{1g@x5T6Ud^p%As{e@fL;Y_&ChHn__k1KUYkO>RQ4jUdMBh+R+Y0Dfd4v0Ov9k{b^``uQjCg$dc&mCwoRh_ zMv(2i!aJXa5f0T;C}-DOp4bIT&vQ6^5GPQaMHl2*^nE~!@IQ$HC6c7RC6S0-_Sw)^ zS&`==r0@Ke%qX%I9#&qnnK(;*n$5&p?&D~%Ez$Nf^CMZ|LC{Nlfcj~LM?pue@VL)Y z91nL@y)5+I04wzLEepO`#y;mD{ITcebm#){Mblavo?sTA`uU)QA0E{Nl%|h(hTrM; zxbi&i%HYQ(ptJuT;TY$Yh?_|`Mx_}u-CaJ#>q3;bihjc)ZWzoA7^N5Jq0@0DPOy%$ z%93G_EQ)4fka6HB^Wc}pmgW93AdUO!BcaHRuObI!aT>liW3~YL5@MGwO;F za2LhAg-HoWJsS`(Z`DI03EowB) zSg3SRL)6=U2(nizL|qK1QR>}1gv!O2N>e;J{d>Ebq29zpjIXsaLR-2TqRwa`h(XX8 th$_FSN$R8)A}!TQQl&UGNu9Dnq#muL@B~&=z|(vLM*L01HRuv)?;o?*iB|vs literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/Api_2_Pah_Aptlbbs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/Api_2_Pah_Aptlbbs_1.java new file mode 100644 index 0000000..74604b4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/Api_2_Pah_Aptlbbs_1.java @@ -0,0 +1,253 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Aptlbbs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlbbs; + +import javacard.framework.*; +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlbbs + * + * @version 0.0.1 - 20 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Aptlbbs_1 extends TestToolkitApplet +{ + private byte compareBuffer[] = new byte[256] ; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Aptlbbs_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Aptlbbs_1 thisApplet = new Api_2_Pah_Aptlbbs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Result of each test + boolean bRes = false ; + boolean bRes2 = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + short result = (short) 0 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + byte tag = 0 ; + byte value1 = 0 ; + short value2 = 0 ; + short length = 0 ; + short offset = 0 ; + byte[] buffer = new byte[256] ; + + // -------------------------------------------- + // Test Case 1 : handler overflow + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + byte[] TmpBuffer = new byte[(short)(proHdlr.getCapacity()-1)]; + Util.arrayFillNonAtomic(TmpBuffer,(short)0,(short)TmpBuffer.length,(byte)0); + proHdlr.appendArray(TmpBuffer,offset,(short)TmpBuffer.length) ; + + // appendTLV + try { + proHdlr.appendTLV(tag, value1, value2) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.HANDLER_OVERFLOW) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : the current TLV is not modified + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init((byte)0, (byte)0, (byte)0) ; + + // Select tag 02h + proHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1); + byte command_details_value = proHdlr.getValueByte((short)0); + + // Append TLV + proHdlr.appendTLV(tag, value1, value2) ; + + // Verify current TLV + bRes = (proHdlr.getValueByte((short)0) == command_details_value) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Append TLV + tag = (byte)0x84 ; + value1 = (byte)0x00 ; + value2 = (short)0x0102 ; + proHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[0] = tag ; + compareBuffer[1] = (byte) 3; + compareBuffer[2] = value1 ; + compareBuffer[3] = (byte)(value2>>8 & (short)0x00FF); + compareBuffer[4] = (byte)(value2 & (short)0x00FF) ; + + // Copy the handler + offset = (short)0 ; + length = (short)5 ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (result == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4; + bRes = false ; + + try { + + // Append TLV + tag = (byte)0x01 ; + value1 = (byte)0xFE ; + value2 = (short)0xFDFC ; + proHdlr.appendTLV(tag, value1, value2) ; + + // Initialise compareBuffer + compareBuffer[5] = tag ; + compareBuffer[6] = (byte) 3; + compareBuffer[7] = value1 ; + compareBuffer[8] = (byte)(value2>>8 & (short)0x00FF); + compareBuffer[9] = (byte)(value2 & (short)0x00FF); + + // Copy the handler + offset = (short)0 ; + length = (short)10 ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (result == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : successful call + testCaseNb = (byte) 5 ; + bRes = false ; + bRes2 = false ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Initialise buffers + for (short i=0; i<250; i++) { + buffer[i] = (byte)i ; + compareBuffer[i] = (byte)i ; + } + buffer[1] = (byte)0x81 ; + buffer[2] = (byte)0xF5 ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0xF5 ; + tag = (byte)0x84 ; + value1 = (byte)0x00 ; + value2 = (short)0x0102 ; + compareBuffer[248] = tag ; + compareBuffer[249] = (byte)3 ; + compareBuffer[250] = value1 ; + compareBuffer[251] = (byte)(value2>>8 & (short)0x00FF); + compareBuffer[252] = (byte)(value2 & (short)0x00FF); + + // Initialise the handler + offset = (short)0 ; + length = (short)248 ; + proHdlr.appendArray(buffer, offset, length) ; + + // Append TLV + proHdlr.appendTLV(tag, value1, value2) ; + + // Verify length of the handler + bRes2 = (proHdlr.getLength() == (short)253) ; + + // Copy the handler + offset = (short)0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (bRes2) && (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/Test_Api_2_Pah_Aptlbbs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/Test_Api_2_Pah_Aptlbbs.java new file mode 100644 index 0000000..20b8af4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/Test_Api_2_Pah_Aptlbbs.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Aptlbbs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlbbs; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlbbs + * + * @version 0.0.1 - 20 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Aptlbbs extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_aptlbbs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Aptlbbs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 5 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/applet.opt new file mode 100644 index 0000000..b6bd95a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_aptlbbs.Api_2_Pah_Aptlbbs_1 +uicc.test.toolkit.api_2_pah_aptlbbs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/javacard/api_2_pah_aptlbbs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbbs/javacard/api_2_pah_aptlbbs.cap new file mode 100644 index 0000000000000000000000000000000000000000..e46904557d8e65c29e91907aee9a6dc6d0444f0d GIT binary patch literal 3734 zcmbVOeQZ-z6hH6X_g>#?`?^qjt6GcQYFi{l0P(ngtm>NxtD1Ly{b33qm5BcMHoAd6y@7{NQ zzjMy*xyM&eI0uOM8`fGk4*E3*aNw<-UR6*x#Z%<1no{Sfoi@GD>$!0nAn|}V93PYQ z&XYe6X}w@Op&nfrZV$azTvGhu!QIs>wuuL(cO}=?zQPWO_7ut^KmMk7UB$~|FWGxW zUY|d_H&hMdI}e_ZPd!!r$C1(Nf3^PDHSEZhFQgs6RPO$>@Y$xP$tbCP?VNLmA9`y6 zcVLYY-QAiPac=C~=JPLQ|L(oFYiGro#)P-<|J14nXD(qsEH{@}A_GpTOV)*7aNaof$koG_;~Tk#1DWC3^VSa8 zGc)_6)sKHN*8A?Pp-c{QVbto$zRa%zVWDAz;N9}kCpopyv5()QyeA6&TR9kJgx=bGTFH;Ku>Y}aZA;5-N5!|0h)F{9Btb)kG> zF3zZwpsWl90!7haOSC8&4mT|gMT`8A(7fV#5&z9pg5ouszD_+U-Ek%3CBmCK7d zzNtVQDu%J@mPNwNDJ%|3^&b5hHL{Fp7j_F6M(6GU_!e$10;8q0$nsKeEiO|jM=|91 zn(*?LsDF9Xho^!%fk%%kENWq62#CD^;3hF(QAB~hi%TdnFpshz#BDg{L1@Z=)clC@2Eu zprFfWhkonFLXrB>P|W|6he&yl;=bs~#3e_ZXo0NC)X={EVVO~7JN(u3ozu!GZ4;bU zUil4I=@=b^I1NNa)isPyqeU4Qol77wN6 z<~!|Yw*_FxeCbXxXw~MarDwi+Q^x-;l`^AwU|Q544Fx=*U{mV>8 & (short)0x00FF) ; + compareBuffer[3] = (byte)(value & (short)0x00FF) ; + + // Copy the handler + offset = (short)0 ; + length = (short)4 ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (result == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + // Append TLV + tag = (byte)0x01 ; + value = (short)0xFEFF ; + proHdlr.appendTLV(tag, value) ; + + // Initialise compareBuffer + compareBuffer[4] = tag ; + compareBuffer[5] = (byte) 2; + compareBuffer[6] = (byte)(value>>8 & (short)0x00FF); + compareBuffer[7] = (byte)(value & (short)0x00FF); + + // Copy the handler + offset = (short)0 ; + length = (short)8 ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (result == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + // -------------------------------------------- + // Test Case 5 : successful call + testCaseNb = (byte) 5 ; + bRes = false ; + bRes2 = false ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Initialise buffers + for (short i=0; i<251; i++) { + buffer[i] = (byte)i ; + compareBuffer[i] = (byte)i ; + } + buffer[1] = (byte)0x81 ; + buffer[2] = (byte)0xF7 ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0xF7 ; + tag = (byte)0x84 ; + value = (short)0x0001 ; + compareBuffer[249] = tag ; + compareBuffer[250] = (byte) 2; + compareBuffer[251] = (byte)(value>>8 & (short)0x00FF); + compareBuffer[252] = (byte)(value & (short)0x00FF); + + // Initialise the handler + offset = (short)0 ; + length = (short)249 ; + proHdlr.appendArray(buffer, offset, length) ; + + // Append TLV + proHdlr.appendTLV(tag, value) ; + + // Verify length of the handler + bRes2 = (proHdlr.getLength() == (short)253) ; + + + // Copy the handler + offset = (short)0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (bRes2) && (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/Test_Api_2_Pah_Aptlbs.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/Test_Api_2_Pah_Aptlbs.java new file mode 100644 index 0000000..9af043c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/Test_Api_2_Pah_Aptlbs.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Aptlbs.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlbs; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlbs + * + * @version 0.0.1 - 20 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Aptlbs extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_aptlbs"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Aptlbs() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 5 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/applet.opt new file mode 100644 index 0000000..4b8a0b3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_aptlbs.Api_2_Pah_Aptlbs_1 +uicc.test.toolkit.api_2_pah_aptlbs +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/javacard/api_2_pah_aptlbs.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbs/javacard/api_2_pah_aptlbs.cap new file mode 100644 index 0000000000000000000000000000000000000000..c7fc259b8118b41ee9f1e853a7e810af85bc5704 GIT binary patch literal 3654 zcmbW3dr(wm6u{4Y-`%?lca^>168OYn9c5iKAFLXI z_k1Tei(#Wc#9z;fG0#GW76mM1XG}`#Hzp_3mYtR}CNpE=q@?W3M@Ik}CS;Fa)IVn5 z%I2;Wr<_xc?wjs=b6VBQWAkr~?X&894Yj)D{G+|x4}8sb@0SBt4fDNs`|g^Pi%0c+ zr+L|u^_z9nxzs%cQf7j5<>9_N_Ws+KAG&<#Vz0b!nYXUppT46!VtudvCFR*?H~hNR zwEarjiIuKWShwMWa7?)g-Z@xczhUJ?XmDOvnPJY3Wy=&a}`Ww}Oqt4!9;pxe-JEjl0 zYIp3;w>0U8jBc8m>Y2T1Q}_LSpKqEGTseBzq~GVS`?NW7-;VE$(S3X66%3zu^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X%L+i1r@ zF4yQxrBaz>nQv@#(rLL_6di?!?Bi;$V<|zZz3}#5wI9)>JBwVT~~xKn>AuWRfd|OE+|5bPI!uGaV1n>8 & (short)0x00FF) ; + compareBuffer[3] = (byte)(value1 & (short)0x00FF) ; + compareBuffer[4] = (byte)(value2>>8 & (short)0x00FF) ; + compareBuffer[5] = (byte)(value2 & (short)0x00FF) ; + + // Copy the handler + offset = (short)0 ; + length = (short)6 ; + proHdlr.copy(buffer, offset, length) ; + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (result == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + // Append TLV + tag = (byte)0x01 ; + value1 = (short)0xFEFD; + value2 = (short)0xFCFB; + proHdlr.appendTLV(tag,value1,value2); + + // Initialise compareBuffer + compareBuffer[6] = tag ; + compareBuffer[7] = (byte) 4; + compareBuffer[8] = (byte)(value1>>8 & (short)0x00FF); + compareBuffer[9] = (byte)(value1 & (short)0x00FF); + compareBuffer[10] = (byte)(value2>>8 & (short)0x00FF); + compareBuffer[11] = (byte)(value2 & (short)0x00FF); + + // Copy the handler + offset = (short)0 ; + length = (short)8 ; + proHdlr.copy(buffer, offset, length) ; + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (result == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + // -------------------------------------------- + // Test Case 5 : successful call + testCaseNb = (byte) 5 ; + bRes = false ; + bRes2 = false ; + + try { + + // Clear the handler + proHdlr.clear() ; + + // Initialise buffers + for (short i=0; i<251; i++) { + buffer[i] = (byte)i ; + compareBuffer[i] = (byte)i ; + } + buffer[1] = (byte)0x81 ; + buffer[2] = (byte)0xF7 ; + compareBuffer[1] = (byte)0x81 ; + compareBuffer[2] = (byte)0xF7 ; + tag = (byte)0x84 ; + value1 = (short)0x0001; + value2 = (short)0x0203; + compareBuffer[247] = tag ; + compareBuffer[248] = (byte) 4; + compareBuffer[249] = (byte)(value1>>8 & (short)0x00FF); + compareBuffer[250] = (byte)(value1 & (short)0x00FF); + compareBuffer[251] = (byte)(value2>>8 & (short)0x00FF); + compareBuffer[252] = (byte)(value2 & (short)0x00FF); + + // Initialise the handler + offset = (short)0 ; + length = (short)247 ; + proHdlr.appendArray(buffer, offset, length) ; + + // Append TLV + proHdlr.appendTLV(tag,value1,value2) ; + + // Verify length of the handler + bRes2 = (proHdlr.getLength() == (short)253) ; + + + // Copy the handler + offset = (short)0 ; + length = (short)proHdlr.getLength() ; + proHdlr.copy(buffer, offset, length) ; + + // Compare the handler + result = Util.arrayCompare(buffer, offset, compareBuffer, offset, length) ; + bRes = (bRes2) && (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/Test_Api_2_Pah_Aptlbss.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/Test_Api_2_Pah_Aptlbss.java new file mode 100644 index 0000000..8b68be0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/Test_Api_2_Pah_Aptlbss.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Aptlbss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_aptlbss; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_aptlbss + * + * @version 0.0.1 - 21 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Aptlbss extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_aptlbss"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Aptlbss() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 5 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "05CCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/applet.opt new file mode 100644 index 0000000..a06d6f6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_aptlbss.Api_2_Pah_Aptlbss_1 +uicc.test.toolkit.api_2_pah_aptlbss +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/javacard/api_2_pah_aptlbss.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_aptlbss/javacard/api_2_pah_aptlbss.cap new file mode 100644 index 0000000000000000000000000000000000000000..7bd14e88822c6161da9e2eac1687363d408300dd GIT binary patch literal 3792 zcmbVOdvFug8vl0BW_R=0WMh*h4YVNBGD(HT)Yb>R?X;E_3KT;T83ds*gxf$QFI^j;nDEjlV%!1|pOZo13$kG&`J?Kzus z^8J3l@0@(+3(X>&3q<^stZuG?QOyM$v@~8`Kc#t2Q=p}OPIFV^yvxg5n*Q7a(AV0M z$e!=nwdvUS)rakGDX(`#W*6N3(p}-}ON(5G?iiR^HT2^GwQNHDi{I@J{ru{hBS#}m z1;x)Ue&dEosRt%;ZRG1MQ#_j|-|BefKhyUP)OxekiQY`1W7?J3BoAI^Sz{7p}-yi9G_*3u~U&cC}W`_@Cd zHAuZ;|l^&kFwg373tp#mA%-y*#vuVbT(6=4mK6%Ws>)EHP#!N10 zTT#=oX=w0-@4%kq``zo7$JiyrywCGl?e2zb)4&5arrRb~wzsN12Y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ah_Cler_1.java new file mode 100644 index 0000000..ae81dcd --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/Api_2_Pah_Cler_1.java @@ -0,0 +1,120 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Cler_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_cler; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_cler + * + * @version 0.0.1 - 17 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Cler_1 extends TestToolkitApplet +{ + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Cler_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Cler_1 thisApplet = new Api_2_Pah_Cler_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + + // Result of each test + boolean bRes = false ; + boolean bRes2 = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + short result = (short) 0 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // -------------------------------------------- + // Test Case 1 : Successful call + testCaseNb = (byte) 1 ; + bRes = false ; + bRes2 = false ; + + try { + + // Initialise the handler + proHdlr.init((byte)0, (byte)0, (byte)0) ; + + // Select command Details TLV + proHdlr.findTLV(TAG_COMMAND_DETAILS, (byte)1) ; + + // Verify the length of the handler + bRes2 = (proHdlr.getLength() != 0) ; + + proHdlr.clear() ; + + // Verify the length of the handler + bRes = (bRes2) && (proHdlr.getLength() == 0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : A successful call resets the current TLV selected + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + try { + proHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/Test_Api_2_Pah_Cler.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/Test_Api_2_Pah_Cler.java new file mode 100644 index 0000000..ad551dd --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/Test_Api_2_Pah_Cler.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Cler.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_cler; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_cler + * + * @version 0.0.1 - 17 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Cler extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_cler"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Cler() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 2 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "02CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/applet.opt new file mode 100644 index 0000000..1a320b8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_cler.Api_2_Pah_Cler_1 +uicc.test.toolkit.api_2_pah_cler +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/javacard/api_2_pah_cler.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cler/javacard/api_2_pah_cler.cap new file mode 100644 index 0000000000000000000000000000000000000000..11dcc76b0de5dd693e23f8ab37a817556903ce87 GIT binary patch literal 2994 zcmb7_3rtg27{|Z+XnWfVLtZT)7F`u^N-4UjAPPZVVqFzkHXTAORSF&L%7skEOsQKG zP~6mwDL8fYkv-64Zqewnpqn_&$Z#eGk(n?vb(&=)TQpmA-FF!7+OsWbPxJ4+_ndRj z?|kPw_kYYK93Kq={*s%DpN7XuH1J@`Uzt0rcv*qLl)J3BAis2FnyKK=ivT?lOJXO>=4-EI}X%$qJ$mz5=al0EN7W7dYM z_>-!6MJHF~*w!C9G^Kag=Q<5@-*S9#WuNASpLESOolG-RUsEe1Y94goy)d%G_lIW3vCd=MkpIYz z%Hux$`j6LX?hY*ID|_mVy*A^{CBvPY?_D=OJO5_N`3H@+b*hz}S63x9=e~IEwc}AW z<@ZLqN7I`d`mQ+dm^a@UN;a1$gta%+OalWjzyp{ub*iz1k)`0E$_KQk;3 zOvHX1L3lTyT8mRasm(x84;vtJ( z$Wa`QWfc4IvX)_}RgT137;gk7a6Yg0lzOtUnJ5z#{Cej(>*_^IooL2wK*E>d`{68t zSP%Z;P;!7c&I2q;kdr#E5|~XaUc*4{4achtuuaK%!>CCayCz*G*&>>a3Sm+XOMN|= zjT~b0knIN*nMz>`3toXyc@)=7HiIMYs2M204D@NYIfEp@gyo)0}$WxfEGJL$=GFESN z2`LKB=wh|8{N#3+AS2`b-Gj?=MWrZW6zvcuuO08qQr(*Z_eyR5;E6C?D5CkO;L}nn zT130Gz;1Jlt(bsc<3A;kaXqTCbP~1^g~nK6Tes9{MUJzMWJQU)hn<=TQ3^qjtN01L zFfmdogsU`abzC6wR(@K;2E-A~Lj@n!Vq3k{ZFiyR5TY6y@yi3?fCa9F^$NJ#Nb#^_ z3o;%KT5wK!+#KXliFeas3c1HES_m1i9p3~9hsluS_m8#eK~HQFpHfk?Ae~8z(3VYeXy27M z2HZu#N0Rr*g=qk7w-R7?NC3%vX#(w05}{8PN(hu=(HPpMB+Lvv_JUt2%Cu+ dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + try { + proHdlr.copy(dstBuffer5, (short)6, (short)0) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + proHdlr.copy(dstBuffer5, (short)-1, (short)1) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + proHdlr.copy(dstBuffer5, (short)0, (short)6) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + proHdlr.copy(dstBuffer5, (short)3, (short)3) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + try { + proHdlr.copy(dstBuffer5, (short)0, (short)-1) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : dstLength > length of the simple TLV list + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + try { + proHdlr.copy(dstBuffer10, (short)0, (short)dstBuffer10.length) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successful call, dstBuffer is the whole buffer + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + result = proHdlr.copy(dstBuffer9, (short)0, (short)dstBuffer9.length) ; + + bRes = (result == (short)9) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Compare the buffer + testCaseNb = (byte) 9 ; + bRes = false ; + + // Initialise buffer + compareBuffer[0] = (byte) 0x81 ; + compareBuffer[1] = (byte) 0x03 ; + compareBuffer[2] = (byte) 0x01 ; + compareBuffer[3] = TYPE ; + compareBuffer[4] = QUALIFIER ; + compareBuffer[5] = (byte) 0x82 ; + compareBuffer[6] = (byte) 0x02 ; + compareBuffer[7] = (byte) 0x81 ; + compareBuffer[8] = DST_DEVICE ; + + try { + + result = javacard.framework.Util.arrayCompare(dstBuffer9, (short)0, compareBuffer, (short)0, (short)9) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Successful call, dstBuffer is part of a buffer + testCaseNb = (byte) 10 ; + bRes = false ; + + // Initialise dstBuffer + for (short i=0; i<(short)dstBuffer15.length; i++) { + dstBuffer15[i] = (byte)i ; + } + + try { + + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + result = proHdlr.copy(dstBuffer15, (short)3, (short)9) ; + + bRes = (result == (short)12) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Compare the buffer + testCaseNb = (byte) 11 ; + bRes = false ; + + // Initialise compareBuffer + for (short i=0; i<(short)compareBuffer.length; i++) { + compareBuffer[i] = (byte)i ; + } + + compareBuffer[3] = (byte) 0x81 ; + compareBuffer[4] = (byte) 0x03 ; + compareBuffer[5] = (byte) 0x01 ; + compareBuffer[6] = TYPE ; + compareBuffer[7] = QUALIFIER ; + compareBuffer[8] = (byte) 0x82 ; + compareBuffer[9] = (byte) 0x02 ; + compareBuffer[10] = (byte) 0x81 ; + compareBuffer[11] = DST_DEVICE ; + + try { + + result = javacard.framework.Util.arrayCompare(dstBuffer15, (short)0, compareBuffer, (short)0, (short)15) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successful call, dstBuffer is part of a buffer + testCaseNb = (byte) 12 ; + bRes = false ; + + // Initialise dstBuffer + for (short i=0; i<(short)dstBuffer15.length; i++) { + dstBuffer15[i] = (byte)i ; + } + + try { + + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + result = proHdlr.copy(dstBuffer15, (short)3, (short)6) ; + + bRes = (result == (short)9) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare the buffer + testCaseNb = (byte) 13 ; + bRes = false ; + + // Initialise compareBuffer + for (short i=0; i<(short)compareBuffer.length; i++) { + compareBuffer[i] = (byte)i ; + } + + // Only 6 bytes + compareBuffer[3] = (byte) 0x81 ; + compareBuffer[4] = (byte) 0x03 ; + compareBuffer[5] = (byte) 0x01 ; + compareBuffer[6] = TYPE ; + compareBuffer[7] = QUALIFIER ; + compareBuffer[8] = (byte) 0x82 ; + + try { + + result = javacard.framework.Util.arrayCompare(dstBuffer15, (short)0, compareBuffer, (short)0, (short)15) ; + + bRes = (result == (short)0) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/Test_Api_2_Pah_Copy.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/Test_Api_2_Pah_Copy.java new file mode 100644 index 0000000..ed47085 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/Test_Api_2_Pah_Copy.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Copy.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_copy; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_copy + * + * @version 0.0.1 - 14 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Copy extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_copy"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Copy() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 13 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0DCCCCCC CCCCCCCC CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/applet.opt new file mode 100644 index 0000000..a950a84 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_copy.Api_2_Pah_Copy_1 +uicc.test.toolkit.api_2_pah_copy +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/javacard/api_2_pah_copy.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_copy/javacard/api_2_pah_copy.cap new file mode 100644 index 0000000000000000000000000000000000000000..e4b40b5f515fca9842aa209397bf67260bae36de GIT binary patch literal 4059 zcmb7G4RBP|6+ZXf_q%_2!QICuF(!f}8*F#;Lrr4jCj=rPL}EY*K~2_WfrXTPlPq?U zg0or1ij#y=XvUw>(F`gh<3_|F+O$Ba))Fgft2Hgikm~rulo7N}ovDK7Zi0_}NG5xC zzI)$!_uliJbMD)FPJJ!qogm}S(^>N~xU4yWhq{H!D}P#ZTeYvQ^0u1lh0B(E>#8pd z1H>EZ!m&d4pnS!N_1E;fgl}{}oBlDjfU0m(z9{q0Mn|EK*xBcpLUgMsY;pqim-aRlfQ@ST} z<-uqDnQup4mm9zGobi0ubgS~>UHbd|8EIz=cYoo(VgD1MTmEK$z}r{!-#Z`OAv~~j zx9~*Cw*HT1tI?O8>4OUo1R~#_x#kZ!BY6)UdT;v>*Z1BVZ$3Y;sC3ES7k^g!;%Lz> ze%9W-w(>cTpPNz9v3k`jwz5U9G|daGjX#rjGSXRT|948K3K?ZBb-1NR^Q z`eXgM+ds4(Tk+-x+}R7uYW98Du(RaOq25g`IUnu)?a^cVXDn+v`S63sPZc#+e6s$H zqia6Pu`KWVXJhW>%Dawj8FKw==s$ldAN7B8rstQ3pR01M&wR4JR+4Yuvpang0eFW8 zsK=wTBo2%n-LaFiZ_Y-EVHRRjC=l>Pg6$DsBphzt5Q_NxdZ@X$S@*AN4utg%-+KRj z{(!%2wQo_-zdG3F4fu5enWu&?o+TU)M12aCC?H(K_E0WTCewX6#ciF2D;P=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/api_2_pah_cprv/Api_2_Pah_Cprv_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cprv/Api_2_Pah_Cprv_1.java new file mode 100644 index 0000000..a492ec9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_cprv/Api_2_Pah_Cprv_1.java @@ -0,0 +1,521 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Cprv_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_cprv; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_cprv + * + * @version 0.0.1 - 14 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Cprv_1 extends TestToolkitApplet +{ + private byte TYPE = (byte) 0x21 ; + private byte QUALIFIER = (byte) 0x00 ; + private byte DST_DEVICE = (byte) 0x82 ; + + private byte[] TEXT = new byte[16] ; + private byte[] compareBuffer5 = new byte[5] ; + private byte[] compareBuffer15 = new byte[15] ; + private byte[] compareBuffer20 = new byte[20] ; + + private byte DCS_8_BIT_DATA = (byte) 0x04; + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Cprv_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Cprv_1 thisApplet = new Api_2_Pah_Cprv_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // Result of method + short result = 0 ; + + + // -------------------------------------------- + // Test Case 1 : Null as compareBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + // Select a TLV + proHdlr.findTLV((byte)0x01, (byte)1) ; + + try { + proHdlr.compareValue((short)0, null, (short)0, (short)1) ; + + } catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : compareOffset >= compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)15) ; + + // Select Text String TLV + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.compareValue((short)0, compareBuffer5, (short)6, (short)0) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + proHdlr.compareValue((short)0, compareBuffer5, (short)-1, (short)1) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : compareLength > compareBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + proHdlr.compareValue((short)0, compareBuffer5, (short)0, (short)6) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : compareOffset + compareLength > compareBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + proHdlr.compareValue((short)0, compareBuffer5, (short)3, (short)3) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : compareLength < 0 + + + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + try { + proHdlr.compareValue((short)0, compareBuffer5, (short)3, (short)3) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)5) ; + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.compareValue((short)7, compareBuffer15, (short)0, (short)0) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.compareValue((short)-1, compareBuffer15, (short)0, (short)1) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : compareLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.compareValue((short)0, compareBuffer15, (short)0, (short)7) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + compareLength > Text String length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.compareValue((short)2, compareBuffer15, (short)0, (short)5) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Unavailable element + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + try { + proHdlr.compareValue((short)0, compareBuffer15, (short)0, (short)1) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + + // Initialise Text buffer + for (short i=0; i@cxVi;Pp1f&*5ETIvKr{G-;P>A5e7yZg|P zy*nrOopUDejQqx$`fUCZw4`SpwK#RoQ9FYOt)(s1aKm4BeW zD_D8%y<5-y-Kj=7OpSfshkqup4l*M(n|T$$FJ^gZ{HCVXFW2$bGCQh-htvX zCE3vrPn~#Y=9=w?a%(Ejbsj8uXLH5=Z++r_rsCO_E1xg>?{(?rKy2VCBkSVwuJeC? zac7`#bf1!?#bBJo&c=KRPja$&%JToZVRP*y~ww zt8czKzPPIL$SW83T>Vq_+GG13Jk)-~>g+lqEN@$}Du;WsLVe8@U3cc`jXR1K*A9L# z`O80_{6RjM@yVG3CGTDS`0$FKxE>LMi`U)Am~VX>yvq0^(uHLavaqXW^OK8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q;>@ZZ%V2SDBK^ z{)#fJl;lyGIE#1lvdgcy%}mu}dQIIHymn=KG?d}q=XRO3swZbw?u^{IISX>@av#b~ z4S{%lM%f$aK9f?Ev8N*Q!mW)hO;OBTSp-~g8q+t-mN441o$HV>6~UwlvksO=5eTwW zii04_rYHnivc+4J{=yc z9?Tc=>;&J0V*3}wB!~T&Rx&t<>&j8)u$+CU!Cbss4K-vM`HisQ-aSO;k59*odRnZL zO0KHDmT*~^eUB7?$@K**08`sHm4nQRI(+QDt`>*E7CQgF0{74WcVNl0T zNGV2~5NENGfV_|vBvE=e3C=1bK~QNrZX{|BC&5`aBnZ!@MQ~OTPL4ChPjJ4Er)caC zq3S2`{@-p5Xi^Cg_XTuBS#cqKbA&KF$*^PxK( YZ&F`-^|b<4Rsb&iO~bekvd= dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)15) ; + + // Select Text String TLV + proHdlr.findTLV((byte)0x0D, (byte)1) ; + + try { + proHdlr.copyValue((short)0, dstBuffer5, (short)6, (short)0) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + proHdlr.copyValue((short)0, dstBuffer5, (short)-1, (short)1) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBuffer.length + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + proHdlr.copyValue((short)0, dstBuffer5, (short)0, (short)6) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + proHdlr.copyValue((short)0, dstBuffer5, (short)3, (short)3) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + + + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + try { + proHdlr.copyValue((short)0, dstBuffer5, (short)3, (short)3) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)5) ; + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.copyValue((short)7, dstBuffer15, (short)0, (short)0) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.copyValue((short)-1, dstBuffer15, (short)0, (short)1) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : dstLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.copyValue((short)0, dstBuffer15, (short)0, (short)7) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + dstLength > Text String length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + proHdlr.findTLV(TAG_TEXT_STRING, (byte)1) ; + + try { + proHdlr.copyValue((short)2, dstBuffer15, (short)0, (short)5) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Unavailable element + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + try { + proHdlr.copyValue((short)0, dstBuffer15, (short)0, (short)1) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successfull call + testCaseNb = (byte) 12 ; + bRes = false ; + + // Initialise Text buffer + for (short i=0; io*eJ0zVwy;js+~?vO--?{JWQnjSs)A7itOF_ zIQ#E8=l|~apToJ|ttg|s17!T9G?y%ZF_!~)C||lde{RW&qV)3o6(vPWSFKJfFS>me zAXr)c;EoLa&3%J2nlBct?R)c4Z|l0iZpFStG{U43!dk)s18k7g`Q?Mm$k>|Cy% zKYVy$)f>Lk@BjTTKdZfR-<8Cxb)@t8&S##2roC_7;GSD^^jD8u?(4sh`^DLu#}2e!l2%=heWoiayH@x0 zbDy5MTKeKwQ#y`3dxQ=Q{kmgA&x_yt@yi>heERm{(+{OS*?FjbcIWHq(ZOC%cjG$` zw|{x#e6Hg+X+5v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0_T-bGurgry`FqCy_bWZxA+=0gRqp&taq!qCTsQieY)&KerR znR$pDW=n@JD8OHrK`AUJ8RQkACh=*a^2ajqO9h>$l05O)u>vl?qKt43w3(x?I%ADA zd(|0#-R;GPWl=_U-2XG(;VdVxf|Fl?umv|Wn0|w(^8*mp*enARG9j%$bY+b_yXCopA z8(A}h`S1-h)Zzc=6u3pL=1NUTY+3#-D-}WdgqQ0G@$X M$iTY)&Bmht0d9aB0ssI2 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrb_bs/Api_2_Pah_Facrb_Bs_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrb_bs/Api_2_Pah_Facrb_Bs_1.java new file mode 100644 index 0000000..44c2b62 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrb_bs/Api_2_Pah_Facrb_Bs_1.java @@ -0,0 +1,533 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Facrb_Bs_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_facrb_bs; + +import uicc.test.util.*; +import uicc.toolkit.*; +import javacard.framework.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_facrb_bs + * + * @version 0.0.1 - 15 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Facrb_Bs_1 extends TestToolkitApplet +{ + private byte TYPE = (byte) 0x21 ; + private byte QUALIFIER = (byte) 0x00 ; + private byte DST_DEVICE = (byte) 0x82 ; + + private byte[] TEXT = new byte[16] ; + + private byte[] compareBuffer20 = new byte[20] ; + private byte[] compareBuffer15 = new byte[15] ; + private byte[] compareBuffer17 = new byte[17] ; + + private byte DCS_8_BIT_DATA = (byte) 0x04; + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Facrb_Bs_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Facrb_Bs_1 thisApplet = new Api_2_Pah_Facrb_Bs_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + boolean bRes2 = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // Result of method + short result = 0 ; + + short compareOffset = (short) 0; + + // -------------------------------------------- + // Test Case 1 : Null as compareBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + compareOffset = (short) 0 ; + try { + proHdlr.findAndCompareValue(TAG_COMMAND_DETAILS, null, compareOffset) ; + + } catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : compareOffset > compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)15) ; + + compareOffset = (short)21 ; + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, compareBuffer20, compareOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + compareOffset = (short)-1 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, compareBuffer20, compareOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : length > compareBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + compareOffset = (short) 0 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, compareBuffer15, compareOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : compareOffset + length > compareBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + compareOffset = (short) 5 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, compareBuffer20, compareOffset) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Unavailable element + testCaseNb = (byte) 6 ; + bRes = false ; + bRes2 = false ; + + try { + // Initialise handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short) TEXT.length) ; + + // Select a TLV + proHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + // Search a wrong TLV + compareOffset = (short) 0 ; + try { + proHdlr.findAndCompareValue((byte)0x03, compareBuffer20, compareOffset) ; + + } catch (ToolkitException e) { + bRes2 = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + // Verify there is no selected TLV + try { + proHdlr.getValueLength() ; + } + catch (ToolkitException e) { + bRes = (bRes2) && (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + // Initialise TEXT and compare buffer + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=0; iySw4wgS zFhFvCLo_it@aD5u3VP4GjvZKc^1_+UkISc*zc;k2b=BqvTXxsqyuR^y+nh5cuTR}t z9Uc777tif|bawUGD?5JOeBwFb)4~r&7oD0qc=X1s|GwWH(+~aS)SuseeC++>fA_>o zU(A&LRvEv%;@ty}o!h=(uNpab=HmV*w{`FL9XjGsw-iPS!f)R{&EBzlMa|14ee{8eUqhm41+@b$s;MUDDFytgfngX78`|R7|T%e9!l@dH?vqiKcI_sXje(%V*m{ z-<4{{zt(!nFa2cLRy$;Qp!L}4S*qm|@_==^{lulNeOtvX)b@xyaD02&dslDV{m!+% z=(V1^e1i)ncMo2VthrRXt)sot-!jJ=?E7OA{XIR{uL*&iR^|`Pk!9iL$!0t*tEH-V-m2N26WKJL6@MSm)yM#j(iJ z#T}8h?$*VvJ!Q)x-;cCKx|fvAX^$*v?=EeN#0ZSOFnse85kw$tCmOPXbQ9Z;3lTOO zvik2A8pq-YE>$SGLC)^%Zf}c6yVr130SaI=iVqESfF>UW8yrNFxZ!vci3wVWOe3T4 z0hioY8;-@g+T$FTg73Cf61bYZ&Xr~TAI?G`F1drvT@j0R8(<<-nVotCO$x-a6IClA zCXajYE{r?`lFe!7T>F7ee9VRO%FXw+(Um>%$jW#VZVm1R37sAk(9b9mii`p%1Vuoh zC>9i}pyN$^CIcLyItVC=%92w0*ZuvC&&pGY6)gSo*vF#2CY`d4I|o+8p&TTKtdt5gvGRH4)0w3&)*_(F1d%Xp*_Adx`e}7 zUq*c)H>=HP@mH$$ug*NP@f>zp?(Vc`_V27JPob@8?yldbOQ;n z#0DY2*cSU!G{AhQ!~k=nk^)RcB?l}UEI3ft zDKUX-iaMZ)-`WJ4G%}A2S(218cfSn&AoKIN%$XFwX12^{3*T_Cg%37Zp=If7EGvAl z@(nFBg9k0g^{3X6qyxr6{E{U0Q}7E_2Ckg3Aa9Z4S2n>YdATIUC@qf(eyN{;pH{`R zBBkJQXXew}{l<*dBxO2esieh9Y*dnJil!{AOv;)fhWS;CLNo=LbX~lS*DWu|BVH($ zH92DNn1b=KX2gdXju@fFhcPup__l#o?lC09oJhzTb0ZNe60sr?E77c+$mOKWu;KGm zcr)RJv{_pwzAe+N%`j_2voiH*gx%KgmfFh9C;Hw#+%^LJjR>g!JUFvEgqtIILcSO37c`VroL0z zk@aTcFph&EK+jM#X2c-1lb^wt?`x;4nKZqz0-WR3yeeD?8&thWb)?tgC7PGhy^!OJ z>&u|qoBbzVe)8OFPW%INsmb|IydWNlced4cws#pnNCp4JU$$(V;=#4Uuj4Z=x#P@l z?|3NMhFH;+{6}oX6tUx7QLdsG_(nc;%jNcT27bcydgj zR;suir3}xKBxAFwsg9$J;Q)(k!k4p3sJoad4zFPX8ZFA5n_MY6M8y?!1$}DJXB+`5 zvolw)hJ_sYRe3Y=)Uwbr7HZ6UBoA--Sg4MLvb|EM{ZK!N9^q1rl3N}$yS=BayEBHV zG+^B~OJ04jJgN1%e|a{^TGl#W6L&-g^0@}y7FDbM?4o$^%A zqEiKDDLSSqnE2@w*258G$MZBGR=A33=NNu%BP1Uhr57Q9oghp#jtWQ}yjOYiCeE9M zQq2pARD&?yt%Eu6Ael_|N=pm35GL-Mf)`D+oRRyaeYN)q;ih>+@L^GKt4Pf(e|V9a z-M*@1deG K7>8fDc<+A}Pjl%2 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrbbs_bss/Api_2_Pah_Facrbbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrbbs_bss/Api_2_Pah_Facrbbs_Bss_1.java new file mode 100644 index 0000000..ef0209b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facrbbs_bss/Api_2_Pah_Facrbbs_Bss_1.java @@ -0,0 +1,805 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Facrbbs_Bss_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_facrbbs_bss; + +import javacard.framework.Util; +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_facrbbs_bss + * + * @version 0.0.1 - 17 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Facrbbs_Bss_1 extends TestToolkitApplet +{ + private byte TYPE = (byte) 0x21 ; + private byte QUALIFIER = (byte) 0x00 ; + private byte DST_DEVICE = (byte) 0x82 ; + + private byte[] TEXT = new byte[16] ; + + private byte[] compareBuffer5 = new byte[5] ; + private byte[] compareBuffer15 = new byte[15] ; + private byte[] compareBuffer16 = new byte[16] ; + private byte[] compareBuffer17 = new byte[17] ; + private byte[] compareBuffer20 = new byte[20] ; + private byte[] compareBuffer = new byte[20] ; + + private byte DCS_8_BIT_DATA = (byte) 0x04; + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Facrbbs_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Facrbbs_Bss_1 thisApplet = new Api_2_Pah_Facrbbs_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + boolean bRes2 = false ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // Result of method + short result = 0 ; + + byte occurence = (byte) 0; + short valueOffset = (short) 0 ; + short compareOffset = (short) 0 ; + short compareLength = (short) 0 ; + + // -------------------------------------------- + // Test Case 1 : Null as compareBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + occurence = (byte) 1 ; + valueOffset = (short) 0 ; + compareOffset = (short) 0 ; + compareLength = (short) 1 ; + + try { + proHdlr.findAndCompareValue(TAG_COMMAND_DETAILS, occurence, valueOffset, null, compareOffset, compareLength) ; + + } catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : compareOffset > compareBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)15) ; + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)5 ; + compareLength = (short)1 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : compareOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)-1 ; + compareLength = (short)1 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : compareLength > compareBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)6 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : compareOffset + compareLength > compareBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)3 ; + compareLength = (short)3 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : compareLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)-1 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer5, compareOffset, compareLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset > Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)5) ; + + occurence = (byte)1 ; + valueOffset = (short)6 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + occurence = (byte)1 ; + valueOffset = (short)-1 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : compareLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)7 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + compareLength > Text String Length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + occurence = (byte)1 ; + valueOffset = (short)2 ; + compareOffset = (short)0 ; + compareLength = (short)5 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Invalid parameter + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + occurence = (byte)0 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.BAD_INPUT_PARAMETER) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Unavailable Element + testCaseNb = (byte) 12 ; + bRes = false ; + bRes2 = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)5) ; + + // Select a TLV + proHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + occurence = (byte)2 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)1 ; + + // FindAndCompareValue + try { + proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer15, compareOffset, compareLength) ; + + } catch (ToolkitException e) { + bRes2 = (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + // Verify there is no selected TLV + try { + proHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (bRes2) && (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Successful call + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=0; i<(short)TEXT.length; i++) { + TEXT[i] = (byte)i ; + compareBuffer17[(short)(i+1)] = (byte)i ; + } + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)16) ; + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)17 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer17, compareOffset, compareLength) ; + + bRes = (result == (short)00) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Verify current TLV + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + result = proHdlr.getValueLength() ; + + bRes = (result == (short)17) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Successful call + testCaseNb = (byte) 15; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=0; i<(short)TEXT.length; i++) { + compareBuffer17[(short)(i+1)] = (byte)i ; + } + compareBuffer17[16] = 0x10 ; + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)17 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer17, compareOffset, compareLength) ; + + bRes = (result == (short)-1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Successful call + testCaseNb = (byte) 16; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=0; i<(short)TEXT.length; i++) { + compareBuffer17[(short)(i+1)] = (byte)i ; + } + compareBuffer17[0] = 0x03 ; + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)17 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer17, compareOffset, compareLength) ; + + bRes = (result == (short)+1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Successful call + testCaseNb = (byte) 17; + bRes = false ; + + try { + + // Initialise buffers + Util.arrayFillNonAtomic(compareBuffer20,(short)0,(short)compareBuffer20.length,(byte)0x55); + for (short i=(short)3; i<(short)15; i++) { + compareBuffer20[i] = (byte)(i-2) ; + } + + occurence = (byte)1 ; + valueOffset = (short)2 ; + compareOffset = (short)3 ; + compareLength = (short)12 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer20, compareOffset, compareLength) ; + + bRes = (result == (short)0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : Successful call + testCaseNb = (byte) 18; + bRes = false ; + + try { + + // Initialise buffers + Util.arrayFillNonAtomic(compareBuffer20,(short)0,(short)compareBuffer20.length,(byte)0x55); + for (short i=(short)3; i<(short)15; i++) { + compareBuffer20[i] = (byte)(i-2) ; + } + compareBuffer20[3] = (byte)0x02 ; + compareBuffer20[4] = (byte)0x01 ; + + occurence = (byte)1 ; + valueOffset = (short)2 ; + compareOffset = (short)3 ; + compareLength = (short)12 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer20, compareOffset, compareLength) ; + + bRes = (result == (short)-1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 19 : Successful call + testCaseNb = (byte) 19; + bRes = false ; + + try { + + // Initialise buffers + Util.arrayFillNonAtomic(compareBuffer20,(short)0,(short)compareBuffer20.length,(byte)0x55); + for (short i=(short)3; i<(short)15; i++) { + compareBuffer20[i] = (byte)(i-2) ; + } + compareBuffer20[13] = (byte)0x0A ; + compareBuffer20[14] = (byte)0x0D ; + + occurence = (byte)1 ; + valueOffset = (short)2 ; + compareOffset = (short)3 ; + compareLength = (short)12 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer20, compareOffset, compareLength) ; + + bRes = (result == (short)+1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 20 : Successful call + testCaseNb = (byte)20 ; + bRes = false ; + + try { + + // Append a 2nd Text String TLV + TEXT[0] = (byte)0x00 ; + TEXT[1] = (byte)0x11 ; + TEXT[2] = (byte)0x22 ; + TEXT[3] = (byte)0x33 ; + TEXT[4] = (byte)0x44 ; + TEXT[5] = (byte)0x55 ; + + proHdlr.appendTLV(TAG_TEXT_STRING, TEXT, (short)0, (short)6) ; + + // Initialise buffers + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=0; i<(short)TEXT.length; i++) { + compareBuffer17[(short)(i+1)] = (byte)i ; + } + + occurence = (byte)1 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)17 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer17, compareOffset, compareLength) ; + + bRes = (result == (short)0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 21 : Successful call + testCaseNb = (byte)21 ; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer[0] = (byte)0x00 ; + compareBuffer[1] = (byte)0x11 ; + compareBuffer[2] = (byte)0x22 ; + compareBuffer[3] = (byte)0x33 ; + compareBuffer[4] = (byte)0x44 ; + compareBuffer[5] = (byte)0x55 ; + + occurence = (byte)2 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)6 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer, compareOffset, compareLength) ; + + bRes = (result == (short)0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 22 : Successful call + testCaseNb = (byte)22 ; + bRes = false ; + + try { + + // Initialise buffers + compareBuffer[0] = (byte)0x00 ; + compareBuffer[1] = (byte)0x11 ; + compareBuffer[2] = (byte)0x22 ; + compareBuffer[3] = (byte)0x33 ; + compareBuffer[4] = (byte)0x44 ; + compareBuffer[5] = (byte)0x66 ; + + occurence = (byte)2 ; + valueOffset = (short)0 ; + compareOffset = (short)0 ; + compareLength = (short)6 ; + + result = proHdlr.findAndCompareValue(TAG_TEXT_STRING, occurence, valueOffset, compareBuffer, compareOffset, compareLength) ; + + bRes = (result == (short)-1) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 23 : Successful call : search tag 8Dh + testCaseNb = (byte) 23 ; + bRes = false ; + + // Initialise TEXT and compare buffer + compareBuffer17[0] = DCS_8_BIT_DATA ; + for (short i=0; ih(T2g>Ixq#uP)83Dy%LqU9hBXMpfy( z69@%rt32H^Er(vancQ_D>ezw5?RanC?9rz7#_v5>{_0;6VwWxNyLUJC3ZGJV@Y+W; zw|?`=#VhWU4aRTo{)FFFF)fQdUwGj6+jg`h9l1E;?it^n&3S)r-`jt98I%2F{_g)& ztb5Xyd;37s@?W$ab1dskX>R`KGsS5i`cnPtcOOYxdt%;ydsyG>CHEFNhPqZ-xx0(L z?cG-qvps7~#rwVbIg!Ed)r6vyZJXwa$Cu>f&=P zmy=(K9@UHo9ETRfO9jG`n z=lQhWKg>CL_1V7LZT`XfQ|YYzsb6v*fAQnN6}4wy*F9Bx{7ymjTe0tc@}tkTwmx$G zc*TpJ9pBhwP1zcPF4EGnxQ*f zO(icZ?4LcfmO|(fgHR3lP*OcdeE8voxp|4uBghAIwz%Dy{-zFprr+afYi;poy1Xs* z+4WvmbNxz}+t<+0QQy$fk-5sX+U0in8Z*n9T#Ze>8E%)CLJ1d7-2Xd8Gl-IRfh-ZR z_n~|z1(-uwyUdL_Q{f4Md4Nf?mbCbq+fS{pjr_RRhvGD?Do_{v}KdVDG$gYvc3y$Moj zir)oQ14U^}KLxI$k(-DLRqK6E!l6#MO;AYc$-2JS)865Cwfk!zQiw5Fu)d8(hzAG& z5r6;`fCgXy17HChKmzD#1s;IsI7DS(1H2k%^uL$V0KTpybj;&|U#p4gEUBPOpXb z_W^H1e~aRve+}(F0&YP66x_d!OxO&_K(Sa->^KM7ZonF3#tW4a+z0KS1CBs{my(0e zK^r(3J@h|Q9%oXZJs+?XnVDHi4$}hd9>7lMzYP7o(7uLD;7&6eg9J7at{+!cv9sV> zsnWpy6zcaB6MGiw%StVmhfG|RQp3Fo^Z{6P(TPmrYQ-t;gZj9VC&7EtEG0v7!B}O>CS?tA{(K{TVxYd!f+*8_#O#f)^)L2n~`DeCKNTpYDr`YEs4{6QM9!e z$=3CHx}Qcp%u|vQP5j!Nt!QiY|b`T9xgLFTGEOE@}UB)5B zvW%HG3zS(jOZ_~u=<>aSUB_g3X;NdTEoLUE7saz9VyHnWfUz9i&ml|vuq44Ds*+>_ z5fxw_DvKkshTo+p`z{}R7se-ZWC&ps3&EE;hd8-+foe=^V5TQUEURjR7lzFzj9L$b z5;u)EA3M%`Cc7?H*NYNlp_OI4n7BjZ7I}0?^#3bJ3>h9M95n1CRgy*|v8qZ!Xh$?9kIBYS6KNid4%ILE0eW2z@G_L#vDM=%)S)M! zk;9_FTv#N`1SCe4M8E-ItGu)iS@SutcyvG@7H5k`EG&F>Z2*uc!mt=p==Y`Ehc5TbdSPOig3 zG;7Ns=Y$L#WlzUZF={J@w`HiI@c3F&IvI#R*&>gzZ$6DQ6zuvXN;3*i)Q5u;}W z{nW&GQ*!(x@zYe8QgjK^bP3bdGc?R%icXG-ccxhNiIui;n=#jFEV3C(ZL{ZF%dBO# zxhYmtinYiVYRt9n4W~W@BNEJy#F!;b9d2KX7q-*HmO69^c9F1KgFwLR=xzb_Jg`wi z$Vv8b6mpWS9F3f0H;0jvZ0H!|Bzrm*Imxz;Lr$^-UjohMBcl2G{)mnLBnl6U dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)15) ; + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, dstBuffer20, (short)21) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, dstBuffer20, (short)-1) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : length > dstBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, dstBuffer15, (short)0) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + length > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, dstBuffer20, (short)5) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Unavailable element + testCaseNb = (byte) 6 ; + bRes = false ; + bRes2 = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short) TEXT.length) ; + + // Select a TLV + proHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + try { + proHdlr.findAndCopyValue((byte)0x03, dstBuffer20, (short)0) ; + + } catch (ToolkitException e) { + bRes2 = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + // Verify there is no current TLV + try { + proHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (bRes2) && (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + // Initialise TEXT + for (short i=0; i?F z{e2%mVt!4uz1Vy7m;J+A&pVGFY&&tWtMORrq#vH>-uKX&?Y1}TUL9!LR3nc5;)TTp zm3t1Iy7BYsg`*$ZsCu_1Lj#?{-~(ZquQ;HJ7%0>5adn z?0u(V>C1nre))GxtDGf07v|VL+B0(NH?K7-^XeDB@g%!ZeCEZzt6i@gyRz>2kGH&9 z_(@OhyzskuMc@UR@LJiMqZv^?>v`}E62j|Se`?ykRbZTY#; zU%QT8J(cL1vUf>j`l;C;_kKO@T3>9!fv&M@*kc>SkKk_;j&G>^?!EjI|I|mE`OSj( z$+LY2dfN{4?s|LbJCCk-_(tV-|Hyry?A$<|ySiX&^ZS*%7Cv>^z36rC+MRD6`Sa&T zH}tf8vj4N*HD7&JeC^8Le^E4l(aP1&_j@*OVsl6Jv|Q+@I(Di5#E+kBTd<|{%*3Nm zTP4Z6C+?o}6ahHT0AtE*M%#D;|8RclgM}Dz3!**I*w7G&hg;%-cr+SW)ff+iVvY5s z^|8>3`o}{J>zCFqZ3(OltqnDVnwJIUhC|E3%@Z0zF#-h_`v$%w0t2G%#Y9#R2XJf| zfv}m7(X)l??!zm%O-9QOa%N+5xFH^GUe8el7!Cz!ZcMZiG;tr;U_YijjfR5}6ZGNY zDK8Dd32xc1c1A1~3CB4u1@~>MByc@*olSwxbJGxrTlQcTt7Fk-1B}6Bb5Z*-r9h;; z=#~;OcXcC{~$Hnqe}Y~knHtw5fZ&;&FQV+UB;o#;itYpk^0K`a|pQzuXQ z551O;*|<$Y%W@%+P)iG6fd#a39qb_5kQy1bQGj-t*xDr%+S>=8xc+MqfLr#htO>_g zM3-?mN!&MtOa(isgd9?=k0A3Qm&CzIo`F2FOdm_OVY~+%B!TfB-9vgY{t)A{7=MWI zMU49~9>BO?_XrZ?3X?z)W`SFH80)+Q{V;u@uolnn)&0UB(SNUNRD)bPUH8*f=nr7r zhyH>-iQ#!RSJ&7Q^jmd5JBa=ZUBhMOihjLFtV7?1@e7zo^=<=~R~@+-ymT}1s_mNv zuc~(0pQB#YjgEO$7dp|a=Ag4APfA{Cvy9hUTg8$cV4u1TlnFz}Q39TB~ zv=rBxR+aaIl3K{%)CTn^oD=!@NSz}6qX;$?o!9`Z0 zSrcq$w&z7FlmP~5Hq>^UiNo_>4aaLCol8B@&KD$BMuGuY|w4G>n zH81iX&Y4lweH&*bJ-t2I?AscM#iLa06hU(tkKtV^nUPE3xo%ccF-R$zVpLKg8uGta zB^~Lk9LYsHj7~c=2QJG&G^BKwPH(?kr=96po$36X20y3fH267*=DasQS9&H_lAp`q z=h9rr&qXxXAU|~n){g%d2CKItgPodcw3?n%P3BZFr=+QxiaAxHshm~+;Pa>6*2|o< z46T`a=Bg8)9&+Fo!)+SgknK(`h7mXAW%=8Lqezcsq7Nzc*O_;ib&-=%I6iw z;7rD44l7jx4v_*X$~z9rbfz#_(QNr{N4{ztUaMkPo%!RH!s3E)O5v;m&B1>f@%>6+ zQ9))6o~_6`cNW*rZ3}iF;2pH-6gI*U6j5A80kOh$ zD1(vww~dftP|Kb%RAvD@U>rfz4atMY4-O3AeP#S^E|QZ2%JJ+RsDx@#Ox_Y#jOZdN z>nXt>wX{?vWtN_va$!bo6%pJhcyE4zrAvGM1(rGP_C3b4*ajcPJADSEvb>KK%&rTm zj{-A_S^1|>CSrlJL&^9KFaw!&ehTQfSp%h1zZu0W@KY$mXtv8q$$c}5S+b{4-pU%q zEa1&pW>uZST8~dwb`2`Osj)vbIXZFEhY*r5zSxA9TLm!T$j+epQ+P literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facybbs_bss/Api_2_Pah_Facybbs_Bss_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facybbs_bss/Api_2_Pah_Facybbs_Bss_1.java new file mode 100644 index 0000000..acdd3e5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_facybbs_bss/Api_2_Pah_Facybbs_Bss_1.java @@ -0,0 +1,660 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Facybbs_Bss.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_facybbs_bss; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_facybbs_bss + * + * @version 0.0.1 - 15 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Facybbs_Bss_1 extends TestToolkitApplet +{ + private byte TYPE = (byte) 0x21 ; + private byte QUALIFIER = (byte) 0x00 ; + private byte DST_DEVICE = (byte) 0x82 ; + + private byte[] TEXT = new byte[16] ; + + private byte[] dstBuffer5 = new byte[5]; + private byte[] dstBuffer20 = new byte[20] ; + private byte[] dstBuffer15 = new byte[15] ; + private byte[] dstBuffer17 = new byte[17] ; + + private byte[] compareBuffer = new byte[20] ; + + private byte DCS_8_BIT_DATA = (byte) 0x04; + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Facybbs_Bss_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Facybbs_Bss_1 thisApplet = new Api_2_Pah_Facybbs_Bss_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes, bRes2 ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // Result of method + short result = 0 ; + + byte occurence = (byte) 0; + short valueOffset = (short) 0 ; + short dstOffset = (short) 0 ; + short dstLength = (short) 0 ; + + // -------------------------------------------- + // Test Case 1 : Null as dstBuffer + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + occurence = (byte) 1 ; + valueOffset = (short) 0 ; + dstOffset = (short) 0 ; + dstLength = (short) 1 ; + + try { + proHdlr.findAndCopyValue(TAG_COMMAND_DETAILS, occurence, valueOffset, null, dstOffset, dstLength) ; + + } catch (NullPointerException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : dstOffset > dstBuffer.length + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)15) ; + + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)6 ; + dstLength = (short)0 ; + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, occurence, valueOffset, dstBuffer5, dstOffset, dstLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : dstOffset < 0 + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + occurence = (byte)1 ; + valueOffset = (short)0 ; + dstOffset = (short)-1 ; + dstLength = (short)1 ; + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, occurence, valueOffset, dstBuffer5, dstOffset, dstLength) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : dstLength > dstBufferLength + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)0, dstBuffer5, (short)0, (short)6) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : dstOffset + dstLength > dstBuffer.length + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)0, dstBuffer5, (short)3, (short)3) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : dstLength < 0 + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)0, dstBuffer5, (short)0, (short)-1) ; + + } catch (ArrayIndexOutOfBoundsException e) { + bRes = true ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : valueOffset >= Text String Length + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)5) ; + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)7, dstBuffer15, (short)0, (short)0) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : valueOffset < 0 + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)-1, dstBuffer15, (short)0, (short)1) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : dstLength > Text String length + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)0, dstBuffer15, (short)0, (short)7) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : valueOffset + dstLength > Text String Length + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)2, dstBuffer15, (short)0, (short)5) ; + + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Unavailable Element + testCaseNb = (byte) 11 ; + bRes = false ; + bRes2 = false ; + + try { + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short) TEXT.length) ; + + // Select a TLV + proHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)1) ; + + try { + proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)2, (short)0, dstBuffer15, (short)0, (short)1) ; + + } catch (ToolkitException e) { + bRes2 = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + // Verify there is no current TLV + try { + proHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (bRes2) && (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Successful call + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + + // Initialise buffer + for (short i=0; i<(short)TEXT.length; i++) { + TEXT[i] = (byte)i ; + } + + // Initialise the handler + proHdlr.initDisplayText(QUALIFIER, DCS_8_BIT_DATA, TEXT, (short)0, (short)16) ; + + result = proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)0, dstBuffer17, (short)0, (short)17) ; + + bRes = (result == (short)17) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Compare buffer + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + + // Initialise compare buffer + compareBuffer[0] = DCS_8_BIT_DATA ; + for (short i=0; i<(short)16; i++) { + compareBuffer[(short)(i+1)] = (byte)i ; + } + + result = javacard.framework.Util.arrayCompare(compareBuffer, (short)0, dstBuffer17, (short)0, (short)17) ; + + bRes = (result == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 14 : Successful call + testCaseNb = (byte) 14 ; + bRes = false ; + + try { + + for (short i=0; i<(short)20; i++) { + dstBuffer20[i] = (byte)0x55 ; + } + + result = proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)2, dstBuffer20, (short)3, (short)12) ; + + bRes = (result == (short)15) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 15 : Compare buffer + testCaseNb = (byte) 15 ; + bRes = false ; + + try { + + // Initialise compare buffer + for (short i=0; i<(short)20; i++) { + compareBuffer[i] = (byte)0x55 ; + } + for (short i=3; i<(short)15; i++) { + compareBuffer[i] = (byte)(i-2) ; + } + + result = javacard.framework.Util.arrayCompare(compareBuffer, (short)0, dstBuffer20, (short)0, (short)20) ; + + bRes = (result == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 16 : Successful call with 2 Text String TLV + testCaseNb = (byte) 16 ; + bRes = false ; + + try { + + // Append a Text String TLV + TEXT[0] = (byte) 0x00 ; + TEXT[1] = (byte) 0x11 ; + TEXT[2] = (byte) 0x22 ; + TEXT[3] = (byte) 0x33 ; + TEXT[4] = (byte) 0x44 ; + TEXT[5] = (byte) 0x55 ; + + proHdlr.appendTLV(TAG_TEXT_STRING, TEXT, (short)0, (short)6) ; + + result = proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)1, (short)0, dstBuffer17, (short)0, (short)17) ; + + bRes = (result == (short)17) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 17 : Compare buffer + testCaseNb = (byte) 17 ; + bRes = false ; + + try { + + // Initialise compare buffer + compareBuffer[0] = DCS_8_BIT_DATA ; + for (short i=0; i<(short)16; i++) { + compareBuffer[(short)(i+1)] = (byte)i ; + } + + result = javacard.framework.Util.arrayCompare(compareBuffer, (short)0, dstBuffer17, (short)0, (short)17) ; + + bRes = (result == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 18 : Successful call with 2 Text String TLV + testCaseNb = (byte) 18 ; + bRes = false ; + + try { + + result = proHdlr.findAndCopyValue(TAG_TEXT_STRING, (byte)2, (short)0, dstBuffer17, (short)0, (short)6) ; + + bRes = (result == (short)6) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 19 : Compare buffer + testCaseNb = (byte) 19 ; + bRes = false ; + + try { + + compareBuffer[0] = (byte) 0x00 ; + compareBuffer[1] = (byte) 0x11 ; + compareBuffer[2] = (byte) 0x22 ; + compareBuffer[3] = (byte) 0x33 ; + compareBuffer[4] = (byte) 0x44 ; + compareBuffer[5] = (byte) 0x55 ; + + result = javacard.framework.Util.arrayCompare(compareBuffer, (short)0, dstBuffer17, (short)0, (short)6) ; + + bRes = (result == 0) ; + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + + // -------------------------------------------- + // Test Case 20 : Successful call, tag = 8Dh + testCaseNb = (byte) 20 ; + bRes = false ; + + // Initialise TEXT + for (short i=0; i<0iZNve`6EfKs#MJ4VO{*u(@%8lVdXDg~QtmP8^+c1ad0 z5uHaw4PX)qIK+Z8sI`=_8?XjJ1`r3-!nBs6q?QjI5K4_~!7Mq9-_C}!9Zhvv?#D$T5zH!FK?>AZ?rGw-j;nmg6s&b!it6w3^_~E32 zrS*IM^xQicJ6}tD+Ii^sUB=T-P1rc~cP+v0>ZXVLxg7;lx1ai==cUWnANkeU%B}ZI z>x=KIJEX*Iw|}rP-Ta2HfXI*kVPnBTsbKcO#UE(?2E6@?*HY=Uq5@P{7PZx8Se0tu3cHjnl=`1>s$A?TX(6cUwL-_ z)4q4>yPw|pWL57wkLDdZz4sr_vfEyHggN)$-Muv}FQh;8`z!IE;=@G=8nwvL7@oW^qbM0TO2t5{8hpO&U|nl4JLvZ}u4o8mdjk#C zdDQ{$^6Gl8Z%u7&YjtgFYxcw5)n1>sWm)#@I`6W&mMot)z#!L0rw0DbupDB@E|6tF z`~Zv%sen8j^?b=5>qOW=>0Y2Qqn0Ny#NG* zV|3^p(<*xsV1d%OY%UE18tZ}-8YBBRY-Jemd906{v%AhyD=Cc&uc9g7Z_)5LRIK;z zO_0hm;x3qK8Aj*&c({uqi-;Mn*7e;}6t#WNRy_NjL>SCNgiBRe|<66}^*$mRj>0lprnTuoz} zfmcx+yA^m^5Mxk#lo6*TMIqUZ$7r;!r{YH@M2VjSikuL`7m0 zgJSFwQG%g3Af?G%Zh)mThS{lb-`|9sd_)Y>YY1UXtX%?1NDNCNf(GQ^iJ8g@ao;IS zpu)n3S+_w`W7KEGup-3F;Sh(3FrwB{>}Fx)yq!m0Dz|@~QzmlkmEF9!Uf6x%4u7HU+`jf_?lRQ95qdzFqgE$Ye zDQtEKZ;2Srb6prEu*K8`JdQEM7V&@(c0gW$b?{vbO2EYdB~4DLF>C&btbU7oOd6zH z4wyq&krjDK!D5+FWI%4bIiv?6QUBwRh)JAglUq;(5;y4i;rUF=RB%Yby@mn|;;kV` zk-5?#074o+hgD5jCvs6y-be^_f-Hj?nnJuHlZ9agiM{blEg$$0FA!5yAL||Tu|~y! zCb41!w@Fjaq?q_Ju;0WeCSnb%$75n2Sv{iJi7_q+VUEPXl_wM7Dv-P3Dw1-zN&rWd zrN3;Ui$@7oP4&^bGVcH7%6KX$l0p#0@b6WN;!uL*C!$=Uj!y1xk{*h?@Sz_fTgymX5uB2EL3&^!FiiK)+Gol&! zhWD(o5}Z^5M6Vk(0Iv*U!j_~otHVkkgO(Knyjx%!JOxS2*|y=;-ikkec)$!*5v3BK zF;_?T2fe`t->inZMy+CzpvWE?!=cVp{k*>))+m(#jTve|UHu%t58(XGv^X+AHD5cB z&+(!l!r-`MH_Mi>Y|8Yk%uM)73JZ&-u`G5jG>gDxV9ACvm0X7nr||*|WB689hQlPHa12s1eoCmAOuC)!gJCneewZ9sM+yX>;dpV2z`BJY^kS` zq1ExwKM}G0E&V5A__)*m5>$#YlE&ZG3rD4#09TGVi=&;f9!TH*MuCdJ%VP!_)(q>h z^v!M*>)?2>qOGqUNZ;i~fzt3ejEeTWdLVt@8U=cDJV5#`Ru89dE2D7TkZ5BLR@q>a zsmIZGlTjS_O^zKW+FR;@^lySFPzYWQV>U?lUeKfIUj|V$r)3;yx>ti9P5&5;qRp|6 Y18w+2)lAE&u=k literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/Api_2_Pah_Find_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/Api_2_Pah_Find_1.java new file mode 100644 index 0000000..4831530 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/Api_2_Pah_Find_1.java @@ -0,0 +1,325 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Find_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_find; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_find + * + * @version 0.0.1 - 14 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Find_1 extends TestToolkitApplet +{ + private static final byte TYPE = (byte) 0x21 ; + private static final byte QUALIFIER = (byte) 0x00 ; + private static final byte DST_DEVICE = (byte) 0x82 ; + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Find_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Find_1 thisApplet = new Api_2_Pah_Find_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // Result of method + short result = 0 ; + + // -------------------------------------------- + // Test Case 1 : invalid input parameter (occurrence = 0) + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + try { + proHdlr.findTLV((byte)0x01, (byte) 0x00) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.BAD_INPUT_PARAMETER) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Search 1st TLV + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + result = proHdlr.findTLV((byte)0x01, (byte) 0x01) ; + + bRes = (result == TLV_FOUND_CR_SET) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Verify selected TLV + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + result = proHdlr.getValueLength() ; + + bRes = (result == (short)0x03) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Search 2nd TLV + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + result = proHdlr.findTLV((byte)0x02, (byte) 0x01) ; + + bRes = (result == TLV_FOUND_CR_SET) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 5 : Verify selected TLV + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + result = proHdlr.getValueLength() ; + + bRes = (result == (short)0x02) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Search a wrong tag + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + // Select a correct TLV + proHdlr.findTLV(TAG_DEVICE_IDENTITIES, (byte)0x01) ; + + result = proHdlr.findTLV((byte)0x03, (byte) 0x01) ; + + bRes = (result == TLV_NOT_FOUND) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Verify the current TLV is no longer defined + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + try { + result = proHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Search a tag with a wrong occurence + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + result = proHdlr.findTLV((byte)0x01, (byte) 0x02) ; + + bRes = (result == TLV_NOT_FOUND) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 9 : Verify the current TLV is no longer defined + testCaseNb = (byte) 9 ; + bRes = false ; + + try { + + try { + result = proHdlr.getValueLength() ; + } catch (ToolkitException e) { + bRes = (e.getReason()==ToolkitException.UNAVAILABLE_ELEMENT) ; + } + + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 10 : Search a TLV with occurence=2 + testCaseNb = (byte) 10 ; + bRes = false ; + + try { + + // Append Tag 0x02 + proHdlr.appendTLV((byte)0x02, (byte)0x00) ; + + // Search the tag + result = proHdlr.findTLV((byte)0x02, (byte) 0x02) ; + + bRes = (result == TLV_FOUND_CR_NOT_SET) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 11 : Search a TLV + testCaseNb = (byte) 11 ; + bRes = false ; + + try { + + // Append Tag 0x04 + proHdlr.appendTLV((byte)0x04, (byte)0x00) ; + + // Search the tag + result = proHdlr.findTLV((byte)0x04, (byte) 0x01) ; + + bRes = (result == TLV_FOUND_CR_NOT_SET) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 12 : Search tag 81h + + testCaseNb = (byte) 12 ; + bRes = false ; + + try { + + // Search the tag + result = proHdlr.findTLV((byte)0x81, (byte) 0x01) ; + + bRes = (result == TLV_FOUND_CR_SET) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 13 : Search tag 84h + + testCaseNb = (byte) 13 ; + bRes = false ; + + try { + + // Search the tag + result = proHdlr.findTLV((byte)0x84, (byte) 0x01) ; + + bRes = (result == TLV_FOUND_CR_NOT_SET) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/Test_Api_2_Pah_Find.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/Test_Api_2_Pah_Find.java new file mode 100644 index 0000000..0faa42e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/Test_Api_2_Pah_Find.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Find.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_find; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_find + * + * @version 0.0.1 - 14 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Find extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_find"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Find() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 13 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "0DCCCCCC CCCCCCCC CCCCCCCC CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/applet.opt new file mode 100644 index 0000000..e3f5ead --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_find.Api_2_Pah_Find_1 +uicc.test.toolkit.api_2_pah_find +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/javacard/api_2_pah_find.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_find/javacard/api_2_pah_find.cap new file mode 100644 index 0000000000000000000000000000000000000000..076ea7c71e039c6280a874acbe9a442945ecf596 GIT binary patch literal 3590 zcmb7G3rtgI6h8OWcd;35trSq4JU6H?9}`4mD6#TbC#b|lU4<$IqzzOSFfo?`3ge}s zb8~J!=ZgqB-G(s&YD`pu!sljmk+Mx`Y`y997#L7L4uS=Zile|%Z5 z&-w4xb@%D6R$2;kK3i&}&QFavx}g5qfM&X8}XZ$xlKF51J4XBeXw`cO;Dbx??~^=tc>aY_~fl-|2AXpZ`;>fXCBua_$c!1(Y+7z z1Get(sxk$9TEo)g){a@RY0mx!7p5s-&X~C`hu(24fueUOHtor1S+uG7(U;ASid#ZAq}2B>o7cXiU7P!4=X|Fz#dtZ( zsK3kl-#)zM?B#EQ7cc4Ew&8JK^!stst~4;+JqhZA5yy|se(G%7Jg`sm>#0A_&A4fP z+F!S}<4}?&&u^zGMJ$=0cqeKN0nkGOm~iW4t_|b1?qY9zYyf_7n1Wbi&CWJBEX59k z!)7bUw>k`FyLEZYa=STq`ATbHjv>!nV$L=f@V=b~|J8VUz93u(i!4IK^IEV!;B?1{Fpt=$S zHkuI7%D>HM8;czryz?^AZZEJnI8F-GFL_5mox6X9hKB32kc5MGM8?&2Tak;1hB)Cu z-bZyLA>M^z1wjZ_`3?LRhC6|9x98rvDb?}V%^?=y`FbbW3X2`)LWc>D0p~u0^LbFLgKS>M#B2<4^;KcMx6}RbVbI z=ByEcHVL^0LB^TVT26vfLdcwA!M>mVJ>FMJ;ekYWw;gE~N3Jc0qY_gh6?EYN`x&EM z2O9x*@q7=kK|~-(i73{WNJ5#xYKT0PW%%8Qau*v&bfUb1=miOJh4m-yfs_PRO=?kw zB4R*7hO++TTzp@|29hNxH=sO#vW?Y}Jt%LY{1>H4R|g^;RSjiKbR&@QbwEYwbpdpu zE+DuTXnid(`U-+AX`X=o9z);#Q%n}w<&_F)t4zQc>~+)}|BsD`Ydndgp=u2uS? zv9H%E8(IR_R;V;I!>fOVn{w9#@yG-*@8v5dC|na%<@~_WcTA-m8d%8>99?6X`z6lr zzV^Km?;eL4UR~l0huLAxPPSSKT=z?YSL=Cm=O}3WBkMiv683b{Kh z#q2`NQM47m_g_~8SAFkx^I$Aus!aj6%-!V!^RASN@p6E+em`b0Fon26a_jEYP&r4XbV z)8|M9_hNy-RdDX@RrMUFMK-*BqZJdpmQ(1D=ZnOb7D5JL{lGIsU~cl9!L6DQk_f8> zo@BRIBz)~4WDu4KJcA4~mFI5oMT3w*nD}{y?Orhm%K#ydFqiW@20TTcdy+Jg*@Xnc z6wVWT?iB%_(1i@bNX9cf#M|h(3xc>Nq!9))o+eA;4UHhQ32B6(iKlts6^(nKGNmwB Q?*Yj1nT+e+>554I1Jy% 0x81) && (sCapacity <= 0x102)) + { + proHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 3)); + } + else if (sCapacity > 0x102) + { + proHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 4)); + } + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + // clear the handler + testCaseNb = (byte)0x03; + bRes = false; + try { + proHdlr.clear(); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + + // Fill the handler with the maximum capacity + 1 + testCaseNb = (byte)0x04; + bRes = false; + try { + if (sCapacity <= 0x81) + { + proHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 1)); + } + else if ((sCapacity > 0x81) && (sCapacity <= 0x102)) + { + proHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 2)); + } + else if (sCapacity > 0x102) + { + proHdlr.appendTLV((byte)0xAA, Buffer, (short)0x00, (short)(sCapacity - 3)); + } + bRes = false; + } + catch (ToolkitException e) { + if(e.getReason()==ToolkitException.HANDLER_OVERFLOW) + bRes = true ; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes) ; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/Test_Api_2_Pah_Gcap.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/Test_Api_2_Pah_Gcap.java new file mode 100644 index 0000000..68bd2ed --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/Test_Api_2_Pah_Gcap.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Gcap.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_gcap; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_gcap + * + * @version 0.0.1 - 20 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Gcap extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_gcap"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Gcap() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 4 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "04CCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/applet.opt new file mode 100644 index 0000000..1f6c2f3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_gcap.Api_2_Pah_Gcap_1 +uicc.test.toolkit.api_2_pah_gcap +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/javacard/api_2_pah_gcap.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gcap/javacard/api_2_pah_gcap.cap new file mode 100644 index 0000000000000000000000000000000000000000..aadf0f23bb2e2c4c59e2babb9ce5675d834103c7 GIT binary patch literal 3267 zcmb7`3rv$&6oAkDAAM7c7AUX|Fro-TE#Oe_0TjA*SXNPoE;>?66$EKl3UN5HQZ=%G z^|3g0TbT1fCYub5jw~{x5~DNmG1SedanUUkmpO4W*``r;F2YLx&4u2-=l}nE?(O}~ zxsP*xO99KNL4udA&NK~16g6;Q&R>v|Y$`PB%sGW7WB&XFDQ4r7GXMvQ%nt8V&Cz%J zW9qIePlnf=yP>(b-d2Xag;WBuHoZOw_{Jx5mE-?QSTD&*M0j+c+Gd$H)pYfC!q%I@@o?dG2JmOEQRJ8sRp zH1FYI-`HjP+iixl=dW6g-}fxeOS`ywZ-s1WqOC7EElw``$XK0eQyESjnFOm6#+R*K zd8)tv@}#;s9j3AM`?Xzs;{HwB7cbq?zO!}Ph3(7E+9pcN7A%Z(y*2$OdF_MKUpON> zwmUmLz2{ylFnhi-++0pxZ@V)0^O(;Lo|yCJnc1%{Ik>~q`MbLL=Zbr-OG!PGbh3(*uDE0MUh&?hhAdg@F=Jn==^K6Vr>8GJJa_rwjPLgJ>@(J!pHPxqB0u!#mH6Ye z1*XD9cVGB6`jM)5pStk9oB zr^jC(Q}W>(_cCfe$u<8l&Qc(jysezFx0V20-~cSRcCx`0qigr|^;wx(tWilvsVTSF zbZ&dKTjzE-Dl5v}I;*q1B(=n8Eh|}JvpRJvt+iI0)m5r{$!;yRyHZd`AnL}MfxCp^ zfT(uiAX4B5u)GtC$Uxls2m9m3V-G4BD5J;amAmXVx5M=&B{C2LQ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%lj)G736hZ+sVl`N9c~ z>w}%0e*4FQerSP%%Ss5&Ryu2HxR*MxT@I#BFG?h1euDpQ?-#sthcGjj<5q({DaINnWLx6~ zH-I6g0m5RINz_jv92V&kSn3)uCI~E1WQjVKD6vFYNM$KeLJPEz7U~zk)Hh1-6EHEm z(kDS5rEh>pU4KNB6G>q(y9IOz`W#)UW&5;$ugGrb|ywH!gX~eB;t?4ah+TmOjOR z3Dj;a7=xC8`}0&AzjbS4QSceB`1aC)a6FnE=^>r*>0YO|+?8AIuIxH~GD_ZmC72_( zakDrH$2dacnC6~0+2cYUPZdAndK6V_jv&f9L5O>X(g_)q+9@4J>3EcZA(Grxbi;&R zf~@Z^g;`?_a&)9Yj_G5NV-ayth+yB^Z^nJH2mRt0gXsAkpXjb}RhKK60=R2oc(A$L zFuZ`QmilD8<9L|?hI2t8Fr4cYRT-BmrZTQpg37p1i7G>h0-Z`FtR$5|Ek-F760rqD z52dIG1Nl2jNF8L6jllnBhGAXLa2VcICv|q>oKc8Wp6akQ8exZVB$@0M%Lc3^MqytH zzBou0OEuDLMB*GLKbwNf|9wPpD~3lq-(C6+SUHTr>3MJi$z02z&Da5k z5g5##GX&*tEr~Wi2S~PuL=wo>S_W-m4lsnXP?ix$(^>{?stqt~3W-6Rc(pv*EE(V_ zz*E%o4as?&GqnWT7ZO1rRcaZuA{byu!n@Y7p11x1bBlRi literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/Api_2_Pah_Gvsh_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/Api_2_Pah_Gvsh_1.java new file mode 100644 index 0000000..37aa624 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/Api_2_Pah_Gvsh_1.java @@ -0,0 +1,257 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Gvsh_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_gvsh; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_gvsh + * + * @version 0.0.1 - 20 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Gvsh_1 extends TestToolkitApplet +{ + + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte)0; + + private static final byte DCS_8_BIT_DATA = 0x04; + + private static final byte TYPE = (byte) 0xFF ; + private static final byte QUALIFIER = (byte) 0xFE ; + private static final byte DST_DEVICE = (byte) 0xFD ; + + private byte[] TEXT = new byte[240] ; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Gvsh_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Gvsh_1 thisApplet = new Api_2_Pah_Gvsh_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public void processToolkit(short event) + { + // Result of tests + boolean bRes ; + + // Number of tests + byte testCaseNb = (byte) 0x00 ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + + // Result of method + short result = 0 ; + + + // -------------------------------------------- + // Test Case 1 : Unavailable Element + testCaseNb = (byte) 1 ; + bRes = false ; + + try { + + // Initialise the handler + proHdlr.init(TYPE, QUALIFIER, DST_DEVICE) ; + + try { + proHdlr.getValueShort((short)0) ; + + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 2 : Out of Tlv Boundaries + testCaseNb = (byte) 2 ; + bRes = false ; + + try { + + // Search Command Details TLV + proHdlr.findTLV((byte)0x01, (byte)1) ; + + try { + result = proHdlr.getValueShort((short)3) ; + } catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.OUT_OF_TLV_BOUNDARIES) ; + } + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 3 : Successful call + testCaseNb = (byte) 3 ; + bRes = false ; + + try { + + // Search Command Details TLV + proHdlr.findTLV((byte)0x01, (byte)1) ; + + // Get Qualifier + result = proHdlr.getValueShort((short)1) ; + + bRes = (result == (short)0xFFFE) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 4 : Successful call + testCaseNb = (byte) 4 ; + bRes = false ; + + try { + + // Search Device Identities TLV + proHdlr.findTLV((byte)0x02, (byte)1) ; + + // Get Source Device + result = proHdlr.getValueShort((short)0) ; + + bRes = (result == (short)0x81FD) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + // Initialise Text buffer + for (short i=0; i<(short)TEXT.length; i++) { + TEXT[i] = (byte) i ; + } + + // -------------------------------------------- + // Test Case 5 : Successful call + testCaseNb = (byte) 5 ; + bRes = false ; + + try { + + // Initialise handler + proHdlr.initDisplayText((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)0x7E) ; + + // Find Text String TLV + proHdlr.findTLV((byte)0x0D, (byte)1) ; + + result = proHdlr.getValueShort((short)0x7D) ; + + bRes = (result == (short)0x7C7D) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 6 : Successful call + testCaseNb = (byte) 6 ; + bRes = false ; + + try { + + // Initialise handler + proHdlr.initDisplayText((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)0x7F) ; + + // Find Text String TLV + proHdlr.findTLV((byte)0x0D, (byte)1) ; + + result = proHdlr.getValueShort((short)0x7D) ; + + bRes = (result == (short)0x7C7D) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 7 : Successful call + testCaseNb = (byte) 7 ; + bRes = false ; + + try { + + result = proHdlr.getValueShort((short)0x7E) ; + + bRes = (result == (short)0x7D7E) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + + // -------------------------------------------- + // Test Case 8 : Successful call + testCaseNb = (byte) 8 ; + bRes = false ; + + try { + + // Initialise handler + proHdlr.initDisplayText((byte)0, DCS_8_BIT_DATA, TEXT, (short)0, (short)0xF0) ; + + // Find Text String TLV + proHdlr.findTLV((byte)0x0D, (byte)1) ; + + result = proHdlr.getValueShort((short)0xEF) ; + + bRes = (result == (short)0xEEEF) ; + } + catch (Exception e) { + bRes = false ; + } + reportTestOutcome(testCaseNb, bRes) ; + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/Test_Api_2_Pah_Gvsh.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/Test_Api_2_Pah_Gvsh.java new file mode 100644 index 0000000..45e5c84 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/Test_Api_2_Pah_Gvsh.java @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Gvsh.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_gvsh; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_gvsh + * + * @version 0.0.1 - 20 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Gvsh extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_gvsh"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Gvsh() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 to 8 */ + /*********************************************************************/ + + test.unrecognizedEnvelope(); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "08CCCCCC CCCCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/applet.opt new file mode 100644 index 0000000..4bfa4f3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_gvsh.Api_2_Pah_Gvsh_1 +uicc.test.toolkit.api_2_pah_gvsh +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/javacard/api_2_pah_gvsh.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_gvsh/javacard/api_2_pah_gvsh.cap new file mode 100644 index 0000000000000000000000000000000000000000..d72243b00119d873c9df28e7e22d7cd6f6242929 GIT binary patch literal 3456 zcmbW3c~DbV6o=1!TXqN!JaLBfW`1+u%YFBJ=iGbW zInOweW;7thUwo+{9$so1U?3|aCv})%a%OZ^>SRM^Mt08dtjy}+1)X^V;ft; zN^kj{(oR`mU-R%}TteKrJ)fUwsF8oEY3QgpmBm^fZO#jxu=Vi8wz5h2=LT*zJiCzo z{l+>d49_cOwr@CpyZz9=rl7@S_OYgL)E(#pR6Cx4tcwMRL1Gtnz-qAlcwK&kh|7zdT{g6b!A7(7S#W`EJ`-& z;--5mnv+l8Nbvuld4j3&;cCO+CqJeweNflfe`!uF`}op$&CcNm4yHVFA6eaYf5y(m z*Q>HmwzoD1&HC<(H2toEZN`ZbY0Kddx`Y5+VgQV|cXH2;@q72ft+8YDc*kobYO&31 zj&@p$ozYIay|BRMj5axJbK>SWO!;#bloaPjzi%ornN3BO=y$Cqi?wLD+2kM)+;X<# zF`*bB>UuOH1GWR(N8yO{#x*B|CJ(?TcqO2Ek4v`|S`=2KueW? z97dzLN)$GRh_I=@xwZXpfR}GkraByjRwvJ-LGwy<1T5b1EsCzaISwJbd;=L4I_yOr z5Cci#g=|H06p_?pH;)j}D)+&Ep>q(3w?7F>k7cIfFt0JF-miC>eNnN~w8&}1W59>c zVod%Nx`6`9g+%N*fGM;KD3p}r|8vVwDj>@#;M{(A%>wOK5geC!JJuFeb07#U@EU>g z!LdS9aWU@^2ii0j&_Lw8D^-;gxTQqymWcMgvFhrHCFnFS-?k*n>dd!Wc$9=Hk;8U8 z*LzS~ToG^r58O@E1H8YC_iZ323Rf6;3;SeOIGK(8N>>ayjQttx{{cCraP^}GVIS{` zqioo#b!$MPqdx>)0JN@CRFP6Pb}i6j*8np-M5kv`b^5{8z=l)<7qXn9YAH;&rQ8rY zt_Bnl3?0cbadd1TL#dyu+iMw6_6uZad`QVAIr>I$fm}7HxB`}O&~&VWa!4aMzSo6? zR)ZhwnaMDGKWVLKS zWqXe^=t$0?Y9d-r%gsuh!Qn*{*-+Rj^%$ZhO@vlg)N-H<3S`u(ZoBI8ZchTr$_2v` zA!_vt=U~w3fxya_gvcY?#fJ)4rfGGoim6ThGxq{DTFn~`W#MPPFXe=XBAOZsTAtD0{M8O;U zHRhQr7)2g?7SA8Tv5F1q=)fnVP!W8^!@FUqSQtTK$UZhdd>v6UU&rEwk)+UZYAV$@ zkx&|}TV3ByFIQ&%+sV7V?n{cdBJbS8o~pQDz{f4ALxl&)E@y=Psi7b9( P0VwbngX=y<#^3!1XzO|B literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/Api_2_Pah_Icch_1.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/Api_2_Pah_Icch_1.java new file mode 100644 index 0000000..7b73703 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/Api_2_Pah_Icch_1.java @@ -0,0 +1,160 @@ +//----------------------------------------------------------------------------- +//Api_2_Pah_Icch_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_icch; + +import uicc.test.util.*; +import uicc.toolkit.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_icch + * + * @version 0.0.1 - 20 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Api_2_Pah_Icch_1 extends TestToolkitApplet +{ + + // Result of tests + boolean bRes ; + + public final static byte CHANNEL_ID1 = (byte)0x01; + public final static byte CHANNEL_ID2 = (byte)0x02; + public final static byte QUALIFIER_1 = (byte)0x01; + public static byte[] ADDRESS_VALUE = {(byte)0x81, (byte)0x55, (byte)0x66, (byte)0x77, (byte)0x88}; + public static byte[] BEARER_VALUE = {(byte)0x03, (byte)0x00}; + public static byte[] BUFFER_SIZE_VALUE = {(byte)0x00, (byte)0x0A}; + + // Number of tests + byte testCaseNb = (byte)0; + + /** + * Constructor of the applet + */ + public Api_2_Pah_Icch_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Api_2_Pah_Icch_1 thisApplet = new Api_2_Pah_Icch_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // Register on UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + // Register on EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS); + } + + public void processToolkit(short event) + { + // Result of each test + bRes = false ; + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler(); + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + // Open a channel + proHdlr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdlr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)5); + proHdlr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)2); + proHdlr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)2); + proHdlr.send(); + } + + + if (event == EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS) { + switch(testCaseNb) { + case (byte)0 : + // -------------------------------------------- + // Test Case 1 : initCloseChannel + testCaseNb = (byte) 1 ; + try { + proHdlr.initCloseChannel(CHANNEL_ID1); + proHdlr.send(); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + // -------------------------------------------- + // Test Case 2 : + case (byte)1 : + testCaseNb = (byte) 2 ; + try { + proHdlr.initCloseChannel(CHANNEL_ID2); + proHdlr.initCloseChannel(CHANNEL_ID1); + proHdlr.send(); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + break; + + // -------------------------------------------- + // Test Case 3 : + case (byte)2 : + testCaseNb = (byte) 3 ; + try { + proHdlr.findTLV(TAG_ADDRESS,(byte)1); + proHdlr.initCloseChannel(CHANNEL_ID1); + short i = proHdlr.getValueLength(); + bRes = false; + } + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.UNAVAILABLE_ELEMENT) { + bRes = true; + } + } + catch (Exception e) { + bRes = false; + } + try { + proHdlr.send(); + } + catch (Exception e) {} + reportTestOutcome(testCaseNb, bRes); + break; + + // -------------------------------------------- + // Test Case 4 : + case (byte)3 : + testCaseNb = (byte) 4 ; + try { + proHdlr.initCloseChannel(CHANNEL_ID1); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + break; + } + + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/Test_Api_2_Pah_Icch.java b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/Test_Api_2_Pah_Icch.java new file mode 100644 index 0000000..82b8f2b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/Test_Api_2_Pah_Icch.java @@ -0,0 +1,200 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Pah_Icch.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.toolkit.api_2_pah_icch; + +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + +/** + * Test Area : uicc.test.toolkit.api_2_pah_icch + * + * @version 0.0.1 - 20 juin 2005 + * @author 3GPP T3 SWG API + */ +public class Test_Api_2_Pah_Icch extends UiccTestModel +{ + static final String CAP_FILE_PATH = "uicc/test/toolkit/api_2_pah_icch"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 20010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 20010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Api_2_Pah_Icch() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + + // Card Initialisation + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result = response.checkSw("911A"); + + // Fetch the Open Channel proactive command + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + // Successful terminal response + test.terminalResponse("81030140 01820282 81830100 38028100" + + "35020300 3902000A"); + + // Send an EVENT_DOWNLOAD_CHANNEL_STATUS Envelope + response = test.envelopeEventDownloadChannelStatus("38028100"); + result &= response.checkSw("910B"); + // Fetch the close channel proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028121"); + + // Successful terminal response + response = test.terminalResponse("81030141 00820282 81830100"); + result &= response.checkSw("9000"); + + // Send an EVENT_DOWNLOAD_CHANNEL_STATUS Envelope + response = test.envelopeEventDownloadChannelStatus("38028100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result &= response.checkSw("911A"); + + // Fetch the open channel proactive command + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + // Successful terminal response + test.terminalResponse("81030140 01820282 81830100 38028100" + + "35020300 3902000A"); + + // Send an EVENT_DOWNLOAD_CHANNEL_STATUS Envelope + response = test.envelopeEventDownloadChannelStatus("38028100"); + result &= response.checkSw("910B"); + // Fetch the close channel proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028121"); + + // Successful terminal response + response = test.terminalResponse("81030141 00820282 81830100"); + result &= response.checkSw("9000"); + + // Send an EVENT_DOWNLOAD_CHANNEL_STATUS Envelope + response = test.envelopeEventDownloadChannelStatus("38028100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result &= response.checkSw("911A"); + + // Fetch the open channel proactive command + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + // Successful terminal response + test.terminalResponse("81030140 01820282 81830100 38028100" + + "35020300 3902000A"); + + // Send an EVENT_DOWNLOAD_CHANNEL_STATUS Envelope + response = test.envelopeEventDownloadChannelStatus("38028100"); + result &= response.checkSw("910B"); + // Fetch the close channel proactive command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01410082 028121"); + + // Successful terminal response + response = test.terminalResponse("81030141 00820282 81830100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + response = test.unrecognizedEnvelope(); + result &= response.checkSw("911A"); + + // Fetch the open channel proactive command + response = test.fetch("1A"); + result &= response.checkData("D0188103 01400182 02818206 05815566" + + "77883502 03003902 000A"); + // Successful terminal response + test.terminalResponse("81030140 01820282 81830100 38028100" + + "35020300 3902000A"); + + // Send an EVENT_DOWNLOAD_CHANNEL_STATUS Envelope + response = test.envelopeEventDownloadChannelStatus("38028100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + + "04CCCCCC CC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/applet.opt b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/applet.opt new file mode 100644 index 0000000..4a53594 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x01 uicc.test.toolkit.api_2_pah_icch.Api_2_Pah_Icch_1 +uicc.test.toolkit.api_2_pah_icch +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x20:0x01:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/javacard/api_2_pah_icch.cap b/source/Annex_E_SourceCode/uicc/test/toolkit/api_2_pah_icch/javacard/api_2_pah_icch.cap new file mode 100644 index 0000000000000000000000000000000000000000..f7a29dc5e5db8e179481dd6e0ddce3a96514a5bb GIT binary patch literal 3287 zcmb7`3rtg27{|YJUwr}vk(L6AIE?er0_p%kg%z2IxcZpcGzM!aQed>uIw!cSR1DYIQuJ&%r+I#cwIp^N5=l7l0 z_g!Nl%SD3}@7HPzCc#TrG;mNfeSYrvg4y}{qTJa9`P1jk*A?aec^2T)xkWa2il(R8 zJG{0p{8UW!_ct_`)>x`aS{E0v)8mG|{c8TevyVQJe|K^G@rkRlZQCC`ZvA1+>2WRI zwsqU~%E(VS-M6Lr$&LLdyPhtI&B!s>Z>eRizZ-Ww*0of&vFWn)ixyw{T-{yDMQ1DP z=3c+tZ0%lHbG0Kj;(TI9W6raMcY23hH{LNu=B{Yly>pkh?AR`ckb3m`8_dOzliXkI zt8VhV$?kl}UdvdZUw^A7@6?6g#&kB1irZ7h-_Ps5899VIdf-6V)nVJbL$g+vXphM= zW*l3XV_CL)_lOgH9rojpzNxb7@}tIs_al0aY;Y@LB2$iRe^%|d_kpL}l5xwDb7>+u z)XtT0URVE!Bf^Q;KPD_ma$ebUXG`at+vTf%Eq}W0?w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1q-4&(-nzKDWS|+vP7+F2}K4|N+>grERo2m-9=~~a%5}JH~<5_Jo@=} D;NmFD literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/Cre_Apt_Edua_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/Cre_Apt_Edua_1.java new file mode 100644 index 0000000..a1415c4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/Cre_Apt_Edua_1.java @@ -0,0 +1,125 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Edua_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_edua; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_EVENT_DOWNLOAD_USER_ACTIVITY + * + * + * + * + * + */ + +public class Cre_Apt_Edua_1 extends TestToolkitApplet{ + + private byte testCaseNb = (byte) 0x00; + private static boolean bRes; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'1'}; + + + + //Constructor of the applet + + public Cre_Apt_Edua_1(){ + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Edua_1 thisApplet = new Cre_Apt_Edua_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT DOWNLOAD USER ACTIVITY + // obReg = ToolkitRegistry.getEntry(); + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + //register to the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY + bRes=thisApplet.obReg.isEventSet(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + + //event EVENT_EVENT_DOWNLOAD_USER_ACTIVITY + if(event==EVENT_EVENT_DOWNLOAD_USER_ACTIVITY){ + + switch(testCaseNb){ + + case (byte)0x00: + testCaseNb=(byte)0x01; + reportTestOutcome(testCaseNb,bRes); + //TEST CASE 2:APPLET IS UNREGISTERED TO THE EVENT + testCaseNb=(byte)0x02; + try{ + //deregister to the event EVENT_EVENT_DOWNLOAD_USER_ACTIVITY + obReg.clearEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + reportTestOutcome((byte)0x03,true); + break; + case (byte)0x02: + testCaseNb=(byte)0x03; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + break; + case (byte)0x04: + //TEST CASE 5: THE APPLET MUST BE TRIGGERED + testCaseNb=(byte)0x05; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + } + } + + + //event EVENT_MENU_SELECTION + if(event==EVENT_MENU_SELECTION){ + //TEST CASE 4: THE APPLET IS REGISTERED TO THE EVENT + testCaseNb=(byte)0x04; + try{ + //register to the event EVENT_EVENT_DOWNLOAD_USER_ACTIVITY + obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + + } + + } + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/Test_Cre_Apt_Edua.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/Test_Cre_Apt_Edua.java new file mode 100644 index 0000000..a9cc989 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/Test_Cre_Apt_Edua.java @@ -0,0 +1,76 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: UICC CAT Runtime Environment Applet Triggering +// EVENT_EVENT_DOWNLOAD_USER_ACTIVITY +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_edua; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Edua extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_edua"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Edua() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("09010000 21"); + //***TEST CASE 1: 1-APPLET 1 IS REGISTERED TO EVENT_EVENT_DOWNLOAD_USER_ACTIVITY *** + //***TEST CASE 1: 2-APPLET 1 IS TRIGGERED*** + test.envelopeEventDownloadUserActivity(); + //***TEST CASE 2: 1-APPLET 1 IS NOT TRIGGERED*** + test.envelopeEventDownloadUserActivity(); + //***TEST CASE 2: 1 IS REGISTERED TO EVENT_EVENT_DOWNLOAD_USER_ACTIVITY + test.envelopeMenuSelection("100101", "");//Help Request not available; + //***TEST CASE 2: 2-APPLET 1 IS TRIGGERED*** + test.envelopeEventDownloadUserActivity(); + + // check results + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10"+APPLET_AID_1+"05CCCCCC CCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/applet.opt new file mode 100644 index 0000000..0393e59 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_edua.Cre_Apt_Edua_1 +uicc.test.catre.cre_apt_edua +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/javacard/cre_apt_edua.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_edua/javacard/cre_apt_edua.cap new file mode 100644 index 0000000000000000000000000000000000000000..c9339c949a01140f4a65ab3d379cde5b9bf8c4e2 GIT binary patch literal 2983 zcma)73rtg282<00y|)EoaRn++glchwM+N6zqOn%lDgup=7>&lY?){>BVe^2fO_IB37 zIbAj1T|1lMKles|SwhbJ2i8yKJse8<^TiJuKkokWk$%pBw+GU0b>5j#aV=+Xwtjm1 z?fh-yijJOIzVQ`J;_=K%vE|H}@}9frznZ#l_1%%3)#L0(CiV8&1{mYx^65J-@9?eY zx!f13*sv|+DXqD;N;SLl(b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OyMJa_esfiTxRdT-~HpSWV6(|lM4sVXcnIljC E0^v(VlmGw# literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_1.java new file mode 100644 index 0000000..cfe6748 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_1.java @@ -0,0 +1,95 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Emsh_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_emsh; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_MENU_SELECTION_HELP_REQUEST + * + * + * + * + */ + + public class Cre_Apt_Emsh_1 extends TestToolkitApplet { + + private byte testCaseNb = (byte) 0x00; + private static byte[] menuEntry1A = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'1',(byte)'A'}; + private static byte[] menuEntry1B = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'1',(byte)'B'}; + private static boolean bRes; + + + // Constructor of the applet + public Cre_Apt_Emsh_1() { + + } + + + // Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instace + Cre_Apt_Emsh_1 thisApplet = new Cre_Apt_Emsh_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + // register to EVENT_MENU_SELECTION_HELP_REQUEST + thisApplet.obReg.initMenuEntry(menuEntry1A,(short)0x00,(short)menuEntry1A.length,(byte)0x00,true,(byte)0x00,(short)0x00); + // register to EVENT_MENU_SELECTION (Help request is not supported) + thisApplet.obReg.initMenuEntry(menuEntry1B,(short)0x00,(short)menuEntry1B.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + // Test Case 1: Check if the applet is registered to the event + bRes=thisApplet.obReg.isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST); + } + + + // Method called by the UICC CAT Runtime Environment + + public void processToolkit(short event) { + + if (event == EVENT_MENU_SELECTION_HELP_REQUEST) { + + switch(testCaseNb) { + case (byte)0x00: + // Test Case 1: 1-The applet is registered to EVENT_MENU_SELECTION_HELP_REQUEST + testCaseNb= (byte)0x01; + reportTestOutcome(testCaseNb,bRes); + // 3-The applet is triggered by EVENT_MENU_SELECTION_HELP_REQUEST with Item identifier 01 + testCaseNb = (byte) 0x02; + bRes= true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb = (byte) 0x03; + // 4-The applet is not triggered by EVENT_MENU_SELECTION_HELP_REQUEST with Item identifier 02 + reportTestOutcome(testCaseNb,bRes); + testCaseNb = (byte) 0x04; + break; + case (byte)0x04: + // 4-The applet shall not triggered by EVENT_MENU_SELECTION_HELP_REQUEST with Item identifier different from 01 + bRes= false; + testCaseNb = (byte) 0x03; + reportTestOutcome(testCaseNb,bRes); + break; + } + } + } + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_2.java new file mode 100644 index 0000000..c7ccd47 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_2.java @@ -0,0 +1,93 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Emsh_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_emsh; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_MENU_SELECTION_HELP_REQUEST + * + * + * + */ + + public class Cre_Apt_Emsh_2 extends TestToolkitApplet { + + private static byte testCaseNb = (byte) 0x00; + private static byte[] menuEntry2A ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'2',(byte)'A'}; + private static byte[] menuEntry2B ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'2',(byte)'B'}; + private static boolean bRes; + + // Constructor of the applet + public Cre_Apt_Emsh_2() { + + } + + + // Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instance + Cre_Apt_Emsh_2 thisApplet = new Cre_Apt_Emsh_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // register to EVENT_MENU_SELECTION_HELP_REQUEST + thisApplet.obReg.initMenuEntry(menuEntry2A,(short)0x00,(short)menuEntry2A.length,(byte)0x00,true,(byte)0x00,(short)0x00); + thisApplet.obReg.initMenuEntry(menuEntry2B,(short)0x00,(short)menuEntry2B.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + // Test Case 2: Check if the applet is registered to the event + bRes=thisApplet.obReg.isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST); + } + + + // Method called by the UICC CAT Runtime Environment + + public void processToolkit(short event) { + + if (event == EVENT_MENU_SELECTION_HELP_REQUEST) { + + switch(testCaseNb) { + case (byte)0x00: + // Test Case 1: 1-The applet is registered to EVENT_MENU_SELECTION_HELP_REQUEST + testCaseNb=(byte)0x01; + reportTestOutcome(testCaseNb,bRes); + // 5-The applet is triggered by EVENT_MENU_SELECTION_HELP_REQUEST with Item identifier 03 + testCaseNb = (byte) 0x02; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb = (byte) 0x03; + // 6-The applet is not triggered by EVENT_MENU_SELECTION_HELP_REQUEST with Item identifier 04 + reportTestOutcome(testCaseNb,bRes); + testCaseNb = (byte) 0x04; + break; + case (byte)0x04: + // 6-The applet shall not triggered by EVENT_MENU_SELECTION_HELP_REQUEST with Item identifier different from 03 + bRes= false; + testCaseNb = (byte) 0x03; + reportTestOutcome(testCaseNb,bRes); + break; + + } + } + } + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_3.java new file mode 100644 index 0000000..ade15f3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Cre_Apt_Emsh_3.java @@ -0,0 +1,109 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Emsh_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_emsh; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_MENU_SELECTION_HELP_REQUEST + * + * + * + */ + + public class Cre_Apt_Emsh_3 extends TestToolkitApplet { + + private byte testCaseNb = (byte) 0x00; + private static byte[] menuEntry3A = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'3',(byte)'A'}; + private static byte[] menuEntry3B = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'3',(byte)'B'}; + private static byte[] menuEntry3C = {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'3',(byte)'C'}; + private static boolean bRes; + + + // Constructor of the applet + public Cre_Apt_Emsh_3() { + + + } + + + // Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength) { + + // Create a new applet instace + Cre_Apt_Emsh_3 thisApplet = new Cre_Apt_Emsh_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + // register to EVENT_MENU_SELECTION_HELP_REQUEST + thisApplet.obReg.initMenuEntry(menuEntry3A,(short)0x00,(short)menuEntry3A.length,(byte)0x00,true,(byte)0x00,(short)0x00); + thisApplet.obReg.initMenuEntry(menuEntry3B,(short)0x00,(short)menuEntry3B.length,(byte)0x00,true,(byte)0x00,(short)0x00); + thisApplet.obReg.initMenuEntry(menuEntry3C,(short)0x00,(short)menuEntry3C.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + // Test Case 1: Check if the applet is registered to the event + bRes=thisApplet.obReg.isEventSet(EVENT_MENU_SELECTION_HELP_REQUEST); + } + + + // Method called by the UICC CAT Runtime Environment + + public void processToolkit(short event) { + + if (event == EVENT_MENU_SELECTION_HELP_REQUEST) { + + switch(testCaseNb) { + case (byte)0x00: + // Test Case 2: 2-The applet is triggered by EVENT_MENU_SELECTION_HELP_REQUEST with Item identifier 05 + testCaseNb= (byte)0x01; + reportTestOutcome(testCaseNb,bRes); + testCaseNb = (byte) 0x02; + // 3-Call disableMenuEntry() method for Item Identifier 05 + try { + obReg.disableMenuEntry((byte)0x05); + bRes= true; + } + catch (ToolkitException e) { + bRes= false; + } + reportTestOutcome(testCaseNb,bRes); + testCaseNb = (byte) 0x03; + break; + + case (byte)0x03: + // 4-The applet is triggered by EVENT_MENU_SELECTION_HELP_REQUEST with Item identifier 06 + bRes= true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb = (byte) 0x04; + // 5-Call disableMenuEntry() method for Item Identifier 06 + try { + obReg.disableMenuEntry((byte)0x06); + bRes= true; + } + catch (ToolkitException e) { + bRes= false; + } + reportTestOutcome(testCaseNb,bRes); + break; + } + } + } + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Test_Cre_Apt_Emsh.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Test_Cre_Apt_Emsh.java new file mode 100644 index 0000000..44c1236 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/Test_Cre_Apt_Emsh.java @@ -0,0 +1,151 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: UICC CAT Runtime Environment Applet Triggering +// EVENT_MENU_SELECTION_HELP_REQUEST +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_emsh; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Emsh extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_emsh"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Apt_Emsh() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0B" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "02" + // V Position of the second menu entry + "02" + // V Identifier of the second menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800C"+ // TLV UICC Toolkit application specific parameters + "03" + // V Priority Level + "00" + // V Max. number of timers + "0B" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "03" + // V Position of the third menu entry + "03" + // V Identifier of the third menu entry + "04" + // V Position of the fourth menu entry + "04" + // V Identifier of the fourth menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + + // test script + test.reset(); + test.terminalProfileSession("09010020 01"); + //*** Test Case 1: 3-Applet1 is triggered, Applet2 is not triggered **** + test.envelopeMenuSelection("100101", "1500");//Help Request + //*** Test Case 1: 4-Applet1, Applet2 are not triggered **** + test.envelopeMenuSelection("100102", "1500");//Help Request + //*** Test Case 1: 5-Applet2 is triggered, Applet1 is not triggered **** + test.envelopeMenuSelection("100103", "1500");//Help Request + //*** Test Case 1: 6-Applet2, Applet1 are not triggered **** + test.envelopeMenuSelection("100104", "1500");//Help Request + // check results of Applet 1 and Applet2. + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10"+APPLET_AID_1+"03CCCCCC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10"+APPLET_AID_2+"03CCCCCC"); + //Delete Applet 1 and Applet2. + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + //Install Applet 3 + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800E"+ // TLV UICC Toolkit application specific parameters + "03" + // V Priority Level + "00" + // V Max. number of timers + "0B" + // V Maximum text length for a menu entry + "03" + // V Maximum number of menu entries + "05" + // V Position of the fifth menu entry + "05" + // V Identifier of the fifth menu entry + "06" + // V Position of the sixth menu entry + "06" + // V Identifier of the sixth menu entry + "07" + // V Position of the seventh menu entry + "07" + // V Identifier of the seventh menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + test.reset(); + test.terminalProfile("09010020 01"); + //UICC proactive command SET UP MENU, Menu Entry ID 05, 06, 07, Help Request supported + response = test.fetch("37"); + result &= response.checkData("D0358103 01258082 02818285 09554943" + + "43205445 53548F09 05417070 6C657433" + + "418F0906 4170706C 65743342 8F090741" + + "70706C65 743343"); + test.terminalResponse("81030125 80820282 81830100"); + //*** Test Case 2: 2-Applet3 is triggered **** + test.envelopeMenuSelection("100105", "1500");//Help Request + response = test.fetch("2C"); + result &= response.checkData("D02A8103 01258082 02818285 09554943" + + "43205445 53548F09 06417070 6C657433" + + "428F0907 4170706C 65743343"); + test.terminalResponse("81030125 80820282 81830100"); + //*** Test Case 2: 4-Applet3 is triggered **** + test.envelopeMenuSelection("100106", "1500");//Help Request + response = test.fetch("21"); + result &= response.checkData("D01F8103 01250082 02818285 09554943" + + "43205445 53548F09 07417070 6C657433" + + "43"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + + // check results + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10"+APPLET_AID_3+"04CCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/applet.opt new file mode 100644 index 0000000..c9bacd4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_apt_emsh.Cre_Apt_Emsh_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_apt_emsh.Cre_Apt_Emsh_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_emsh.Cre_Apt_Emsh_1 +uicc.test.catre.cre_apt_emsh +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/javacard/cre_apt_emsh.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_emsh/javacard/cre_apt_emsh.cap new file mode 100644 index 0000000000000000000000000000000000000000..49c2604f53f2a6966b43cadcc697dc9f3bd6d0a3 GIT binary patch literal 3881 zcma)8Yitx%6h3$E?9A-6lx@2$OWW;BN&*7g0wNZCY+q8@Zr2tB0fWnSrK@ds-EL8r zirYd$wNMO5P?Q9!DH5Sb0AKh3k%m-6#Xx)og&6!n5D+n@TI;#f+S!?eWM*>q&V2XI zcfNbi-E)s;KIN?-;hoer_YR1=tiVH6`2y$EN_T~$%IU7GD6d^Gt*YYRet>-os)Fr> zwvV@5%ZdJ&bmAS??vILk%%3kiRd{5xu>2)gTUz13)kPa}PEKy>+$Nm-VfUAd#&=HW z%5_{5PtJ9xcD-5dI=(eme)+=g#+w(8b(3exo?7$D&L^|_Xa01_v^V@q!LF8IM$h$$ z4;_7Q{Ce+hPyG&$HKlmhy8G(NcUFw+xt@QHJ5qA`?RWcY9zIrG_Sd9Ku}P~wT-kN9 z!s4Fw#(~7H>PLFt+f`-Vv#syU{+{kje-7+v+P>Fmzx{ey&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787fvesoz$p&wT#lU>x&|l{e8pi z`VvX+LtmGuKDOhIF&2Q*|Em-|xxU0u$*15y<H{aOm0f$AHRyNi@o?I~4RT^vPRw pu|+cKLYK<*F7&xnb+HnYov}62W>(L96V|E#33y8w#DoO)_8*s`yDb0! literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_1.java new file mode 100644 index 0000000..3109e56 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_1.java @@ -0,0 +1,103 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Epdw_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_epdw; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_PROFILE_DOWNLOAD + * + * + * + * + * + */ + + public class Cre_Apt_Epdw_1 extends TestToolkitApplet{ + + private byte testCaseNb = (byte) 0x00; + private boolean bRes; + + + //Constructor of the applet + + public Cre_Apt_Epdw_1(){ + + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instance + Cre_Apt_Epdw_1 thisApplet = new Cre_Apt_Epdw_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT PROFILE DONWLOAD + thisApplet.obReg.setEvent(EVENT_PROFILE_DOWNLOAD); + } + + + //Method called by the UICC CAT Runtime Environment + + public void processToolkit(short event){ + + if(event ==EVENT_PROFILE_DOWNLOAD){ + bRes=false; + switch(testCaseNb){ + + case (byte)0x00: + //TEST CASE 1: THE APPLET IS TRIGGERED + testCaseNb=(byte)0x01; + bRes=true; + //create the table of results + reportTestOutcome(testCaseNb,bRes); + break; + + case (byte)0x01: + //TEST CASE 2: THE APPLET IS UNREGISTERED TO THE EVENT + testCaseNb=(byte)0x02; + try{ + //deregister to the event EVENT_PROFILE_DOWNLOAD + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + //create the table of results + reportTestOutcome(testCaseNb,bRes); + //This case is only to store a 0xCC in the test case 3 + reportTestOutcome((byte)0x03,true); + + break; + case (byte)0x02: + //if the applet is triggered, wrongly, a 0x00 is stored in the test case 3 + testCaseNb=(byte)0x03; + //create the table of results + reportTestOutcome(testCaseNb,false); + } + } + } + + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_2.java new file mode 100644 index 0000000..29331f1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_2.java @@ -0,0 +1,102 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Epdw_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_epdw; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_PROFILE_DOWNLOAD + * + * + * + * + * + */ + + public class Cre_Apt_Epdw_2 extends TestToolkitApplet{ + + private byte testCaseNb = (byte) 0x00; + private boolean bRes; + + + //Constructor of the applet + + public Cre_Apt_Epdw_2(){ + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Epdw_2 thisApplet = new Cre_Apt_Epdw_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT PROFILE DOWNLOAD + thisApplet.obReg.setEvent(EVENT_PROFILE_DOWNLOAD); + } + + + //Method called by the UICC CAT Runtime Environment + + public void processToolkit(short event){ + + if(event==EVENT_PROFILE_DOWNLOAD){ + bRes=false; + switch(testCaseNb){ + + case (byte)0x00: + //TEST CASE 1: THE APPLET IS TRIGGERED + testCaseNb=(byte)0x01; + bRes=true; + //create the table of results + reportTestOutcome(testCaseNb,bRes); + break; + + case (byte)0x01: + + //TEST CASE 2: THE APPLET IS UNREGISTERED TO THE EVENT + testCaseNb=(byte)0x02; + try{ + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + //create the table of results + reportTestOutcome(testCaseNb,bRes); + //This case is only to put 0xCC in the test case 3. + reportTestOutcome((byte)0x03,true); + + break; + + case (byte)0x02: + //if the applet is triggered, wrongly, then 0x00 is stored in the test case 3 + testCaseNb=(byte)0x03; + //create the table of results + reportTestOutcome(testCaseNb,false); + } + } + } + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_3.java new file mode 100644 index 0000000..6e78467 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Cre_Apt_Epdw_3.java @@ -0,0 +1,115 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Epdw_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_epdw; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_PROFILE_DOWNLOAD + * + * + * + * + * + */ + + public class Cre_Apt_Epdw_3 extends TestToolkitApplet{ + + private static byte testCaseNb = (byte) 0x00; + private static byte cntCases = (byte)0x00; + private byte[] TEXT= {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)' ',(byte)'1'}; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'3'}; + private boolean bRes; + + + //Constructor of the applet + + + public Cre_Apt_Epdw_3(){ + // + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Epdw_3 thisApplet = new Cre_Apt_Epdw_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + thisApplet.reportTestOutcome((byte)0x01,true); + } + + + //Method called by the UICC CAT Runtime Environment + + public void processToolkit(short event){ + + bRes=false; + switch(event){ + + //event EVENT_PROFILE_DOWNLOAD + case EVENT_PROFILE_DOWNLOAD: + + switch(cntCases){ + case (byte)0x00: + testCaseNb=(byte)0x01; + //create the table of results + reportTestOutcome(testCaseNb,bRes); + break; + + case (byte)0x01: + testCaseNb=(byte)0x03; + bRes=true; + //create the table of results + reportTestOutcome(testCaseNb,bRes); + } + break; + + case EVENT_MENU_SELECTION: + testCaseNb=(byte)0x02; + cntCases=(byte)0x01; + try{ + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler(); + //build a Proactive Command Refresh + proHdlr.init(PRO_CMD_REFRESH,(byte)0x03,DEV_ID_TERMINAL); + //send the Refresh command + proHdlr.send(); + //register to EVENT_PROFILE_DOWNLOAD + obReg.setEvent(EVENT_PROFILE_DOWNLOAD); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + //create the table of results + reportTestOutcome(testCaseNb,bRes); + + } + + + } + + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Test_Cre_Apt_Epdw.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Test_Cre_Apt_Epdw.java new file mode 100644 index 0000000..e1a5e4b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/Test_Cre_Apt_Epdw.java @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------------- +// Package Definition +// UICC CAT Runtime Environment Applet Triggering +// EVENT_PROFILE_DOWNLOAD +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_epdw; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Epdw extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_epdw"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Epdw() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "8008"+ // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800A"+ // TLV UICC Toolkit application specific parameters + "03" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // test script + test.reset(); + //***TEST CASE 1 OF THE APPLETS 1 AND 2 *** + test.terminalProfileSession("09018000 01"); + //***TEST CASE 1 OF THE APPLET 3 *** + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result = response.checkSw("910B"); + response = test.fetch("0B"); + result &= response.checkData("D0098103 01010382 028182"); + + //***TEST CASE 2 OF THE APPLETS 1 AND 2 *** + test.terminalProfileSession("03010000 01"); + //TERMINAL RESPONSE TO THE REFRESH OF THE APPLET3 + test.terminalResponse("81030101 03820282 81030100"); + //***TEST CASE 3 OF THE APPLET 3 **** + test.terminalProfileSession("03010000 01"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10"+APPLET_AID_1+"03CCCCCC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10"+APPLET_AID_2+"03CCCCCC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10"+APPLET_AID_3+"03CCCCCC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/applet.opt new file mode 100644 index 0000000..c604fa9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_apt_epdw.Cre_Apt_Epdw_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_apt_epdw.Cre_Apt_Epdw_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_epdw.Cre_Apt_Epdw_1 +uicc.test.catre.cre_apt_epdw +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/javacard/cre_apt_epdw.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epdw/javacard/cre_apt_epdw.cap new file mode 100644 index 0000000000000000000000000000000000000000..502b1a5a530180a7c93e91d8b4be59b64b734dcd GIT binary patch literal 3689 zcma)83v5$W82-<>kKT40YiFsKb#-GR8PL7lhGVnhp0F1bHz$lJbY0DcbFEzg?R<0{ zgr|G>z(he%qDYi#<_nD)jSmPR7*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bcM0xq8#*8pV9%d+|`|@%FKet;fVYJJ)8SCZ3~uYS0NZol95si)`6>Y2plnPJ&{cB#8z- zm6ztES;RD5LURskMP4t-CSDLFLF74usLv3RN$%d(6Rhg7(j!&(p-|g@5;rYWj zr;rlN?3jTtCfpzmOPCrkIuPP8-vJ3x7=&rC7|%ewh#qFZ5}3}~m?IXzQn-mt#&l>& z2C&2dEOCH62>{~>0LLZ)2*n)9VIrJl5RDz?jqF839D8vghHnRGL|XP3Dk($M*>PIL zg{bTRMp|SWqK1$bg&e4cT39&wY-H_d6q;c%J{RMRxFqyZ-w4h4tj4=78YM+Scg`ru zAS97| zLw%AfHlD&Aqiq3dE}rXZaP^_AfLCB`p$%L)qSff?Ost^q)@emoUOp&yj jP~~H_33a|yOuVhxL~{0YHVIhy0i@t9;UYH0e&&Axd9jvm literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Cre_Apt_Epha_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Cre_Apt_Epha_1.java new file mode 100644 index 0000000..e1bf221 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Cre_Apt_Epha_1.java @@ -0,0 +1,170 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Epha_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_epha; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: CAT Runtime Environment Applet Triggering EVENT_PROACTIVE_HANDLER_AVAILABLE + * + * + * + * + * + */ + +public class Cre_Apt_Epha_1 extends TestToolkitApplet{ + private byte testCaseNb = (byte) 0x00; + private boolean bRes = false; + private byte[] TEXT = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'1'}; + private static byte[] menuEntry= {(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'1'}; + + //Constructor of the applet + + public Cre_Apt_Epha_1(){ + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Epha_1 thisApplet = new Cre_Apt_Epha_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + } + + + //Method called by the UICC CAT Runtime Environment + + public void processToolkit(short event){ + + if(event==EVENT_MENU_SELECTION ){ + switch(testCaseNb){ + //TestCase 1: 1- Applet1 is triggered + case (byte)0x00: + testCaseNb=(byte)0x01; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + //TestCase 1: 1.1- No exception is thrown + testCaseNb=(byte)0x02; + try{ + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + //TestCase 1: 1.2- No exception is thrown + //TestCase 1: 1.3- Method returns TRUE + testCaseNb=(byte)0x03; + try{ + obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); //1.2 + bRes=obReg.isEventSet(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); //1.3 + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + //TestCase 1: 1.4- Method returns TRUE + testCaseNb=(byte)0x04; + bRes=obReg.isEventSet(EVENT_PROACTIVE_HANDLER_AVAILABLE); + reportTestOutcome(testCaseNb,bRes); + break; + + //TestCase 2: 1- Applet1 is triggered + case (byte)0x0B: + testCaseNb=(byte)0x0C; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb=(byte)0x0D; + try{ + ProactiveHandler prHdlr = ProactiveHandlerSystem.getTheHandler(); + prHdlr.initDisplayText((byte)0x80,(byte)0x04,TEXT,(short)0x00,(short)TEXT.length); + prHdlr.send(); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + break; + } + } + + if(event==EVENT_PROACTIVE_HANDLER_AVAILABLE){ + switch(testCaseNb){ + //TestCase 1: 2- Applet1 is triggered + case (byte)0x04: + testCaseNb=(byte)0x05; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + //TestCase 1: 3- Method returns FALSE + testCaseNb=(byte)0x06; + bRes=!obReg.isEventSet(EVENT_PROACTIVE_HANDLER_AVAILABLE); + reportTestOutcome(testCaseNb,bRes); + break; + + //TestCase 1: - Applet1 is triggered + case (byte)0x09: + testCaseNb=(byte)0x0A; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + //TestCase 1: 9- Method returns FALSE + testCaseNb=(byte)0x0B; + bRes=!obReg.isEventSet(EVENT_PROACTIVE_HANDLER_AVAILABLE); + reportTestOutcome(testCaseNb,bRes); + break; + } + } + + if(event==EVENT_EVENT_DOWNLOAD_USER_ACTIVITY){ + switch(testCaseNb){ + //TestCase 1: 4- Applet1 is triggered + case (byte)0x06: + testCaseNb=(byte)0x07; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + //TestCase 1: 5- No exception is thrown + try{ + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + testCaseNb=(byte)0x08; + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + //TestCase 1: 6- Method returns TRUE + testCaseNb=(byte)0x09; + bRes=obReg.isEventSet(EVENT_PROACTIVE_HANDLER_AVAILABLE); + reportTestOutcome(testCaseNb,bRes); + + + break; + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Cre_Apt_Epha_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Cre_Apt_Epha_2.java new file mode 100644 index 0000000..eceade9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Cre_Apt_Epha_2.java @@ -0,0 +1,128 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Epha_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_epha; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_PROACTIVE_HANDLER_AVAILABLE + * + * + * + * + * + */ + +public class Cre_Apt_Epha_2 extends TestToolkitApplet{ + private byte testCaseNb = (byte) 0x00; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)'2'}; + private boolean bRes=false; + + + //Constructor of the applet + + public Cre_Apt_Epha_2(){ + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Epha_2 thisApplet = new Cre_Apt_Epha_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + } + + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + if(event==EVENT_EVENT_DOWNLOAD_USER_ACTIVITY){ + switch(testCaseNb){ + //TestCase 1: Applet2 is triggered + case (byte)0x00: + testCaseNb=(byte)0x01; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + testCaseNb=(byte)0x02; + //TestCase 1: 7- No exception is thrown + try{ + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + //TestCase 1: 8- Method returns TRUE + testCaseNb=(byte)0x03; + bRes=obReg.isEventSet(EVENT_PROACTIVE_HANDLER_AVAILABLE); + reportTestOutcome(testCaseNb,bRes); + break; + } + } + + if(event==EVENT_MENU_SELECTION ){ + switch(testCaseNb){ + + case (byte)0x05: + testCaseNb=(byte)0x06; + try{ + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + break; + } + } + + if(event==EVENT_PROACTIVE_HANDLER_AVAILABLE){ + //TestCase 2:Applet must be triggered + switch(testCaseNb){ + //TestCase 1: 9- Applet1 is triggered + case (byte)0x03: + testCaseNb=(byte)0x04; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + //TestCase 1: 10- Method returns FALSE + testCaseNb=(byte)0x05; + bRes=!obReg.isEventSet(EVENT_PROACTIVE_HANDLER_AVAILABLE); + reportTestOutcome(testCaseNb,bRes); + break; + case (byte)0x06: + testCaseNb=(byte)0x07; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + break; + + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Test_Cre_Apt_Epha.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Test_Cre_Apt_Epha.java new file mode 100644 index 0000000..c97fdd0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/Test_Cre_Apt_Epha.java @@ -0,0 +1,104 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: CAT Runtime Environment Applet Triggering +// EVENT_PROACTIVE_HANDLER_AVAILABLE +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_epha; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Epha extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_epha"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String Text1 = "54657874 31"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Epha() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A"+ // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "02" + // V Position of the first menu entry + "02" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + + // test script + test.reset(); + test.terminalProfileSession("09030100"); + //***TEST CASE 1: 1-APPLET 1 IS TRIGGERED*** + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result = response.checkSw("9000"); + //***TEST CASE 1: 4-APPLET 1 IS TRIGGERED*** + test.envelopeEventDownloadUserActivity(); + //***TEST CASE 2: 1-APPLET 1 IS TRIGGERED*** + response = test.envelopeMenuSelection("100101", "");//Help Request not available + result &= response.checkSw("9113"); + response = test.fetch("13"); + result &= response.checkData("D0118103 01218082 0281028D 0604"+Text1); + //***TEST CASE 2: 3-APPLET 2 IS TRIGGERED*** + test.envelopeMenuSelection("100102", "");//Help Request not available + test.reset(); + test.terminalProfileSession("09030100"); + + + + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10"+APPLET_AID_1+"0CCCCCCC CCCCCCCC CCCCCCCC CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10"+APPLET_AID_2+"07CCCCCC CCCCCCCC"); + + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/applet.opt new file mode 100644 index 0000000..aa77342 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_apt_epha.Cre_Apt_Epha_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_epha.Cre_Apt_Epha_1 +uicc.test.catre.cre_apt_epha +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/javacard/cre_apt_epha.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_epha/javacard/cre_apt_epha.cap new file mode 100644 index 0000000000000000000000000000000000000000..6900517eb5689ebd6797f5651bfafdce5711bffc GIT binary patch literal 3937 zcma)84Qy0Z7C!I3-}&tu+D@OXLn&MTNXvBkXYCKmSm+i@aS#yjXUlXtyDf#zI5Q=s z6&wa4RiwZuY5)z=XoT2`iX^B}ezMe*CDFv)L~9nL*E`&7}`?`D)8`0#_lrI~wHFRZu}UwFQCLH5Nf{SzC+aaKN2-gWof z%ioS1+j?IHn;*}5Ce|3cx2?bZqeCl5k8%3Oue0;b+pBJ5_O56v*dq-0$DfR!yxYC* z;_4lT4$Lb1lzI03AeD`H+ip57a;_6tSydIvhr*3wQ?!SUIAhd~eJ3r)J?g z75%4k2ZL+;5z5EHJtX~93^34=K1F~b52hcr%Q-MM2RW(e=UuQi7zibJIjGV4^9n){ zM%<5GD}z>~*)R=fVQLYWbX#_P)w$e{%Ty{+^tru0&=rn&yCR-IU=8&IkN#E&lAsV2 zAW;;sQ(@?sje;a#k2egMm;sp0gw7d+m=%BX=r#ZWz{TJm0Z19H5xR%=xQC7n>4t~h z+(jquN{UXy*LcHWYOw%C^-*AfF;eP*O$1^RV~mM_v*aewS<uYX@Z1y#Vs;JjKDe6~|rM zAUkgxhklfM`5*qTP2I?k8ROL2J5wVkC^h8q}!Cxt|SwkyZ`e8d*igV?t zI7HYX5+4x2dPnX616HMmT6i10L+X`H7t1l*BSL2Hupc#S$sC~^@Z^V9>VnAD@LxE+c{>JhqS5k`u|NC{ADvDitXD9*ZRrZ=}Q5(BWT`_-Z9gCp3`|7R1RU z;JP&`MNmz4srmlrk3Ya!D*8De@&9IF0F!G+po_i~225a~YA)a5uyHIAiAm(~ztKQD z*1!@Y&PqnshQEzeLt-|Dyb=o5g%vT{#ya3qKu+L^#wyM=d|eBnoUKoz)ntsYwg^%={CH#ZouEEh z5^2G;RgMb&oo;Zo=Fy^SpJWw1F6lL0^FV7Uv@ftqAsF;hXx?Kjh4y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qXicSiou1odD`3giX^D0L|#!a zb2qh}6v8qwhfR>69ZAw+qPZ>Uk86`defF0YIvIn*#dz8qv|x*GC8uPfDuY015`-WN zMnjW`8DqF7G@TrQEUH?2V6v5UL5EoM2;{nYAZ2Eb)h3i%ZF$|G=5)hlIhzUXrI2av zU{|0ejX*mz;^HWz;&)VM6}kY0S|bpl-C*|5wu)UaL|AMNf8$pQ_&on56RRX}!&Iw; zQzO7|&~b?gi!qsmOi~k=q#={^oXtWa6EVW{Oc?qTtq~RxyCEaSgbfLon22LcM9yT) zB*r8o#)P2`nPhZ`6ETsjsIfhFTLSTCsE-%PdL#81U z8#49xN-!-eyO+Q;YuS)IwrpISGPVSTFF}eZ2xU_zuP)pOwzV*We?piP0y$_YO&Ity zFwPR6JE7@F-e7sndrPc1lS>JTu`S;i^aNYIHLY4(Y?sMcM|lM$4CJxuXD`B`?(3?2 zyyedty5M5m)h*hp`93^MT77HyhE}j(&$`ll>|l3Wa*M(k+U+AL-c;PDnR!44Hr1$CGH=fy_z;pS)*=Pn$V*my#N_jxcM|0|#=8YP8d zi+wAxlULXuRH6#QML2fTa(6wUnGo+I6Z;U}M-z}3 z5B(t?_wfSm7-I>joH)|;;QI484qhr61&^Q3dUSm;j-x+qGK#J%&3YI5A{=)i$wpo1 iO0wRCzFx*%yl2=&a`klAi`eu5q~K4+B-X?}=HCDZXqqtq literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/Cre_Apt_Etex_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/Cre_Apt_Etex_1.java new file mode 100644 index 0000000..e7205ce --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/Cre_Apt_Etex_1.java @@ -0,0 +1,139 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Etex_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_etex; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_TIMER_EXPIRATION + * + * + * + * + * + */ + + public class Cre_Apt_Etex_1 extends TestToolkitApplet{ + + private byte testCaseNb = (byte) 0x00; + private static boolean bRes; + private static byte a; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'1'}; + + //Constructor of the applet + + public Cre_Apt_Etex_1(){ + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Etex_1 thisApplet = new Cre_Apt_Etex_1(); + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + //register to EVENT TIMER EXPIRATION + try{ + + for(a=0; a<(byte)8; a++){ + thisApplet.obReg.allocateTimer(); + } + for(a=2; a<(byte)9; a++){ + thisApplet.obReg.releaseTimer((byte)a); + } + } + catch(Exception e){ + } + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + //Checks if the applet is registered to the event + bRes=thisApplet.obReg.isEventSet(EVENT_TIMER_EXPIRATION); + + } + + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + + + if(event==EVENT_TIMER_EXPIRATION){ + + switch(testCaseNb){ + + case (byte)0x00: + //TEST CASE 1: Store the result of the test if the applet is registered to the event + testCaseNb=(byte)0x01; + reportTestOutcome(testCaseNb,bRes); + bRes=false; + //TEST CASE 2: The applet has been triggered and it's deregistered to the event + testCaseNb=(byte)0x02; + try{ + obReg.releaseTimer((byte)0x01); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + reportTestOutcome((byte)0x03,true); + break; + case (byte)0x02: + //TEST CASE 3: The applet must not be triggered in this case + //if the applet is triggered then the test is failed + testCaseNb=(byte)0x03; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + break; + case (byte)0x04: + //TEST CASE 5: The applet is triggered after the registration to the event + testCaseNb=(byte)0x05; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + } + } + + if(event==EVENT_MENU_SELECTION){ + //TEST CASE 4: The applet is registered to the Timer Expiration event + testCaseNb=(byte)0x04; + try{ + for(a=0; a<(byte)8; a++){ + obReg.allocateTimer(); + } + for(a=2; a<(byte)9; a++){ + obReg.releaseTimer((byte)a); + } + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + + } + + } + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/Test_Cre_Apt_Etex.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/Test_Cre_Apt_Etex.java new file mode 100644 index 0000000..496182c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/Test_Cre_Apt_Etex.java @@ -0,0 +1,81 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: UICC CAT Runtime Environment Applet Triggering +// EVENT_TIMER_EXPIRATION +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_etex; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Etex extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_etex"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Etex() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("29010000 01"); + //***TEST CASE 1: 1-APPLET 1 IS REGISTERED TO EVENT_TIMER_EXPIRATION*** + //***TEST CASE 1: 2-APPLET 1 IS TRIGGERED*** + test.envelopeTimerExpiration("240101"); + //***TEST CASE 2: 1-APPLET 1 IS NOT TRIGGERED*** + test.envelopeTimerExpiration("240101"); + //***TEST CASE 2: 1 IS REGISTERED TO EVENT_TIMER_EXPIRATION*** + test.envelopeMenuSelection("100101", "");//Help Request not available + //***TEST CASE 2: 2-APPLET 1 IS TRIGGERED*** + test.envelopeTimerExpiration("240101"); + + + // check results + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10"+APPLET_AID_1+"05CCCCCC CCCC"); + + + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/applet.opt new file mode 100644 index 0000000..5cbc617 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_etex.Cre_Apt_Etex_1 +uicc.test.catre.cre_apt_etex +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/javacard/cre_apt_etex.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_etex/javacard/cre_apt_etex.cap new file mode 100644 index 0000000000000000000000000000000000000000..6b7abaf488bde8d16638a4b7f5cb8456da5d1a6a GIT binary patch literal 3144 zcma)84NOy46h7~#eXlKOmBI>$Kn0ZPG#6p8?i!Me=dBkF&&+=F%mRZ0k z4uq+3F6taC3p!?<8WX46lx@Z-5;lqGoWtoPb8aKz{@jlnJGYzGzG(99>zCVi@44qY z=iGbGdA2-;H2{y#n7WJ^@IW&F3)Xo>mZ`bA9sTS?5h1*K)6FOS~ui@#C7-4@NCh2``tKwk$a~)v!-DxMy>9MNG%-o{L?!ls8wj z{c_lHa@#sfQsUrIt;Hh5w0b`|_^HtRclGWwHFtN-zvb1uR&sG|abwZ0w8G8#N7KCn zX|=JPTe3%_?)P$%2Y&nZS##b~Z5J12Y`>IqG9h}_nZ5mky|;_@UESMSac*L9!L<^4 z)6N;&N7e0|O~2Gx{Pt&~yFa)v`b5|Kl%$hk)`306eVJ=+w9k$T?xpDk{x>o*J1;Nj8*ct#=<{FaY#1@<%kSL0JWzh8 zB5o+>+%jkWs-L~8gr9>axY*8$lYP+UanZC80_( zJM5B2FgrZLa=R!k7bM|DbGiKmyTk4&H7^kCrGh8bVHYWgxzar{MA0lz`ZiRc0o4e$ zjW+xrN>vtrDA|Og1WzE8QDr+lf)uv%8CMvZgW167Y(j-oiO2{mTKe*4vElpru86dL2QS5*-!)DV^B18M}c zgubJWhI*dT)^oBwE=}xQ=tBtt<>9vq(h7Geq2Z`n1~PqfU@g$l?+b(L82ZV+xs(fN zT5oIy-pDjU4L`jVn9OEiQ)7*Bti>3Y+ytuFCQzf_oM?z`pjs%<^66gSSj+P`hJW!ylKN8vQSx6q)~ga~L{H$?ShR-{p24QLp|76w}j4_b9P4(fGe5pw8in8Y}}Zl$yz zszAhmurLPuMTq4_wh@f`!3(-32qUsaRU`N*Ho(W?yQrB;hDG|mlu^y1tT@rAZiK*! zd&|WLBi{&Q(S6xCJ-2eHkqZcNVub(Uo_-(jG}8YlN56ZxAvK|A=2p#H7mNTvKx&Gz zGqYH-OHN0QQ*Z^gl*hC{5(32l|KDX!n1-7xJ2+)OR_?GN1%Yy^LZNJt8*`)6T}e)l z2J=sZX+nHrq#=?SMMsV0!no1=_{lJn<9W4~4P#l2O3m;*%c>bYtI@H^469RdJfqgC z8T^IwWSS$>JdTD&W5?;Cj~mcDf+rEmqLD3BIXq4glP0lHM{Wk*4F*HP)Y0{PJvS1_ z|C2~Z`)JZJK86Gcu&cxSYQi**jnY68K6nX%T*3}Wg?<#HARNZQc#`H(G6^vbF$v#N zU<#F{T9NPyrDqRMqYh9B%yd0%vE@;;0h9KEW=+YI`as=&F z7OG$&lWUh(tDtrh21=RsklH0Dkk_Ul!8XMN!Ad39E-y+!?SCrP9xPFE?ea1c)V`ik z8XS4ik#oqaN01`|PmHn+$huccP2WOvgN7JH~<|!JjVHPp1l1FD&IWe literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/Cre_Apt_Euev_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/Cre_Apt_Euev_1.java new file mode 100644 index 0000000..6f60306 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/Cre_Apt_Euev_1.java @@ -0,0 +1,121 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Euev_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_euev; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering EVENT_UNRECOGNIZED_ENVELOPE + * + * + * + * + * + */ +public class Cre_Apt_Euev_1 extends TestToolkitApplet{ + + private byte testCaseNb = (byte) 0x00; + private static boolean bRes; + private static byte[] menuEntry ={(byte)'A',(byte)'p',(byte)'p',(byte)'l',(byte)'e',(byte)'t',(byte)' ',(byte)'1'}; + + + + //Constructor of the applet + + public Cre_Apt_Euev_1(){ + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Euev_1 thisApplet = new Cre_Apt_Euev_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to the UNRECOGNIZED ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + //register to EVENT MENU SELECTION + thisApplet.obReg.initMenuEntry(menuEntry,(short)0x00,(short)menuEntry.length,(byte)0x00,false,(byte)0x00,(short)0x00); + + bRes=thisApplet.obReg.isEventSet(EVENT_UNRECOGNIZED_ENVELOPE); + } + + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + + + if(event==EVENT_UNRECOGNIZED_ENVELOPE){ + + switch(testCaseNb){ + + case (byte)0x00: + testCaseNb=(byte)0x01; + reportTestOutcome(testCaseNb,bRes); + //TEST CASE 2: THE APPLET IS UNREGISTERED TO THE EVENT + testCaseNb=(byte)0x02; + try{ + //deregister to the EVENT_UNRECOGNIZED_ENVELOPE event + obReg.clearEvent(EVENT_UNRECOGNIZED_ENVELOPE); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + reportTestOutcome((byte)0x03,true); + break; + case (byte)0x02: + testCaseNb=(byte)0x03; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + break; + case (byte)0x04: + //TEST CASE 4: THE APPLET IS TRIGGERED + testCaseNb=(byte)0x05; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + } + } + + //event EVENT_MENU_SELECTION + if(event==EVENT_MENU_SELECTION){ + //TEST CASE 3:THE APPLET IS REGISTERED TO THE EVENT + testCaseNb=(byte)0x04; + try{ + //register to the EVENT_UNRECOGNIZED_ENVELOPE + obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + bRes=true; + } + catch(Exception e){ + bRes=false; + } + reportTestOutcome(testCaseNb,bRes); + + + } + + } + + } \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/Test_Cre_Apt_Euev.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/Test_Cre_Apt_Euev.java new file mode 100644 index 0000000..c767791 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/Test_Cre_Apt_Euev.java @@ -0,0 +1,79 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: UICC CAT Runtime Environment Applet Triggering +// EVENT_UNRECOGNIZED_ENVELOPE +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_euev; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Euev extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_euev"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Euev() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Position of the first menu entry + "01" + // V Identifier of the first menu entry + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + // test script + test.reset(); + test.terminalProfileSession("FFFFFFFF FFFFFFFF FFFFFFFF"); + //***TEST CASE 1: 1-APPLET 1 IS REGISTERED TO EVENT_UNRECOGNIZED_ENVELOPE *** + //***TEST CASE 1: 2-APPLET 1 IS TRIGGERED*** + test.unrecognizedEnvelope(); + //***TEST CASE 2: 1-APPLET 1 IS NOT TRIGGERED*** + test.unrecognizedEnvelope(); + //***TEST CASE 2: 1 APPLET 1 IS REGISTERED TO EVENT_UNRECOGNIZED_ENVELOPE *** + test.envelopeMenuSelection("100101", "");//Help Request not available + //***TEST CASE 2: 2-APPLET 1 IS TRIGGERED*** + test.unrecognizedEnvelope(); + + + // check results + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10"+APPLET_AID_1+"05CCCCCC CCCC"); + + + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/applet.opt new file mode 100644 index 0000000..77eb50c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_euev.Cre_Apt_Euev_1 +uicc.test.catre.cre_apt_euev +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/javacard/cre_apt_euev.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_euev/javacard/cre_apt_euev.cap new file mode 100644 index 0000000000000000000000000000000000000000..78537e5928abff6200d47411f70a97d92cdc44e5 GIT binary patch literal 2978 zcma)74Nz276h7}~_q~07}gVBtJ<4btxJhe}Se$Lo>^Y-V14fcb# z#-ClXPiOB+Zo5)&SxBxueqcndDei3C$G4l<%ni=AKT{VTI=6XiL-#SywlkA^!M>J1 z9lF@59knoCySE|u(zqa9(E0LZ>zAop4R_NQjXUsL%!re}CoJ1&xw&i9k)Ikir(A!t z=kzz*uJ>F>Z@yFX-t6)7zgyw0tm@pyo>=h1+Sv|6sN~w{)&*}IJ>@^Vt~Kk!oOgnm zYnyaaD!Z3VW6!+GelqLRg55WVEP8k3no!Hkyhii(jFy4-S6BD#%^GUU5zpUlpOIB^ zc31K=S4qb@_to?Ftw(fk?yDJ$V;zZMxBS;m(ZpVWYn6-u0eK zW%pL>>}oB2ar?X-6BgHByn3>~GnH-bE^oUd%wfX%o$2Rt1J|gcubt(k-g`5j`Q^Dk zPD;JChflZmHtda?`dX3G!SS&L`x{nL0B2YLCx%Uk1dD{N*mTNi!CwSvh$@fUZ3~G0 zfX(d+_(YrACoXkKfu&-VSZynFRlD3SUx_VGbd`v{RJTi_VA%H^;XaCHfzt0m13J)z zv21W+JDRG?d*FOB_7Y4+sH2+Y@rmw$*Y^rxqhTZrLl_|gCV>g=LjsVSw+a}bfM+QM zW%Kwo_8~Ya!C2S^0$jrS1_-p?ya}{srV(oR zi7h~9ZUQECxY@#Hn=RHRV23w>W_UeCH`BlYHdX`AAhs}Ant9-~84pK^S8AA17P?$I z2!5!*O|oFXIuEhf%r=7gAk>1c31ZBeMreOvlV)+5q)Q>IC0d@LWpSP~#;k3Oxckw7 zG}z2H0$KE^%cAGXN1M4vCL^Q&HdzxLGHY?$R5Jh&ko%)9Wb*>9fXAKd5i24d%fypL7<*$uDE=*7iG!gtt7$I;Znmei!LEPfe~m^JQvFi zqD_#*@mhh6WqFR(3G8SlM#J%pR?sr|rzh>`t#tQab=2TC2&N#^oqCq&cl$gN>Jr&W z46Gu$fCtAfMAz|kTsR`JR#MSH8pvY`G7!S>C!s`Qp>&XlQaF>e@sclt39vmfEfy6n zF&xHu$%rIuSz#>xe}YQWlqS7S>Ddn^QirG{W|E%Hb~-59h;sNa3qLOOBnwBE|I5k5 zihwVGl>bT!vX$d_N_8HRQ-spGG7reslhIA;tVd-9C4o})WrDX<6UaG0X94rE#Ss%f_oz8CoUxfEfIE^m7A8e*F!E=^elT literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/Cre_Apt_Genb_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/Cre_Apt_Genb_1.java new file mode 100644 index 0000000..43a3f86 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/Cre_Apt_Genb_1.java @@ -0,0 +1,114 @@ +//----------------------------------------------------------------------------- +// Cre_Apt_Genb_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_apt_genb; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + + +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + + +/** + * Test Area: UICC CAT Runtime Environment Applet Triggering General behaviour + * + * + * + * + * + */ +public class Cre_Apt_Genb_1 extends TestToolkitApplet{ + + private byte testCaseNb = (byte) 0x00; + private static byte nIndex = (byte) 0x00; + private static boolean bRes; + private static boolean bRes1=true; + + //Constructor of the applet + + public Cre_Apt_Genb_1(){ + + } + + + //Method called by the JCRE at the installation of the applet + public static void install (byte bArray[], short bOffset, byte bLength){ + + //Create a new applet instace + Cre_Apt_Genb_1 thisApplet = new Cre_Apt_Genb_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + // Initialise the data of the test applet + thisApplet.init(); + //register to the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + bRes=true; + + nIndex=(byte)0x01; + } + + + //Method called by the UICC Toolkit Framework + + public void processToolkit(short event){ + + + if(event==EVENT_EVENT_DOWNLOAD_USER_ACTIVITY){ + switch (nIndex){ + + case(byte)0x01: + nIndex=(byte)0x01; + bRes1=false; + break; + + case(byte)0x02: + testCaseNb=(byte)0x02; + bRes=true; + reportTestOutcome(testCaseNb,bRes); + nIndex=(byte)0x03; + testCaseNb=(byte)0x03; + reportTestOutcome(testCaseNb,bRes); + break; + + case(byte)0x03: + testCaseNb=(byte)0x03; + bRes=false; + reportTestOutcome(testCaseNb,bRes); + nIndex=(byte)0x03; + break; + + case(byte)0x04: + testCaseNb=(byte)0x04; + bRes=true; + nIndex=(byte)0x04; + reportTestOutcome((byte)0x01,bRes1); + reportTestOutcome(testCaseNb,bRes); + break; + + } + } + } + + public void process(APDU apdu) { + if (selectingApplet()) { + /* update the counter */ + super.process(apdu); + nIndex++; + } + else { + ISOException.throwIt(javacard.framework.ISO7816.SW_INS_NOT_SUPPORTED); + } + + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/Test_Cre_Apt_Genb.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/Test_Cre_Apt_Genb.java new file mode 100644 index 0000000..5407413 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/Test_Cre_Apt_Genb.java @@ -0,0 +1,119 @@ +//----------------------------------------------------------------------------- +// Package Definition +// Test Area: UICC CAT Runtime Environment Applet Triggering +// General behaviuour +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_apt_genb; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; + +public class Test_Cre_Apt_Genb extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_apt_genb"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + public Test_Cre_Apt_Genb() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result; + + // start test + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applets + test.loadPackage(CAP_FILE_PATH); + + //***TEST CASE 1: 2-APPLET 1 IS REGISTERED TO EVENT_EVENT_DOWNLOAD_USER_ACTIVITY *** + //***THE APPLET ISN'T IN SELECTABLE STATE: APPLET ISN'T TRIGGERED + response = test.installInstallApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + + "8008"+ // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + result = response.checkSw("9000"); + + // test script + test.reset(); + test.terminalProfileSession("01010000 20"); + + response = test.selectApplication(APPLET_AID_1); + result &= !response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("01010000 20"); + + response = test.envelopeEventDownloadUserActivity(); + + + //***TEST CASE 2: 2-APPLET IS IN SELECTABLE STATE:APPLET IS TRIGGERED *** + //*** + //**** INSTALL THE APPLET IN SELECTABLE STATE + response = test.makeSelectableApplet(APPLET_AID_1); + result &= response.checkSw("9000"); + response = test.selectApplication(APPLET_AID_1); + result &= response.checkSw("9000"); + + // test script + test.reset(); + test.terminalProfileSession("01010000 20"); + + response = test.envelopeEventDownloadUserActivity(); + + //***TEST CASE 3: 2-THE APPLET IS IN LOCK STATE: APPLET ISN'T TRIGGERED *** + response = test.lockApplication(APPLET_AID_1); + result &= response.checkSw("9000"); + response = test.selectApplication(APPLET_AID_1); + + result &= !response.checkSw("9000"); + + test.reset(); + test.terminalProfileSession("01010000 20"); + + response = test.envelopeEventDownloadUserActivity(); + + //***TEST CASE 4: 2-APPLET 1 IS REGISTERED TO EVENT_EVENT_DOWNLOAD_USER_ACTIVITY *** + //***APPLET IS IN UNLOCK STATE:APPLET IS TRIGGERED + + response = test.unlockApplication(APPLET_AID_1); + result &= response.checkSw("9000"); + response = test.selectApplication(APPLET_AID_1); + result &= response.checkSw("9000"); + + // test script + test.reset(); + test.terminalProfileSession("01010000 20"); + + response = test.envelopeEventDownloadUserActivity(); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10"+APPLET_AID_1+"04CCCCCC CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/applet.opt new file mode 100644 index 0000000..7b4801b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_apt_genb.Cre_Apt_Genb_1 +uicc.test.catre.cre_apt_genb +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/javacard/cre_apt_genb.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_apt_genb/javacard/cre_apt_genb.cap new file mode 100644 index 0000000000000000000000000000000000000000..89c50ab1703ac40a6577470bda0fb9f82e1e13af GIT binary patch literal 4075 zcma)83v5%@8UF9XzP95AH!qwQ2{eSzKpdwOGP0y~oTQ|AV3IVY2`|UFNlYBu*f%_) z2qh_{bP12b0wQe(twvk=n!3`8ssv?QHFa!4tI#^s(FffoQA7}J*9ocH*mq14*H;kT zd-eMqpL@>tKhFPh)d*q|8Sq|zs&g6r=t&}x>MENYORMXvY;}(M>Z;1drh>Yv|D7Xx zv!QkMlZ8n;7hQhnUu&|?wQPMiu;;no6gw|{m47n0Hf_a3!{Ny}Ko!R~dJ=N@=}RpRbfD{Fr@I+0v)^WSUBMwa~St>((1!wY`y-T9~FYoUKE ze6hDD?d5Mi+&1Bw|J&ek<#oqLqq`h=^S?Z5T7KZn*zbie!q-Bn?!b`~zrHs4-Hp8g zYP`06oB3H`(MZOs*DpO^?|FHy^XcMGjx-+~ef9Kz$IJdwcc}Er+X+7ueKu^!alSB; zb}S>y_F>BTuPz>5FZHjvX&?Ob{8-KK#OeJ5NAfOS`Tp_B=BrO1yF6}5Sg3LUf9Q)QWS+?VEjgx0j9(pbL%}2+F56P{ru}iP){B+mE$9 z=ZTv5(#v1#Ha|F7^4)*p0%NWVH_25a84B9^*R^v*Yed3-K{Q3~huzf0C6!ex@sCj< zsMqW9*c3Ue*gS3}B-=b8d80e1Z0wZ%ZMMzst!|Gy)NWfPyW8bZfyW)>XvOE}ZcXyM zNSx(30F0!&h36R;<{7i0#mcd7=^OiVaD>qVpxI7F<*4w6WRDUE?O>wtG@n+0lE_YF zG><*%0fVZ&T}V5D7nM=6(?Iv8~hPk09i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zM&b7SB<@8Z%{%w&%8hW0SPSAMg~~+Z_SP;q*#mi3p8|DI5`3=L<=JHizpjpQH6Y zNE)BB$`O=^vys4dJMpbH(kyiQ+@S|al{;$%388j(kmf9j*?xxuM7-H$B)VBc@p?(j zZME5L5TkKc1_F*Q5}ixi+JaJuI6KBmB;UqRJL#E@kq{(z1pF>37##70gj_q=)zW6k z7b3yAObQaWnv6bw$krL`s@dw2I#^24v?X^4Q=NV3=!!BL=Zxd{2G|uVkSUHJ^G%{s zT!zh!%+j*{h}4qv3*}mkMk%5P@bd20ksg2SNg@MV&Lhz{EW=MSW?9y$$czaQnWDui z3)UHE3Z)MqwzEgYbGM;CQ%;d z^O1H|93SQ*(I#RJiOnOgHIx}O;~?@|7JHDV$&>*@pJi5M(pE}R!K6%jBs!Q58(BXq z$07|?KxG;|1Y0IiHDqK{4Nb@4u$FS5dJ$C5p~c93D>Xp*Txvuedw`Zw88}Y;*^DWOv72W2ocIdWMoLVY#z?483^OBf@p0N zlC@DtS|dm_N0BHVL844XqFhGeK^X}fyq=7HlmSWA&=o;tCh9pmb3ZI2Q7j8cK}eiBpg%Y+rgZYxUZ%3DZG z`aD&l=Ev?NO6kfQMojvv2}_UmpXhxpWgT|zvKv7Q2bj68OsX}@DjHxh-iKMwKd*2g#Ugw4R4@J YB^IaAlUh@~8o?#G>`DM}Ict^le<%&66#xJL literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Cre_Exh_Imtg_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Cre_Exh_Imtg_1.java new file mode 100644 index 0000000..21b8a1f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Cre_Exh_Imtg_1.java @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_exh_imtg; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +import uicc.toolkit.*; +import uicc.test.util.* ; + + +public class Cre_Exh_Imtg_1 extends TestToolkitApplet { + + + /** + * The Constructor registers the application for the Event. + */ + + private Cre_Exh_Imtg_1() { + } + + + /** + * This method will be used to install the Applet. + */ + + public static void install(byte[] bArray, short bOffset, byte bLength) { + Cre_Exh_Imtg_1 thisApplet = new Cre_Exh_Imtg_1(); + + // Register the applet with the JCRE. + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + //register to EVENT_STATUS_COMMAND + thisApplet.obReg.requestPollInterval((short)POLL_SYSTEM_DURATION); + //register to EVENT_PROFILE_DOWNLOAD + thisApplet.obReg.setEvent(EVENT_PROFILE_DOWNLOAD); + //register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + //register to EVENT_EVENT_DOWNLOAD_MT_CALL + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_MT_CALL); + } + + + /** + * This method will be used to trigger the tests. + * The application will be triggered by an Formatted SMS PP download event. + * @param event + */ + + public void processToolkit (short event) throws ToolkitException { + byte testCaseNb = (byte) 0x00; + boolean bRes = false; + + + if (event == EVENT_PROFILE_DOWNLOAD) { + + /*------------------------------------------------------------------ + * TC 01: Throw NullPointerException for EVENT_PROFILE_DOWNLOAD + *----------------------------------------------------------------*/ + testCaseNb=(byte)0x01; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + throw new NullPointerException(); + } + + if (event == EVENT_STATUS_COMMAND) { + + /*------------------------------------------------------------------ + * TC 02: Throw NullPointerException for EVENT_STATUS_COMMAND + *----------------------------------------------------------------*/ + testCaseNb=(byte)0x02; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + throw new NullPointerException(); + } + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + /*------------------------------------------------------------------ + * TC 03: Throw NullPointerException for EVENT_UNRECOGNIZED_ENVELOPE + *----------------------------------------------------------------*/ + testCaseNb=(byte)0x03; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + throw new NullPointerException(); + } + + if (event == EVENT_EVENT_DOWNLOAD_MT_CALL) { + + /*------------------------------------------------------------------ + * TC 04: Throw NullPointerException for EVENT_EVENT_DOWNLOAD_MT_CALL + *----------------------------------------------------------------*/ + testCaseNb=(byte)0x04; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + throw new NullPointerException(); + } + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Cre_Exh_Imtg_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Cre_Exh_Imtg_2.java new file mode 100644 index 0000000..72728a9 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Cre_Exh_Imtg_2.java @@ -0,0 +1,102 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- + +package uicc.test.catre.cre_exh_imtg; + + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- + +import uicc.toolkit.*; +import uicc.test.util.* ; + + +public class Cre_Exh_Imtg_2 extends TestToolkitApplet { + + + /** + * The Constructor registers the application for the Event. + */ + + private Cre_Exh_Imtg_2() { + } + + + /** + * This method will be used to install the Applet. + */ + + public static void install(byte[] bArray, short bOffset, byte bLength) { + Cre_Exh_Imtg_2 thisApplet = new Cre_Exh_Imtg_2(); + + // Register the applet with the JCRE. + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + //register to EVENT_STATUS_COMMAND + thisApplet.obReg.requestPollInterval((short)POLL_SYSTEM_DURATION); + //register to EVENT_PROFILE_DOWNLOAD + thisApplet.obReg.setEvent(EVENT_PROFILE_DOWNLOAD); + //register to EVENT_UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + //register to EVENT_EVENT_DOWNLOAD_MT_CALL + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_MT_CALL); + } + + + /** + * This method will be used to trigger the tests. + * The application will be triggered by an Formatted SMS PP download event. + * @param event + */ + + public void processToolkit (short event) throws ToolkitException { + byte testCaseNb = (byte) 0x00; + boolean bRes = false; + + if (event == EVENT_STATUS_COMMAND) { + + /*------------------------------------------------------------------ + * TC 01: EVENT_STATUS_COMMAND + *----------------------------------------------------------------*/ + testCaseNb=(byte)0x01; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + } + + if (event == EVENT_PROFILE_DOWNLOAD) { + + /*------------------------------------------------------------------ + * TC 02: EVENT_PROFILE_DOWNLOAD + *----------------------------------------------------------------*/ + testCaseNb=(byte)0x02; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + } + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + + /*------------------------------------------------------------------ + * TC 03: EVENT_UNRECOGNIZED_ENVELOPE + *----------------------------------------------------------------*/ + testCaseNb=(byte)0x03; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + } + + if (event == EVENT_EVENT_DOWNLOAD_MT_CALL) { + + /*------------------------------------------------------------------ + * TC 04: EVENT_EVENT_DOWNLOAD_MT_CALL + *----------------------------------------------------------------*/ + testCaseNb=(byte)0x04; + bRes = true; + reportTestOutcome(testCaseNb, bRes); + } + + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Test_Cre_Exh_Imtg.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Test_Cre_Exh_Imtg.java new file mode 100644 index 0000000..501323d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/Test_Cre_Exh_Imtg.java @@ -0,0 +1,131 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_exh_imtg; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Exh_Imtg extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_exh_imtg"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Exh_Imtg() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Trigger applets with Terminal Profile + test.reset(); + test.terminalProfileSession("01010000 03"); + + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Trigger applets with Status command + response = test.status("00","00","16"); + result = response.getData().regionMatches(16, "3F00", 0, 4); + + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + + // Trigger applets with unrecognized envelope + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Trigger applets with unrecognized envelope + response = test.envelopeEventDownloadMTCall(); + result &= response.checkSw("9000"); + + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "04" + "CCCCCCCC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "04" + "CCCCCCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/applet.opt new file mode 100644 index 0000000..56ac7ce --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_exh_imtg.Cre_Exh_Imtg_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_exh_imtg.Cre_Exh_Imtg_1 +uicc.test.catre.cre_exh_imtg +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/javacard/cre_exh_imtg.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_exh_imtg/javacard/cre_exh_imtg.cap new file mode 100644 index 0000000000000000000000000000000000000000..696a95fc89830341780610d68139d1e82b560b0d GIT binary patch literal 4512 zcmbtX4Nz3q6+Z9n+h108g%ydg1W*YP-GvpRl)vF$%8wKfH4w?}@?h5mmf3w0VJea} zwILYoBr}p^GOf-?#l+OHvD$QEs-01rq-mz5>9irKt?8t8+AwC)AInTbzq_z3`%IY4 z^u0N|ch9}|obR4q{GIsw$gXEcI2N zzeV)Qvu)l$wrS*M&0WKR4^p1GaO>9W$IoSKoO;fEvHI6nuI4rOPZgn=3X>=eBFxOP}nxcujpH{kHx1HP=S|`BT#^S2tAd zN#1qr`}Q^QZ}5k0D+TjJ^FICu>m*)V-1EkP^Gz{R`#;LRVHr>RSL@#@5?(u9c=t~+ zR|LcBI}iVT#ii#jpZDDO?9($hB&RFBa&}_iA7hh~!ki8ubxcUq)x8-@!&|)yF=5_6 zI^4Zdw{@?5!0xpBI<4D8d#C8LIPLu$ZTZ7nbD!|MK%DUe1ZYV)hi9}Az`?t(gq1;fN2;M*_QZf`)Sdh>;Z(C9od5-_H=K znD5J>eU5a9e5!t&r+|jj1=LHqGhuF|_SrRtZX5P7irz)_qU7>+GWBYNA7@NFLdqd! z&M}HDIzqf9DbXyHCYsleks@h~grq~nALU7^CB_2y?xBdTEv)UtyZf&0-|)KO3(`$tyY(y z5R3}J5d74Hn5$!B4UrfOTVASt0r(i@f}%TPh3I$s-2KRU3_=WzvjoE{uwU^wAJ7EU za{(|i2&o>A7WF!lir5g>pc;TX*cd4yF>=e~k}cVPjdHITTt>^kjy-8X+FPGeB=%bD}I!`SOU9z_FnNZug_y`cG-QR z-O(eGd0yze80&(#nm$SNb=jR?G9AjKeo_^>``l77DKZ~yB|&nz{j{kr4D$=>aU{Y5 zQoC7J?&%?QW?NZv8N{d@r9Pj1kodMTQaiS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re/cre_hin_erhd/Cre_Hin_Erhd_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/Cre_Hin_Erhd_1.java new file mode 100644 index 0000000..7ec173b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/Cre_Hin_Erhd_1.java @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------------- +// Cre_Hin_Erhd_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_hin_erhd; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; +import uicc.toolkit.* ; +import uicc.test.util.* ; + + + +public class Cre_Hin_Erhd_1 extends TestToolkitApplet{ + + + + /** + * Constructor of the applet + */ + public Cre_Hin_Erhd_1() { + + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Cre_Hin_Erhd_1 thisApplet = new Cre_Hin_Erhd_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // register instance with the EVENT_EVENT_DOWNLOAD_USER_ACTIVITY event + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + } + + + public void processToolkit(short event) + { + + boolean bRes = false; + byte bTestCaseNb = (byte)1; + + try{ + EnvelopeResponseHandler envRespHdlr = EnvelopeResponseHandlerSystem.getTheHandler(); + if (envRespHdlr.getLength()==(short)0x0000){ + bRes=true; + } + } + catch (Exception e) { + bRes=false; + } + + reportTestOutcome ( bTestCaseNb, bRes ); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/Test_Cre_Hin_Erhd.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/Test_Cre_Hin_Erhd.java new file mode 100644 index 0000000..d700aa7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/Test_Cre_Hin_Erhd.java @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_hin_erhd; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Hin_Erhd extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_hin_erhd"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Hin_Erhd() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /** Testcase 0 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + test.reset(); + test.terminalProfileSession("0101"); + + /*******************************************************************************************/ + /** Testcase 1 At the processToolkit invocation the TLV-List is cleared */ + /*******************************************************************************************/ + + + // 1- Trigger AppletA1 + test.unrecognizedEnvelope(); + + response = test.selectApplication(APPLET_AID_1); + result = response.checkData("10" + APPLET_AID_1 + + "01CC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + // delete Applet + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/applet.opt new file mode 100644 index 0000000..ec9af31 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_hin_erhd.Cre_Hin_Erhd_1 +uicc.test.catre.cre_hin_erhd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/javacard/cre_hin_erhd.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_hin_erhd/javacard/cre_hin_erhd.cap new file mode 100644 index 0000000000000000000000000000000000000000..33805fcc0cdf0575639a4048a8cd2318d69415ca GIT binary patch literal 2737 zcma)7drVVT82|3=ZF^~PZLnYgK`U{nbJT(?AoyTBBG$4FoS-0D+Ka72TFcc<%oZLK zMtJzz$WVj2;D$zH7Ts_@HveF&ad8vI<||JBSh5#pxHv}E#O^ypckRiR+;j8GJ@?#u zf4}p6-#Ncyw<W$O@>k_NUszONw&fHR7UY+#O0g9@x&m;r_^YDk zWrjQZ#&oAgzPJ|qx47-?&4XpReOs*0`aH>>G$WI;t9#z*@4r)dcT@6%n31(@>w0SP`MpO@cf{Gc+c#ECNq%Ex^Y@He zQ#!T(&WW>U_{j5o#+GNSTR$u9JNo8C^b(E9@>_ofF89`JT~Vov0zdzF?B)7Rt9s*>Zm%yM=Aj`%E`G4W9LgTk4S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o}el)q|r zPqkhBMp}G^PV-<@@69Z_Z>ISvnY(AN<4_3K)Anb{Yqs6g|A_Jb1=4MjB6go)Pk`r!Z;RV z3`?Mt2NT%}&$dK(9)zK99{lzgkM|DX3lvu1g9kU$={?=sEMXjA7frFhUNfIBX*;GPnFP*Y)+i3+LzVm6kd)r=};8DHx%7hpZ)|IKZ5p0N=zcJnm_`uwp_ z6hD;A|17x0K2*3xX5fdoVQJX3tbOxqSiyl-P-tc?G1Zb%g_0_=Q$=p7P*X*Il4pNV zkYoYCr-oobk{tU)a7muWf=_ZVgyCy~4QvLH!2@piJM%>$q#ho_gU4a31ZtoTznI&g z9*=$#&S`=stkr1!%{aztHQ3V%?JS>2wV{Ljl2np1Ay_s;RQmRMau%xx5HG($DBewPg?!ohSk%#kX~J%&!p8y@%S6t9DR19x1mop(l)&Ki!o?p zCGpUU>obhB_&bKh)A@#8U4KKT)i0Qgx~{vg^(OT9Y1+iNWYmQ2cGa8E-*{;gEwWJ) XnfIT!RlqbAFoVbf3HSL0?J)lrNl%XR literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_1.java new file mode 100644 index 0000000..10e7a68 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_1.java @@ -0,0 +1,255 @@ +//----------------------------------------------------------------------------- +//CRE_MHA_ENHD +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_enhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + + +import javacard.framework.*; +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + + +public class Cre_Mha_Enhd_1 extends TestToolkitApplet +{ + + /** result of specific testcase */ + private boolean bRes = false; + /** number of testcase */ + private byte testCaseNb = (byte) 0x00; + private boolean handler_available = true; + /** */ + private final byte[] menuItem1 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ', (byte) '1'}; + private final byte[] menuItem2 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ', (byte) '2'}; + private final byte QUALIFIER_1 = (byte) 0x01; + private final byte[] ADDRESS_VALUE = {(byte) 0x81, (byte) 0x55, (byte) 0x66, (byte) 0x77, (byte) 0x88}; + private final byte[] BEARER_VALUE = {(byte) 0x03, (byte) 0x00}; + private final byte[] BUFFER_SIZE_VALUE = {(byte) 0x00, (byte) 0x01}; + protected byte service_id = (byte)0x00; + protected byte[] SERVICE_RECORD_VALUE = {(byte) 0x00, (byte) 0x00, (byte) 0x00}; + protected final byte[] fileEFtaru = new byte[]{ (byte) 0x01, (byte) 0x3F, (byte) 0x00, (byte) 0x7F, (byte) 0x4A,(byte) 0x6F, (byte) 0x03 }; + + + /** list included registered all events */ + private final short eventList[] = { + EVENT_EVENT_DOWNLOAD_MT_CALL, + EVENT_EVENT_DOWNLOAD_CALL_CONNECTED, + EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED, + EVENT_EVENT_DOWNLOAD_LOCATION_STATUS, + EVENT_EVENT_DOWNLOAD_USER_ACTIVITY, + EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CARD_READER_STATUS, + EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION, + EVENT_EVENT_DOWNLOAD_BROWSER_TERMINATION, + EVENT_UNRECOGNIZED_ENVELOPE, + EVENT_CALL_CONTROL_BY_NAA, + EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS, + EVENT_EVENT_DOWNLOAD_ACCESS_TECHNOLOGY_CHANGE, + EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED, + EVENT_APPLICATION_DESELECT, + EVENT_FIRST_COMMAND_AFTER_ATR, + EVENT_PROFILE_DOWNLOAD, + EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, + EVENT_EVENT_BROWSING_STATUS}; + + + + + /** + */ + private Cre_Mha_Enhd_1 () { } + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException + { + Cre_Mha_Enhd_1 applet = new Cre_Mha_Enhd_1(); + + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + //initialize the data of the test applet + applet.init(); + + //- Applet registration + //register to EVENT_MENU_SELECTION + applet.obReg.initMenuEntry(applet.menuItem1,(short)0,(short)applet.menuItem1.length,(byte)0x00,false,(byte)0x00,(short)0); + //register to EVENT_MENU_SELECTION_HELP_REQUEST + applet.obReg.initMenuEntry(applet.menuItem1,(short)0,(short)applet.menuItem2.length,(byte)0x00,true ,(byte)0x00,(short)0); + //register to EVENT_STATUS_COMMAND + applet.obReg.requestPollInterval((short)1); + //register to EVENT_EVENT_DOWNLLOAD_LOCAL_CONNECTION + applet.service_id = applet.obReg.allocateServiceIdentifier(); + applet.SERVICE_RECORD_VALUE[(byte)0x01]=applet.service_id; + //register to the resto of the events + applet.obReg.setEventList(applet.eventList,(short)0,(short)(applet.eventList.length)); + //register to file EF_TARU + applet.obReg.registerFileEvent( EVENT_EXTERNAL_FILE_UPDATE,applet.fileEFtaru,(short) 0,(short) applet.fileEFtaru.length, null, (short) 0, (byte)0x00); + //register to EVENT_TIMER_EXPIRATION + for (byte timer=(byte)0x00;timer<(byte)0x08;timer++){ + applet.obReg.allocateTimer(); + } + for (byte timer=(byte)0x02;timer<=(byte)0x08;timer++){ + //release timer from 2 to 8 to be sure that only timer id 1 is allocated + applet.obReg.releaseTimer(timer); + } + } + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + bRes=false; + testCaseNb+=(byte)0x01; + + if (testCaseNb==(byte)0x01 || + testCaseNb==(byte)0x10 || //tc 16 + testCaseNb==(byte)0x17 ) //tc 23 + {handler_available=false;} + + else if (testCaseNb==(byte)0x03 || + testCaseNb==(byte)0x11 || //tc 17 + testCaseNb==(byte)0x13 || + testCaseNb==(byte)0x18) //tc 24 + {handler_available=true;} + + + switch (event) { + //-- TC 1 + case EVENT_FIRST_COMMAND_AFTER_ATR : + testCaseNb=(byte)0x01; + checkHandler(); + obReg.clearEvent(EVENT_FIRST_COMMAND_AFTER_ATR); + break; + //-- TC 2 + case EVENT_PROFILE_DOWNLOAD: + checkHandler(); + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + break; + //-- TC 16 + case EVENT_STATUS_COMMAND: + try { + EnvelopeHandler envHdr = EnvelopeHandlerSystem.getTheHandler(); + } + catch (ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bRes=true; + this.reportTestOutcome(testCaseNb, bRes); + // Open Channel(1) proactive command for test case 17 + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + proHdr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short) 0, (short) 5); + proHdr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short) 0, (short) 2); + proHdr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short) 0, (short) 2); + proHdr.send(); + bRes=true; + } + } + catch (Exception exp) { + bRes = false; + this.reportTestOutcome(testCaseNb, bRes); + } + + break; + + //-- TC 19 + case EVENT_UNRECOGNIZED_ENVELOPE: + try{ + EnvelopeHandler envHdr = EnvelopeHandlerSystem.getTheHandler(); + //get the ProactiveHandler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + proHdr.init(PRO_CMD_DECLARE_SERVICE, (byte)0, DEV_ID_TERMINAL); + proHdr.appendTLV(TAG_SERVICE_RECORD, SERVICE_RECORD_VALUE, (short) 0, (short) 3); + if (proHdr.send() == (byte) 0x00) { + bRes = true; + this.reportTestOutcome(testCaseNb, bRes); + } + + } + catch(Exception exp){ + this.reportTestOutcome(testCaseNb, bRes); + bRes=false; + } + + break; + + + //-- TC 22 + case EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED: + try{ + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + EnvelopeHandler envHdr = EnvelopeHandlerSystem.getTheHandler(); + bRes=true; + } + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb, bRes); + break; + + //-- TC 24 + case EVENT_APPLICATION_DESELECT: + checkHandler(); + obReg.clearEvent(EVENT_APPLICATION_DESELECT); + break; + + //-- All other test cases + default : + checkHandler(); + break; + } + } + + /** + * Verify if the envelope handler is available or not + */ + + private boolean checkHandler() + { + bRes=false; + //handler shall be available + if (handler_available==true){ + try { + EnvelopeHandler EnvHdr = EnvelopeHandlerSystem.getTheHandler(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + } + //handler shall not be available + else { + try { + EnvelopeHandler EnvHdr = EnvelopeHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if(exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bRes=true; + } + } + catch(Exception exp) {bRes=false;} + } + + this.reportTestOutcome(testCaseNb,bRes); + return bRes; + } + + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_2.java new file mode 100644 index 0000000..ade5468 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_2.java @@ -0,0 +1,192 @@ +//----------------------------------------------------------------------------- +//Cre_Mha_Enhd_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_enhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; +import uicc.access.UICCConstants; + + +public class Cre_Mha_Enhd_2 extends TestToolkitApplet { + + /** result of specific testcase */ + boolean bRes = false; + /** number of testcase */ + byte testCaseNb = (byte) 0x00; + boolean handler_available = true; + private final byte[] menuItem1 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ', (byte) '1'}; + private final byte[] menuItem2 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ', (byte) '2'}; + protected byte[] SERVICE_RECORD_VALUE = {(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00}; + protected final byte[] fileEFtaru = new byte[]{ (byte) 0x01, (byte) 0x3F, (byte) 0x00, (byte) 0x7F, (byte) 0x4A,(byte) 0x6F, (byte) 0x03 }; + /** list included registered all events */ + private short eventList[] = { + EVENT_EVENT_DOWNLOAD_MT_CALL, + EVENT_EVENT_DOWNLOAD_CALL_CONNECTED, + EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED, + EVENT_EVENT_DOWNLOAD_LOCATION_STATUS, + EVENT_EVENT_DOWNLOAD_USER_ACTIVITY, + EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CARD_READER_STATUS, + EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION, + EVENT_EVENT_DOWNLOAD_BROWSER_TERMINATION, + EVENT_UNRECOGNIZED_ENVELOPE, + EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS, + EVENT_EVENT_DOWNLOAD_ACCESS_TECHNOLOGY_CHANGE, + EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED, + EVENT_APPLICATION_DESELECT, + EVENT_FIRST_COMMAND_AFTER_ATR, + EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, + EVENT_EVENT_BROWSING_STATUS, + EVENT_PROFILE_DOWNLOAD, + }; + + /** + */ + private Cre_Mha_Enhd_2 () {} + + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException + { + Cre_Mha_Enhd_2 applet = new Cre_Mha_Enhd_2(); + //initialize the data of the test applet + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + applet.init(); + + //- Applet registration + //register to EVENT_MENU_SELECTION + applet.obReg.initMenuEntry(applet.menuItem1,(short)0,(short)applet.menuItem1.length,(byte)0x00,false,(byte)0x00,(short)0); + //register to EVENT_MENU_SELECTION_HELP_REQUEST + applet.obReg.initMenuEntry(applet.menuItem1,(short)0,(short)applet.menuItem2.length,(byte)0x00,true ,(byte)0x00,(short)0); + //register to EVENT_STATUS_COMMAND + applet.obReg.requestPollInterval((short)1); + //register to EVENT_TIMER_EXPIRATION + applet.obReg.allocateTimer(); + //register to the resto of the events + applet.obReg.setEventList(applet.eventList,(short)0,(short)(applet.eventList.length)); + //register to file EF_TARU + applet.obReg.registerFileEvent( EVENT_EXTERNAL_FILE_UPDATE,applet.fileEFtaru,(short) 0,(short) applet.fileEFtaru.length, null, (short) 0, (byte)0x00); + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException + { + bRes=false; + testCaseNb+=(byte)0x01; + + if (testCaseNb==(byte)0x01 || + testCaseNb==(byte)0x0C || //tc 16 + testCaseNb==(byte)0x10) //tc 23 + {handler_available=false;} + + else if (testCaseNb ==(byte)0x03 || + testCaseNb ==(byte)0x0D || //tc 19 + testCaseNb ==(byte)0x11 ) //tc 24 + {handler_available=true;} + + switch (event) { + //-- tc 01 + case EVENT_FIRST_COMMAND_AFTER_ATR : + testCaseNb=(byte)0x01; + checkHandler(); + obReg.clearEvent(EVENT_FIRST_COMMAND_AFTER_ATR); + break; + + //-- TC 2 + case EVENT_PROFILE_DOWNLOAD: + checkHandler(); + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + break; + + + //-- TC 22 + case EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED: + try{ + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + EnvelopeHandler envHdr = EnvelopeHandlerSystem.getTheHandler(); + bRes=true; + } + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb, bRes); + break; + + //-- TC 24 + case EVENT_APPLICATION_DESELECT: + checkHandler(); + obReg.clearEvent(EVENT_APPLICATION_DESELECT); + break; + + //-- all other test cases + default : + checkHandler(); + break; + } + } + + + + + /** + * Verify if the envelope handler is available or not + */ + + private boolean checkHandler() + { + bRes=false; + //handler shall be available + if (handler_available==true){ + try { + EnvelopeHandler EnvHdr = EnvelopeHandlerSystem.getTheHandler(); + bRes=true; + } + catch (Exception e) { + bRes=false; + } + } + //handler shall not be available + else { + try { + EnvelopeHandler EnvHdr = EnvelopeHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if(exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bRes=true; + } + } + catch(Exception exp) {bRes=false;} + } + + this.reportTestOutcome(testCaseNb,bRes); + return bRes; + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_3.java new file mode 100644 index 0000000..99d881a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Cre_Mha_Enhd_3.java @@ -0,0 +1,159 @@ +//----------------------------------------------------------------------------- +// Cre_Mha_Enhd_3 +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_enhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + + +public class Cre_Mha_Enhd_3 extends TestToolkitApplet { + /** result of specific testcase */ + boolean bRes = false; + /** result of test in install method */ + static boolean bInstallRes = false; + + /** number of testcase */ + byte testCaseNb = (byte) 0x00; +// private short eventList[] = { +// EVENT_EVENT_BROWSING_STATUS, +// EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, +// }; + + + /** + */ + private Cre_Mha_Enhd_3 () {} + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + + private byte[] baTestsResults = new byte[128]; + private byte[] baTestAppletId = new byte[17]; + + + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Cre_Mha_Enhd_3 applet = new Cre_Mha_Enhd_3(); + + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + //initialize the data of the test applet + applet.init(); + +// //register to the of the events +// applet.obReg.setEventList(applet.eventList,(short)0,(short)applet.eventList.length); + + + // - TC 1.1 (ld 25) + // - The EnvelopeHandler is not available outside the processToolkit() method + try{ + bInstallRes=false; + //get the Proactive Handler + EnvelopeHandler EnvHdr = EnvelopeHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bInstallRes=true; + } + } + + } + + public void process(APDU apdu) { + + if (selectingApplet()){ + //- TC 1.2 (ld 25) + //- The EnvelopeHandler is not available outside the processToolkit() method + if (testCaseNb==(byte)0x00){ + testCaseNb=(byte)0x01; + bRes=false; + try{ + EnvelopeHandler EnvHdr = EnvelopeHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + //bRes can be only true if the first part of test (1.1) is not failed + if (bInstallRes==true){bRes=true;} + } + } + this.reportTestOutcome(testCaseNb,bRes); + } + + + /* end of th test: result is sent to the Terminal */ + /* Construct and send the results of the tests */ + apdu.setOutgoing(); + apdu.setOutgoingLength((short)((short)(this.baTestAppletId[0] + this.baTestsResults[0]) + + (short)2)); + apdu.sendBytesLong(this.baTestAppletId, (short)0, (short)((short)(this.baTestAppletId[0]) + (short)1)); + apdu.sendBytesLong(this.baTestsResults, (short)0, (short)((short)(this.baTestsResults[0]) + (short)1)); + + } + else{ + //call the implementation from the test applet + super.process(apdu); + } + } + + + /** + * Method called to initialize the AID + */ + public void init() throws SystemException { + + // Get the AID value + this.baTestAppletId[0] = JCSystem.getAID().getBytes(this.baTestAppletId, (short)1); + Util.arrayFillNonAtomic(this.baTestsResults, (short)0, (short)this.baTestsResults.length, (byte)0x00); + } + + /** + * Method called by the test applet to report the result of each test case + * + * @param testCaseNumber test case number + * @param result true if successful, false otherwise + */ + protected void reportTestOutcome(byte testCaseNumber, boolean testCaseResult) { + // Update the total number of tests executed + this.baTestsResults[0] = testCaseNumber; + + // Set the Test Case Result byte to 0xCC (for Card Compliant...) if successful + if (testCaseResult) { + this.baTestsResults[testCaseNumber] = (byte)0xCC; + } + else { + this.baTestsResults[testCaseNumber] = (byte)0x00; + } + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + // + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Test_Cre_Mha_Enhd.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Test_Cre_Mha_Enhd.java new file mode 100644 index 0000000..a584da8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/Test_Cre_Mha_Enhd.java @@ -0,0 +1,246 @@ + +//----------------------------------------------------------------------------- +//Test_Cre_Mha_Enhd.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_enhd; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Cre_Mha_Enhd extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/catre/cre_mha_enhd"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + /** test applet 1 class AID */ + private static String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + /** */ + private static String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + + + + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + + /** + * + */ + public Test_Cre_Mha_Enhd(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + // test script + test.reset(); + test.terminalProfileSession("03010000 0102"); + + // Install Applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "20" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01010202" + // V Pos./Id. of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "01" ); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800C" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "01" + // V Max. number of timers + "20" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "03030404" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + test.reset(); + + // test script + //TC 1 - select MF + response = test.selectFile("3F00"); + //TC 2 - send Terminal Profile except SET_EVENT_LIST,POLL_INTERVALL,SETUP_IDLE_MODE_TEXT,SET_UP_MENU + response = test.terminalProfileSession("FFFFDFD FFEFF1FEF FF0000FF FF9FFFEF" + + "03FF000 0007FE300 01"); + //TC 3 + response = test.terminalProfileSession("FFFFFFF FFEFF1FFF FF0000FF FF9FFFEF" + + "03FF000 0007FE300 01"); + response = test.envelopeMenuSelection("900102","9500"); + testresult = response.checkSw("9000"); + //TC 4 + response = test.envelopeMenuSelection("900101",""); + testresult &= response.checkSw("9000"); + //TC 5 + response = test.envelopeTimerExpiration("A40101"); + //TC 6 + response = test.envelopeCallControlByNAA(); + testresult &= response.checkSw("9000"); + //TC 7 + response = test.envelopeEventDownloadMTCall(); + testresult &= response.checkSw("9000"); + //TC 8 + response = test.envelopeEventDownloadCallConnected(); + testresult &= response.checkSw("9000"); + //TC 9 + response = test.envelopeEventDownloadCallDisconnected(); + testresult &= response.checkSw("9000"); + //TC 10 + response = test.envelopeEventDownloadLocationStatus(); + testresult &= response.checkSw("9000"); + //TC 11 + response = test.envelopeEventDownloadUserActivity(); + testresult &= response.checkSw("9000"); + //TC 12 + response = test.envelopeEventDownloadIdleScreenAvailable(); + testresult &= response.checkSw("9000"); + //TC 13 + response = test.envelopeEventDownloadCardReaderStatus(); + testresult &= response.checkSw("9000"); + //TC 14 + response = test.envelopeEventDownloadLanguageSelection(); + testresult &= response.checkSw("9000"); + //TC 15 + response = test.envelopeEventDownloadBrowserTermination(); + testresult &= response.checkSw("9000"); + //TC 16 + response = test.status("00","0C","00"); + testresult &= response.checkSw("911A"); + //TC 17 + response = test.fetch("1A"); + response = test.terminalResponse("81030140 01820282 8183010038 0281003502 " + + "03003902 000A"); + testresult &= response.checkSw("9000"); + response = test.envelopeEventDownloadDataAvailable("B8028100"); + testresult &= response.checkSw("9000"); + //TC 18 + response = test.envelopeEventDownloadChannelStatus("B8028100"); + testresult &= response.checkSw("9000"); + //TC 19 + response = test.unrecognizedEnvelope(); + response = test.fetch("10");//fetch declare service + //get the service record tlv from declare service command + String servrectlv = getServiceRecordTLV(response.getData()); + response = test.terminalResponse("81030147 0082028281 830100"); + testresult &= response.checkSw("9000"); + //TC 20 + response = test.envelopeEventDownloadLocalConnection("C1040000FFFF"); + testresult &= response.checkSw("9000"); + //TC 21 + response = test.envelopeEventDownloadAccessTechnologyChange(); + testresult &= response.checkSw("9000"); + //TC 22 + response = test.envelopeEventDownloadDisplayParametersChanged(); + testresult &= response.checkSw("9000"); + //TC 23 + //envelope handler availability with + //event proactive handler available + //TC 24 APPLICATION DESELECT + response = test.selectApplication ("A0000000 090005FF FFFFFF89 E0000002"); + response = test.sendApdu ("00A4044C 10A00000 00090005 FFFFFFFF 89E00000 02"); + testresult &= response.checkSw("9000"); + //TC 25 + response = test.envelopeEventDownloadNetworkSearchModeChange(); + testresult &= response.checkSw("9000"); + //TC 26 + response = test.envelopeEventDownloadBrowsingStatus(); + testresult &= response.checkSw("9000"); + //TC 27 + test.reset(); + response = test.terminalProfileSession("FFFFFFF FFEFF1FFF FF0000FF FF9FFFEF" + + "03FF000 0007FE300 01"); + // Install Applet + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + response = test.selectApplication(APPLET_AID_3); + testresult &= response.checkSw("9000"); + + //CHECK TEST RESULT + response = test.selectApplication(APPLET_AID_1); + testresult &= response.checkData("10" +APPLET_AID_1 + + "1ACCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCC"); + + response = test.selectApplication(APPLET_AID_2); + testresult &= response.checkData("10" +APPLET_AID_2 + + "13CCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCC CCCC"); + + response = test.selectApplication(APPLET_AID_3); + testresult &= response.checkData("10" +APPLET_AID_3 + "01CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + + /** + * Parse the service record TLV from a proactive declare service command. + * @param declareServiceCommand proactive declare service command + * @return service record TLV service record TLV + */ + public String getServiceRecordTLV(String declareServiceCommand){ + String temp = declareServiceCommand.replaceAll(" ",""); //don't bother with formatted strings + if (temp.length()>22){ + temp=temp.substring(22);//cut off BER TLV, len command details and dev id + int len = Integer.valueOf(temp.substring(2,4),16).intValue(); + if (len==temp.length()){ + return temp; + } + else{ + // suppress UICC/terminal interface TLV + return temp.substring(0,(Integer.valueOf(temp.substring(2,4),16).intValue())*2+4); + } + } + else return ""; + + } + + + + + + + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/applet.opt new file mode 100644 index 0000000..de84551 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_mha_enhd.Cre_Mha_Enhd_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_mha_enhd.Cre_Mha_Enhd_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_mha_enhd.Cre_Mha_Enhd_1 +uicc.test.catre.cre_mha_enhd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/javacard/cre_mha_enhd.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_enhd/javacard/cre_mha_enhd.cap new file mode 100644 index 0000000000000000000000000000000000000000..852e78e4607e46b384747a41690edbc66a86fb64 GIT binary patch literal 5648 zcmbtY3vg7`8UF7*=RWq4-MdNlW|JiZ(?m!NB)m6-6(R!RX#^ZQI6juJHsO&hAqHGC zuvtO_1_F&>r9K%S6CARG15`@u3>~DkKCqTrZSBx9)ece}QPFX1$Micl3Cpf+-I?Cq z|D1dN|3BY36qJrE8vC;kOQoD4)yt&I)Ojt7S zn^%bjR@~7Nugcvr_S0Ec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S_tdn zgaPY>Lq|+z$e8Gu`U35wQ34fbk2hgq7Em3Uq#1O88u9MbB`pe_d`pFE`zelN2Ohhm z4WJd61Uxg)hRvWTew(dyB=5lIH7OJF4y!EQ;7H(;-yNOE!Xm6wQ8erP-!&oVaKYJ zV{>NLFOsk@l6OAW-WiBHpVa5S-2e#`JH8*{`A_!?Nt8cfbTT_PC2t$j(bKOKlIU|W znVF%dTri{?NWVZx8aR=$f#h{UI(qt@KoWfp7GY-1Pu>uuqo<$pljv_|jGlhxPq&eN z5Kh`K;I^6dV9v;~I2}CwG@AtP&lo&;woOM*-zt;nhp>BQ*7UTEGu=e`ZkaS;b7g8G kZSPDsk-lLhO*FYPHIce~)Gt!-sl_KAKOJuWnMaiV4SJ~W+5i9m literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_1.java new file mode 100644 index 0000000..f484904 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_1.java @@ -0,0 +1,632 @@ +//----------------------------------------------------------------------------- +//FWK_MHA_ERHD +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_erhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; +import uicc.access.UICCConstants; + + +public class Cre_Mha_Erhd_1 extends TestToolkitApplet { + + /** result of specific testcase */ + private boolean bRes = false; + /** number of testcase */ + private byte testCaseNb = (byte) 0x00; +// /** nominal condition of the handlers */ +// private boolean HANDLER_AVAILABLE = true; + /** */ + private final static byte[] menuItem1 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ', (byte) '1'}; + private final static byte[] menuItem2 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ', (byte) '2'}; + private final static byte[] TEXT = {(byte) 'T', (byte) 'E', (byte) 'X', (byte) 'T', (byte) ' ', (byte) '1'}; + public final static byte QUALIFIER_1 = (byte) 0x01; + public final static byte[] ADDRESS_VALUE = {(byte) 0x81, (byte) 0x55, (byte) 0x66, (byte) 0x77, (byte) 0x88}; + public final static byte[] BEARER_VALUE = {(byte) 0x03, (byte) 0x00}; + public final static byte[] BUFFER_SIZE_VALUE = {(byte) 0x00, (byte) 0x01}; + protected byte service_id = (byte)0x00; + protected byte[] SERVICE_RECORD_VALUE = {(byte) 0x00, (byte) 0x00, (byte) 0x00}; + private byte triggerNr = (byte) 0x00; + private boolean bRes_old = false; + protected final byte[] fileEFtaru = new byte[]{ (byte) 0x01, (byte) 0x3F, (byte) 0x00, (byte) 0x7F, (byte) 0x4A,(byte) 0x6F, (byte) 0x03 }; + + /** list included registered all events */ + private short eventList[] = { + EVENT_EVENT_DOWNLOAD_MT_CALL, + EVENT_EVENT_DOWNLOAD_CALL_CONNECTED, + EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED, + EVENT_EVENT_DOWNLOAD_LOCATION_STATUS, + EVENT_EVENT_DOWNLOAD_USER_ACTIVITY, + EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CARD_READER_STATUS, + EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION, + EVENT_EVENT_DOWNLOAD_BROWSER_TERMINATION, + EVENT_PROFILE_DOWNLOAD, + EVENT_FIRST_COMMAND_AFTER_ATR, + EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS, + EVENT_EVENT_DOWNLOAD_ACCESS_TECHNOLOGY_CHANGE, + EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED, + EVENT_UNRECOGNIZED_ENVELOPE, + EVENT_CALL_CONTROL_BY_NAA, + EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE, + EVENT_APPLICATION_DESELECT, + EVENT_EVENT_BROWSING_STATUS, + EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, + }; + + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Cre_Mha_Erhd_1 applet = new Cre_Mha_Erhd_1(); + + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + + //initialize the data of the test applet + applet.init(); + + //- Applet registration + //register to EVENT_MENU_SELECTION + applet.obReg.initMenuEntry(menuItem1,(short)0,(short)menuItem1.length,(byte)0x00,false,(byte)0x00,(short)0); + //register to EVENT_MENU_SELECTION_HELP_REQUEST + applet.obReg.initMenuEntry(menuItem1,(short)0,(short)menuItem2.length,(byte)0x00,true ,(byte)0x00,(short)0); + //register to EVENT_STATUS_COMMAND + applet.obReg.requestPollInterval((short)1); + //register to EVENT_EVENT_DOWNLLOAD_LOCAL_CONNECTION + applet.service_id = applet.obReg.allocateServiceIdentifier(); + applet.SERVICE_RECORD_VALUE[(byte)0x01]=applet.service_id; + //register to the resto of the events + applet.obReg.setEventList(applet.eventList,(short)0,(short)(applet.eventList.length)); + //register to file EF_TARU + applet.obReg.registerFileEvent( EVENT_EXTERNAL_FILE_UPDATE,applet.fileEFtaru,(short) 0,(short) applet.fileEFtaru.length, null, (short) 0, (byte)0x00); + //register to EVENT_TIMER_EXPIRATION + for (byte timer=(byte)0x00;timer<(byte)0x08;timer++){ + applet.obReg.allocateTimer(); + } + for (byte timer=(byte)0x02;timer<=(byte)0x08;timer++){ + //release timer from 2 to 8 to be sure that only timer id 1 is allocated + applet.obReg.releaseTimer(timer); + } + + } + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + bRes=false; + testCaseNb+=(byte)01; + + + switch(event) { + //-- TC 1 + case(EVENT_FIRST_COMMAND_AFTER_ATR): + checkHandler(); + obReg.clearEvent(EVENT_FIRST_COMMAND_AFTER_ATR); + break; + + //--TC 2 + case(EVENT_PROFILE_DOWNLOAD): + checkHandler(); + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + break; + + //-- TC 16 + case EVENT_STATUS_COMMAND: + try { + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch (ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + // Open Channel(1) proactive command for next test case 17 + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + proHdr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short) 0, (short) 5); + proHdr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short) 0, (short) 2); + proHdr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short) 0, (short) 2); + proHdr.send(); + bRes=true; + } + } + catch (Exception exp) { bRes = false;} + this.reportTestOutcome(testCaseNb, bRes); + break; + + //-- TC 18,20.2 + case EVENT_CALL_CONTROL_BY_NAA: + //-- TC 18.1 + if (triggerNr==(byte)0x00) {//tc is triggered the first time + try { + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + envRHdr.postAsBERTLV(true, (byte) 0x00); + //call all methods including the inherited) + bRes = isHandlerNotAvailable(envRHdr); + if(bRes) { + //next call control by naa belongs to this test also + triggerNr+=(byte)0x01; + bRes_old=bRes; + } + } + catch (Exception exp) { + bRes = false; + triggerNr+=(byte)0x01; + } + testCaseNb=(byte)(testCaseNb-(byte)0x01);//next naa trigger belongs to this test case + } + //-- TC 18.2 + else if(triggerNr==(byte)0x01) + { + try { + //if bRes_old is false the first part of test case is failed + if(bRes_old){ + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + byte bArray[]= new byte[] {(byte)0x00,(byte)0x00}; + proHdr.initDisplayText((byte)0x80,(byte)0x04,bArray,(short)0,(short)bArray.length); + proHdr.send(); + //call all method of the EnvelopeResponseHandler including inherited + bRes = isHandlerNotAvailable(envRHdr); + triggerNr=(byte)0x00; + } + } + catch(Exception exp) {bRes=false;} + triggerNr=(byte)0x00; + } + //-- TC 20.2 + else if(testCaseNb==(byte)0x14){ + try{ + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + envRHdr.postAsBERTLV(true,(byte)0x00); + //TC 20.1 shall be executed successfully + bRes=true; + } + catch(Exception exp){bRes=false;} + } + this.reportTestOutcome(testCaseNb, bRes); + break; //call controll by naa + + //-- TC 19,20.1,21 + case EVENT_UNRECOGNIZED_ENVELOPE: + //-- TC 19.1 + if(triggerNr==(byte)0x00){ + bRes_old=false; + testCaseNb=(byte)0x13; + try{ + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + envRHdr.postAsBERTLV(true,(byte)0x00); + //Calls all methods of the handler (including the inherited methods). + bRes=isHandlerNotAvailable(envRHdr); + if(bRes){bRes_old=bRes;} + } + catch(Exception exp){ + bRes=false; + bRes_old=false; + } + testCaseNb=(byte)(testCaseNb-(byte)0x01);//next unrec. envelope trigger belongs to this case + triggerNr+=(byte)0x01; + } + //-- TC 19.2 + else if(triggerNr==(byte)0x01){ + try{ + //if bRes_old is false the first part of testcase failed + if(bRes_old){ + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + + byte bArray[] = new byte[]{(byte)0x01,(byte)0x02,(byte)0x03}; + proHdr.initDisplayText((byte)0x80,(byte)0x04,bArray,(short)0,(short)bArray.length); + proHdr.send(); + //Calls all methods of the handler (including the inherited methods). + bRes=isHandlerNotAvailable(envRHdr); + } + } + catch(Exception exp){ + bRes=false; + } + triggerNr+=(byte)0x01; + this.reportTestOutcome(testCaseNb,bRes); + } + //-- TC 20.1 + //test case 20.2 will be triggered by call controll by naa + else if(triggerNr==(byte)0x02){ + bRes_old=false; + try{ + triggerNr+=(byte)0x01; + //next case triggered by call controll by NAA belongs to this test. + testCaseNb=(byte)(testCaseNb-(byte)0x01); + ProactiveHandler prHdr = ProactiveHandlerSystem.getTheHandler(); + //build a proactive command DISPLAY TEXT + prHdr.initDisplayText((byte)0x80,(byte)0x04,TEXT,(short)0,(short)TEXT.length); + //send the proactive command DISPLAY TEXT + prHdr.send(); + bRes=true; + } + catch(Exception exp){ + bRes=false; + } + + } + //-- TC 21 + else if (triggerNr==(byte)0x03){ + try{ + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + bRes=true; + } + catch(Exception exp){bRes=false;} + triggerNr=(byte)0x00; + this.reportTestOutcome(testCaseNb,bRes); + } + + + break; + + //-- TC 23 + case EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED: + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + checkHandler(); + break; + + //-- TC 24 + case EVENT_PROACTIVE_HANDLER_AVAILABLE: + try{ + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + + } + catch (ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + //get the ProactiveHandler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + proHdr.init(PRO_CMD_DECLARE_SERVICE, (byte)0, DEV_ID_TERMINAL); + proHdr.appendTLV(TAG_SERVICE_RECORD, SERVICE_RECORD_VALUE, (short) 0, (short) 3); + if (proHdr.send() == (byte) 0x00) { + bRes = true; + } + } + } + + catch(Exception exp){bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + break; + + //-- TC 25 + case EVENT_APPLICATION_DESELECT: + checkHandler(); + obReg.clearEvent(EVENT_APPLICATION_DESELECT); + break; + + //-- TC 3,4,5,6,7,8,9,10,11,12,13,14,15, + default: + checkHandler(); + break; + + } + } + + + + + + + + /** + * Verifies if the envelope response handler is not available + * @return value of bRes + */ + private boolean checkHandler() + { + bRes=false; + try { + EnvelopeResponseHandler EnvRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp) { + if(exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes=true; + } + } + catch(Exception exp) {bRes=false;} + this.reportTestOutcome(testCaseNb,bRes); + return bRes; + + } + + + + /** + * Calls all methods of the Envelope Response Handler (including the + * inherited methods). + * + * @param envRHdr EnvelopeResponseHandler + * @return true if every called method thows a ToolkitException.HANDLER_NOT_AVAILABLE. + * Otherwise it returns false + */ + boolean isHandlerNotAvailable(EnvelopeResponseHandler envRHdr) { + bRes = true; + byte bArray[] = new byte[]{(byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04}; + byte buffer[] = new byte[10]; + // + // call all methods inherited from Interface EditHandler + // + //method post(boolean value) + try { + envRHdr.post(true); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //method postAsBERTLV(boolean value, byte tag).. + try { + envRHdr.postAsBERTLV(true,(byte)0x00); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendArray(byte[]buffer,short offset, short length) + try { + envRHdr.appendArray(bArray,(short)0,(short)4); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendTLV(byte tag, byte value) + try { + envRHdr.appendTLV((byte)0x01,(byte)0x02); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendTLV(byte tag, byte[] value, short valueOffset, short valueLength) + try { + envRHdr.appendTLV((byte)0x01,bArray,(short)0,(short)1); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendTLV(byte tag, byte[] value1, short value1Offset, short value1Length, byte[] value2, short value2Offset, short value2Length) + try { + envRHdr.appendTLV((byte)0x01,bArray,(short)0,(short)1,bArray,(short)1,(short)1); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendTLV(byte tag, byte value1, byte value2) + try { + envRHdr.appendTLV((byte)0x01,(byte)0x02,(byte)0x03); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendTLV(byte tag, byte value1, byte[] value2, short value2Offset, short value2Length) + try { + envRHdr.appendTLV((byte)0x01,(byte)0x02,bArray,(short)0,(short)2); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendTLV(byte tag, byte value1, short value2) + try { + envRHdr.appendTLV((byte)0x01,(byte)0x02,(short)3); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendTLV(byte tag, short value) + try { + envRHdr.appendTLV((byte)0x01,(short)2); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //appendTLV(byte tag, short value1, short value2) + try { + envRHdr.appendTLV((byte)0x01,(short)2,(short)3); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //clear() + try { + envRHdr.clear(); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + // + // call all methods inherited from Interface ViewHandler + // + + //compareValue(short valueOffset, byte[] compareuffer, short compareOffset, short compareLength) + try { + envRHdr.compareValue((short)0,buffer, (short)0, (short)1); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //copy (byte[] dstBuffer, short dstOffset, short dstLength) + try { + envRHdr.copy(buffer,(short)0,(short)1); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //copyValue(short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) + try { + envRHdr.copyValue((short)0,buffer,(short)0,(short)1); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //findAndCompareValue(byte tag,byte[] compareBuffer, short compareOffset) + try { + envRHdr.findAndCompareValue((byte)0x01,buffer,(short)0); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //findAndCompareValue(byte tag, byte occurence, short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) + try { + envRHdr.findAndCompareValue((byte)0x00,(byte)0x01,(short)1,buffer,(short)0,(short)1); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //findAndCopyValue(byte tag, byte[] dstBuffer, short dstOffset) + try { + envRHdr.findAndCopyValue((byte)0x00,buffer,(short)0); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //findAndCopyValue(byte tag, byte occurence, short valueOffset, byte[] dstBuffer, short dstOffset, short dstlength) + try { + envRHdr.findAndCopyValue((byte)0x00,(byte)0x01,(short)0,buffer,(short)0,(short)1); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //findTLV(byte tag, byte occurrence) + try { + envRHdr.findTLV((byte)0x00,(byte)0x01); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //getCapacity() + try { + envRHdr.getCapacity(); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //getLength() + try { + envRHdr.getLength(); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //getValueByte(short vallueOffset) + try { + envRHdr.getValueByte((short)0); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //getValueLength + try { + envRHdr.getValueLength(); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + //getValueShort(short valueOffset) + try { + envRHdr.getValueShort((short)0); + } + catch (ToolkitException exp) { + if (exp.getReason() != ToolkitException.HANDLER_NOT_AVAILABLE) {bRes = false;} + } + catch(Exception exp) { + bRes=false; + } + + return bRes; + } + + + + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_2.java new file mode 100644 index 0000000..c20dec2 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_2.java @@ -0,0 +1,146 @@ +//----------------------------------------------------------------------------- +//FWK_MHA_ERHD +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_erhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; +import uicc.access.UICCConstants; + + +public class Cre_Mha_Erhd_2 extends TestToolkitApplet { + + /** result of specific testcase */ + private boolean bRes = false; + /** number of testcase */ + private byte testCaseNb = (byte)0x00; + /** use for counting the triggering of the unrecognize envelope*/ + private byte triggerNr = (byte)0x00; + ; + /**stores the value of the result */ + private boolean bRes_old = false; + /** list included registered all events */ + private short eventList[] = {EVENT_UNRECOGNIZED_ENVELOPE}; + + + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Cre_Mha_Erhd_2 applet = new Cre_Mha_Erhd_2(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + //initialize the data of the test applet + applet.init(); + + //register to the resto of the events + applet.obReg.setEventList(applet.eventList,(short)0,(short)(applet.eventList.length)); + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + bRes=false; + testCaseNb+=(byte)0x01; + switch (event) { + //-- TC 19.1 + case EVENT_UNRECOGNIZED_ENVELOPE: + if(triggerNr==(byte)0x00 ){//TC 19.1 + try{ + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bRes=true; + } + } + bRes_old=bRes; + //next trigger belongs to this test case + triggerNr+=(byte)0x01; + testCaseNb=(byte)(testCaseNb-(byte)0x01); + } + + //-- TC 19.2 + else if(triggerNr==(byte)0x01){ +// testCaseNb=(byte)0x01; + //if bRes_old is false the first part of this test case failed + if(bRes_old){ + try{ + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bRes=true; + } + } + } + triggerNr+=(byte)0x01; + this.reportTestOutcome(testCaseNb,bRes); + } + + //-- TC 21 + else if(triggerNr==(byte)0x02) { + try{ + //set tc to 2 because tc 20 use an unrec. envelope also + testCaseNb=(byte)0x02; + EnvelopeResponseHandler envRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + bRes=true; + } + catch(Exception exp){bRes=false;} + //triggerNr=(byte)0x00; + this.reportTestOutcome(testCaseNb,bRes); + } + + + break; + + default: + break; + } + } +// /** +// * If the EnvelopeResponseHandler is available, the test +// * case will be reported as successful. Otherwise as false. +// * +// * @param testCaseNb Number of current test case +// * @return @return true if the EnvelopeResponseHandler is available. +// * Otherwise false. +// */ +// boolean isHandlerNotAvailable(byte testCaseNb) { +// try { +// EnvelopeResponseHandler EnvRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); +// } +// catch(ToolkitException exp) { +// if(exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) { +// bRes=true; +// } +// } +// catch(Exception exp) {bRes=false;} +// this.reportTestOutcome(testCaseNb,bRes); +// return bRes; +// } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_3.java new file mode 100644 index 0000000..e233df3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Cre_Mha_Erhd_3.java @@ -0,0 +1,165 @@ +//----------------------------------------------------------------------------- +//Api_2_Bte_Aptlbss +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_erhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + + +public class Cre_Mha_Erhd_3 extends TestToolkitApplet { + /** result of specific testcase */ + boolean bRes = false; + /** result of test in install method */ + static boolean bInstallRes = false; + + /** number of testcase */ + byte testCaseNb = (byte) 0x00; +// private short eventList[] = { +// EVENT_EVENT_BROWSING_STATUS, +// EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, +// }; + + /** + */ + private Cre_Mha_Erhd_3 () {} + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + + private byte[] baTestsResults = new byte[128]; + private byte[] baTestAppletId = new byte[17]; + + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Cre_Mha_Erhd_3 applet = new Cre_Mha_Erhd_3(); + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + //initialize the data of the test applet + applet.init(); + + //register to the resto of the events +// applet.obReg.setEventList(applet.eventList,(short)0,(short)applet.eventList.length); + + + + // - TC 1.1 (ld 27) + // - The EnvelopeResponseHandler is not available outside the processToolkit() method + try{ + bInstallRes=false; + //get the Proactive Handler + EnvelopeResponseHandler EnvRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bInstallRes=true; + } + } + } + + public void process(APDU apdu) { + if (selectingApplet()){ + //- TC 1.2 (ld 27) + //- The EnvelopeResponseHandler is not available outside the processToolkit() method + if (testCaseNb==(byte)0x00){//shall be only selected once + testCaseNb=(byte)0x01; + bRes=false; + try{ + EnvelopeResponseHandler EnvRHdr = EnvelopeResponseHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + //bRes can be only true if the first part of test (1.1) is not failed + if (bInstallRes==true){bRes=true;} + } + } + this.reportTestOutcome(testCaseNb,bRes); + } + + /* end of th test: result is sent to the Terminal */ + /* Construct and send the results of the tests */ + apdu.setOutgoing(); + apdu.setOutgoingLength((short)((short)(this.baTestAppletId[0] + this.baTestsResults[0]) + + (short)2)); + apdu.sendBytesLong(this.baTestAppletId, (short)0, (short)((short)(this.baTestAppletId[0]) + (short)1)); + apdu.sendBytesLong(this.baTestsResults, (short)0, (short)((short)(this.baTestsResults[0]) + (short)1)); + + } + else{ + //call the implementation from the test applet + super.process(apdu); + } + } + + + /** + * Method called to initialize the AID + */ + public void init() throws SystemException { + + // Get the AID value + this.baTestAppletId[0] = JCSystem.getAID().getBytes(this.baTestAppletId, (short)1); + Util.arrayFillNonAtomic(this.baTestsResults, (short)0, (short)this.baTestsResults.length, (byte)0x00); + } + + /** + * Method called by the test applet to report the result of each test case + * + * @param testCaseNumber test case number + * @param result true if successful, false otherwise + */ + protected void reportTestOutcome(byte testCaseNumber, boolean testCaseResult) { + // Update the total number of tests executed + this.baTestsResults[0] = testCaseNumber; + + // Set the Test Case Result byte to 0xCC (for Card Compliant...) if successful + if (testCaseResult) { + this.baTestsResults[testCaseNumber] = (byte)0xCC; + } + else { + this.baTestsResults[testCaseNumber] = (byte)0x00; + } + } + + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + // + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Test_Cre_Mha_Erhd.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Test_Cre_Mha_Erhd.java new file mode 100644 index 0000000..760b4a4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/Test_Cre_Mha_Erhd.java @@ -0,0 +1,264 @@ + +//----------------------------------------------------------------------------- +//Test_Cre_Mha_Erhd.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_erhd; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Cre_Mha_Erhd extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/catre/cre_mha_erhd"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + /** test applet 1 class AID */ + private static String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + /** */ + private static String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Cre_Mha_Erhd(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + // test script + test.reset(); + test.terminalProfileSession("16FF"); + // Install Applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "20" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01010202" + // V Pos./Id. of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "01" ); // V Maximum number of services + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800C" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "01" + // V Max. number of timers + "20" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "03030404" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + test.reset(); + + // test script + //TC 1 - select MF + //response = test.selectFile("3F02"); + response = test.selectFile("3F00"); + //TC 2 - send Terminal Profile except SET_EVENT_LIST,POLL_INTERVALL,SETUP_IDLE_MODE_TEXT,SET_UP_MENU + response = test.terminalProfileSession("FFFFDFDF FEFF1FEF FF0000FF FF9FFFEF" + + "03FF0000 007FE300 01"); + //TC 3 (TP with all facilities except SET_UP_EVENT_LIST) + response = test.terminalProfileSession("FFFFFFFF FEFFFFFF FFFFFFFF FFFFFFFF " + + "FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF " + + "FFFF"); + response = test.envelopeMenuSelection("900102","9500"); + testresult = response.checkSw("9000"); + //TC 4 + response = test.envelopeMenuSelection("900101",""); + testresult &= response.checkSw("9000"); + //TC 5 + response = test.envelopeTimerExpiration("A40101"); + //TC 6 + response = test.envelopeEventDownloadMTCall(); + testresult &= response.checkSw("9000"); + //TC 7 + response = test.envelopeEventDownloadCallConnected(); + testresult &= response.checkSw("9000"); + //TC 8 + response = test.envelopeEventDownloadCallDisconnected(); + testresult &= response.checkSw("9000"); + //TC 9 + response = test.envelopeEventDownloadLocationStatus(); + testresult &= response.checkSw("9000"); + //TC 10 + response = test.envelopeEventDownloadUserActivity(); + testresult &= response.checkSw("9000"); + //TC 11 + response = test.envelopeEventDownloadIdleScreenAvailable(); + testresult &= response.checkSw("9000"); + //TC 12 + response = test.envelopeEventDownloadCardReaderStatus(); + testresult &= response.checkSw("9000"); + //TC 13 + response = test.envelopeEventDownloadLanguageSelection(); + testresult &= response.checkSw("9000"); + //TC 14 + response = test.envelopeEventDownloadBrowserTermination(); + testresult &= response.checkSw("9000"); + //TC 15 + response = test.status("00","0C","00"); + testresult &= response.checkSw("911A"); + //TC 16 + response = test.fetch("1A"); + response = test.terminalResponse("81030140 01820282 8183010038 0281003502 " + + "03003902 000A"); + testresult &= response.checkSw("9000"); + response = test.envelopeEventDownloadDataAvailable("B8028100");//channel id 1 + testresult &= response.checkSw("9000"); + //TC 17 + response = test.envelopeEventDownloadChannelStatus("B8028100"); + testresult &= response.checkSw("9000"); + //TC 18 + response = test.envelopeCallControlByNAA(); + testresult &= response.checkSw("9000"); + response = test.envelopeCallControlByNAA(); + testresult &= response.checkSw("9110"); + response = test.fetch("10"); + testresult &= response.checkData("D00E8103 01218082 0281028D 03040000"); + response = test.terminalResponse("81030110 00820282 81830100"); + testresult &= response.checkSw("9000"); + //TC 19 + response = test.unrecognizedEnvelope(); + testresult &= response.checkSw("9000"); + response = test.unrecognizedEnvelope(); + testresult &= response.checkSw("9111"); + response = test.fetch("11"); + testresult &= response.checkData("D00F8103 01218082 0281028D 0404010203"); + response = test.terminalResponse("81030110 00820282 81830100"); + testresult &= response.checkSw("9000"); + //TC 20 + response = test.unrecognizedEnvelope(); + testresult &= response.checkSw("9114"); + response = test.envelopeCallControlByNAA(); + testresult &= response.checkSw("9114"); + response = test.fetch("14"); + testresult &= response.checkData("D0128103 01218082 0281028D 07045445 58542031"); + response = test.terminalResponse("81030121 80820282 81030100"); + testresult &= response.checkSw("9000"); + //TC 21 + response = test.unrecognizedEnvelope(); + testresult &= response.checkSw("9000"); + //TC 22 + response = test.envelopeEventDownloadAccessTechnologyChange(); + testresult &= response.checkSw("9000"); + //TC 23 + response = test.envelopeEventDownloadDisplayParametersChanged(); + testresult &= response.checkSw("9110"); + //TC 24 + //fetch declare service + response = test.fetch("10");//fetch declare service + //get the service record tlv from declare service command + String servrectlv = getServiceRecordTLV(response.getData()); + response = test.terminalResponse("81030147 0082028281 830100"); + testresult &= response.checkSw("9000"); + //TC 25 + response = test.envelopeEventDownloadLocalConnection("C1040000FFFF"); + testresult &= response.checkSw("9000"); + //TC 26 + response = test.selectApplication ("A0000000 090005FF FFFFFF89 E0000002"); + response = test.sendApdu ("00A4044C 10A00000 00090005 FFFFFFFF 89E00000 02"); + testresult &= response.checkSw("9000"); + //TC 27 + response = test.envelopeEventDownloadNetworkSearchModeChange(); + testresult &= response.checkSw("9000"); + //TC 28 + response = test.envelopeEventDownloadBrowsingStatus(); + testresult &= response.checkSw("9000"); + //TC 27 + test.reset(); + response = test.terminalProfileSession("13"); + + //test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + response = test.selectApplication(APPLET_AID_3); + +// test.reset(); +// response = test.terminalProfileSession("13"); + + + //check results of the tests + //test.reset(); + response = test.selectApplication(APPLET_AID_1); + testresult &= response.checkData("10" +APPLET_AID_1 + + "1CCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCCCC CC"); + + response = test.selectApplication(APPLET_AID_2); + testresult &= response.checkData("10" +APPLET_AID_2 + + "02CCCC"); + + response = test.selectApplication(APPLET_AID_3); + testresult &= response.checkData("10" +APPLET_AID_3 + "01CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + + + /** + * Parse the service record TLV from a proactive declare service command. + * @param declareServiceCommand proactive declare service command + * @return service record TLV service record TLV + */ + public String getServiceRecordTLV(String declareServiceCommand){ + String temp = declareServiceCommand.replaceAll(" ",""); //don't bother with formatted strings + if (temp.length()>22){ + temp=temp.substring(22);//cut off BER TLV, len command details and dev id + int len = Integer.valueOf(temp.substring(2,4),16).intValue(); + if (len==temp.length()){ + return temp; + } + else{ + // suppress UICC/terminal interface TLV + return temp.substring(0,(Integer.valueOf(temp.substring(2,4),16).intValue())*2+4); + } + } + else return ""; + } + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/applet.opt new file mode 100644 index 0000000..be3c761 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_mha_erhd.Cre_Mha_Erhd_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_mha_erhd.Cre_Mha_Erhd_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_mha_erhd.Cre_Mha_Erhd_1 +uicc.test.catre.cre_mha_erhd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/javacard/cre_mha_erhd.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_erhd/javacard/cre_mha_erhd.cap new file mode 100644 index 0000000000000000000000000000000000000000..03e688201b1bf3686e39a47cd3f7893400bdb850 GIT binary patch literal 6996 zcmbtY4R934m3}kbGt)D(l19>MHQGfWVJirPegFYl6d4NvHh)GzaPcL!k&xw+EI=C} zV|yVm5;({RgaVilJN}J-z>YRP7Z=+XSB|2}E{s!-&mpP9zT72F9DGS}u`5pEt2?6m zdRJnltw`Cb%+~Afuiu;ZUcY(Wv-29)FzzRTUwHG*g*5K+6Q^}6HrAJ~x@BeMy82sI ztz6Nxv0~lIKVKjk-uUINzAFEo#h)zw^eekczqg|2x1k*mzqq#b*-O(`F{7j@@?p-^ zKb5^>_4{f^t2xxm^JXi&)!)gF0T3TzB$kL z-M#DnyDJB~8(T}Jzg3g<)uCw}1&>x=YW=*(k6b)ZaOSobpNlN$efRByYaZ}6-E{WB z4JS|kVb-PR-^tp0c70&=$Kl|={qESFS1;Z%92na2$H)Kamb{AL*E9ccX3oDZs$4z& z^BDt0yL*qU{K}x)aJ>74x5^Jjug>1Gzo+Me!e6%fKbiNvPv%v;{tq|3{aRVLY5gs^ z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V`tG6!frPQV4V1;g2_WY}RP^;-P^RZA#mIKaXJ%u7}r;1Df1 zM2n)D1O8!JJe-Y_ucjt0augHc+9<06Dy*5_Yz;ew&JSxM26|Q#rK0G>PmLA7?fS+N zeEdjSnD$3dQ%_4zN9)Rtwyp8+4MB_J-|jjit#{L1_x3YV8NTfBQO!tS)zh}EXx`Xh zJ_Z|C+`6%7p8VXK=**F|>;HHTvy#$xW<%RuYr9bB=;+!mKYmOU6E2R7%;h|X^U{0E z^78OO$T{Pt#`8k?Tr1DM)nKX!sJh1RIi@j*i?84=y5QflgLzh22 z&l1KGK1~+R3{rKg@$t{xBvu27i;b!{HLWwxD4I^9VS@>qiFihQ^m=r57RDD>EDukr!v@>*h z+m6=mjtFW_GAC?x4yrk*WKbqDRP7V^NH2gciYn+-imK>1MMr|N01@v*qO&Lp25J;c zL8m~{AHM-L4`|yh%O>1I!k{?eF|X6;<45s#oYCIxoi-ss(gX z{WaM{BdY#5?W9upV0)y$Nk`abnok+11i9EusGuaAmDLv7EekM;r^*_P>M>b{VIGr} z7`Q;a)*M)yk+5d1fi+nbf;DR&oum`+cBzV@iPWkmw2lbWO>n0y-yjmQf`j!DiaH*) zFGM{y(r1UDb(+*frX7aXrHH~ZL$RauD79nUAQbyokcr3BfH!jruVHma}vS{gF}bF<5$tj$uZQ;u53dow)N5 z?mS5k!?P#p89JpDDOJjg%2}!ztTQj3X6 z8xE?I>8+q)thAV_JhdK}RQ`P0%9GW>RPCvM0g~GDP=8L(^^`vZsU}ii>`4<(rEMbR kHJ@rC^)-<+@iI>A^j0zPrO~)X)1?+0KY?w(C|{!g2kZH`kpKVy literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_1.java new file mode 100644 index 0000000..194ea66 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_1.java @@ -0,0 +1,265 @@ +//----------------------------------------------------------------------------- +//Cre_Mha_Pahd +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_pahd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; +import uicc.access.UICCConstants; + + +public class Cre_Mha_Pahd_1 extends TestToolkitApplet { + + /** result of specific testcase */ + boolean bRes = false; + + + /** number of testcase */ + byte testCaseNb = (byte) 0x00; + /** */ + boolean handler_available = true; + private final byte[] menuItem1 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ',(byte) '1'}; + private final byte[] menuItem2 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ',(byte) '2'}; + private final byte QUALIFIER_1 = (byte) 0x01; + private final byte[] ADDRESS_VALUE = {(byte) 0x81, (byte) 0x55, (byte) 0x66, (byte) 0x77, (byte) 0x88}; + private final byte[] BEARER_VALUE = {(byte) 0x03, (byte) 0x00}; + private final byte[] BUFFER_SIZE_VALUE = {(byte) 0x00, (byte) 0x01}; + protected byte service_id = (byte)0x00; + protected final byte[] fileEFtaru = new byte[]{ (byte) 0x01, (byte) 0x3F, (byte) 0x00, (byte) 0x7F, (byte) 0x4A,(byte) 0x6F, (byte) 0x03 }; + // Technology independet,servicenr. 0, service record: 00 00 + protected byte[] SERVICE_RECORD_VALUE = {(byte)0x00,(byte)0x00,(byte)0x00}; + + private final short eventList[] = { + EVENT_EVENT_DOWNLOAD_MT_CALL, + EVENT_EVENT_DOWNLOAD_CALL_CONNECTED, + EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED, + EVENT_EVENT_DOWNLOAD_LOCATION_STATUS, + EVENT_EVENT_DOWNLOAD_USER_ACTIVITY, + EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CARD_READER_STATUS, + EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION, + EVENT_EVENT_DOWNLOAD_BROWSER_TERMINATION, + EVENT_UNRECOGNIZED_ENVELOPE, + EVENT_CALL_CONTROL_BY_NAA, + EVENT_PROFILE_DOWNLOAD, + EVENT_FIRST_COMMAND_AFTER_ATR, + EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS, + EVENT_EVENT_DOWNLOAD_ACCESS_TECHNOLOGY_CHANGE, + EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED, + EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, + EVENT_EVENT_BROWSING_STATUS, + EVENT_APPLICATION_DESELECT + }; + + + + + /** + */ + private Cre_Mha_Pahd_1 () {} + + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + + + + Cre_Mha_Pahd_1 applet = new Cre_Mha_Pahd_1(); + //initialize the data of the test applet + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + //initalise all values of the TestToolkitApplet + applet.init(); + + //register to EVENT_MENU_SELECTION + applet.obReg.initMenuEntry(applet.menuItem1,(short)0,(short)applet.menuItem1.length,(byte)0x00,false,(byte)0x00,(short)0); + //register to EVENT_MENU_SELECTION_HELP_REQUEST + applet.obReg.initMenuEntry(applet.menuItem2,(short)0,(short)applet.menuItem2.length,(byte)0x00,true ,(byte)0x00,(short)0); + //register to EVENT_STATUS_COMMAND + applet.obReg.requestPollInterval((short)1); + //register to EVENT_EVENT_DOWNLLOAD_LOCAL_CONNECTION + applet.service_id = applet.obReg.allocateServiceIdentifier(); + //store the allocated service id + applet.SERVICE_RECORD_VALUE[(byte)0x01]=applet.service_id; + //register to the rest of the events + applet.obReg.setEventList(applet.eventList,(short)0,(short)(applet.eventList.length)); + //register to file EF_TARU + applet.obReg.registerFileEvent( EVENT_EXTERNAL_FILE_UPDATE,applet.fileEFtaru,(short) 0,(short) applet.fileEFtaru.length, null, (short) 0, (byte)0x00); + //register to EVENT_TIMER_EXPIRATION + for (byte timer=(byte)0x00;timer<(byte)0x08;timer++){ + applet.obReg.allocateTimer(); + } + for (byte timer=(byte)0x02;timer<=(byte)0x08;timer++){ + //release timer from 2 to 8 to be sure that only timer id 1 is allocated + applet.obReg.releaseTimer(timer); + } + + } + + /* + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + bRes=false; + testCaseNb+=(byte)0x01; + + if (testCaseNb==(byte)0x01|| + testCaseNb==(byte)0x18) {handler_available=false;} + + else if (testCaseNb==(byte)0x02 || + testCaseNb==(byte)0x2C ){handler_available=true;} + + switch(event){ + //--TC 1 + case EVENT_FIRST_COMMAND_AFTER_ATR: + testCaseNb=(byte)0x01; + checkProactiveHandler(); + obReg.clearEvent(EVENT_FIRST_COMMAND_AFTER_ATR); + break; + //--TC 2 + case EVENT_PROFILE_DOWNLOAD: + checkProactiveHandler(); + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + break; + + //--TC 8,23,30, + case EVENT_EVENT_DOWNLOAD_CALL_CONNECTED: + + if (testCaseNb!=(byte)0x17)checkProactiveHandler(); + else if (testCaseNb==(byte)0x17){ + //tc shall be set afterwards by triggering proactive handler available + testCaseNb=(byte)0x16;//set tc back to nr.23 + //register to event + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + } + break; + //--TC 16 + case EVENT_STATUS_COMMAND: + if (testCaseNb==(byte)0x10) { + checkProactiveHandler();//check if the proactive handler is available + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + // Open channel(1) proactive command for test case 17 ( + proHdr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)5); + proHdr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)2); + proHdr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)2); + proHdr.send(); + } + else { + checkProactiveHandler(); + } + break; + + //--TC 21,41 + case EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED: + if(testCaseNb==(byte)0x15) { + try { + //get the ProactiveHandler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + proHdr.init(PRO_CMD_DECLARE_SERVICE, (byte)0, DEV_ID_TERMINAL); + proHdr.appendTLV(TAG_SERVICE_RECORD, SERVICE_RECORD_VALUE, (short) 0, (short) 3); + if (proHdr.send() == (byte) 0x00) { + bRes = true; + } + } + catch (Exception exp) { + bRes = false; + } + } + else if (testCaseNb==(byte)0x29){ + try { + //get the ProactiveHandler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp) { + //register to EVENT_PROACTIVE_HANDLER AVAILABLE + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + bRes=true; + } + } + this.reportTestOutcome(testCaseNb,bRes); + break; + + //--TC 24 + case EVENT_APPLICATION_DESELECT: + checkProactiveHandler(); + obReg.clearEvent(EVENT_APPLICATION_DESELECT); + break; + + //--TC 43,45 + case EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE: + checkProactiveHandler(); + if(testCaseNb==(byte)0x2A) { + obReg.clearEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + //handler shall not be available + } + break; + + //- TC 3,4,5,6,7,9,10,11,12 + // 13,14,15,17,18,19,20,22 <-handler available + // 24,25,26,27,28,29,31,32,33,34,35,36,37 + // 38,39,40, + default: + checkProactiveHandler(); + break; + } + } + + + /** + * Verify if the proactive handler is available or not + */ + private void checkProactiveHandler(){ + bRes=false; + + //handler shall be available + if (handler_available==true){ + try { + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + bRes=true; + } + catch(Exception exp) {bRes=false;} + } + + //handler shall not be available + else{ + try { + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + } + catch (ToolkitException e) { + if (e.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes=true; + } + } + catch(Exception exp) {bRes=false;} + } + this.reportTestOutcome(testCaseNb,bRes); + } + + + + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_2.java new file mode 100644 index 0000000..53451e7 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_2.java @@ -0,0 +1,227 @@ +//----------------------------------------------------------------------------- +//Cre_Mha_Pahd +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_pahd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + + +public class Cre_Mha_Pahd_2 extends TestToolkitApplet { + /** result of specific testcase */ + boolean bRes = false; + + boolean handler_available = true; + /** number of testcase */ + byte testCaseNb = (byte) 0x00; + private final byte[] menuItem1 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ',(byte) '1'}; +// private final byte[] menuItem2 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ',(byte) '2'}; + private byte[] TEXT = {(byte)'T',(byte)'E',(byte)'X',(byte)'T',(byte)' ',(byte)'1'}; + + protected final byte[] fileEFtaru = new byte[]{ (byte) 0x01, (byte) 0x3F, (byte) 0x00, (byte) 0x7F, (byte) 0x4A,(byte) 0x6F, (byte) 0x03 }; + + private short eventList[] = { + EVENT_EVENT_DOWNLOAD_MT_CALL, + EVENT_EVENT_DOWNLOAD_CALL_CONNECTED, + EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED, + EVENT_EVENT_DOWNLOAD_LOCATION_STATUS, + EVENT_EVENT_DOWNLOAD_USER_ACTIVITY, + EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CARD_READER_STATUS, + EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION, + EVENT_EVENT_DOWNLOAD_BROWSER_TERMINATION, + EVENT_UNRECOGNIZED_ENVELOPE, + EVENT_PROFILE_DOWNLOAD, + EVENT_FIRST_COMMAND_AFTER_ATR, + EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS, + EVENT_EVENT_DOWNLOAD_ACCESS_TECHNOLOGY_CHANGE, + EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED, + EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, + EVENT_EVENT_BROWSING_STATUS, + EVENT_APPLICATION_DESELECT + }; + + + /** + */ + private Cre_Mha_Pahd_2 () {} + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Cre_Mha_Pahd_2 applet = new Cre_Mha_Pahd_2(); + //initialize the data of the test applet + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + applet.init(); + + //- Applet registration + //register to EVENT_MENU_SELECTION + applet.obReg.initMenuEntry(applet.menuItem1,(short)0,(short)applet.menuItem1.length,(byte)0x00,false,(byte)0x00,(short)0); + //register to EVENT_STATUS_COMMAND + applet.obReg.requestPollInterval((short)1); + //register to EVENT_TIMER_EXPIRATION + applet.obReg.allocateTimer(); + //register to EVENT_EVENT_DOWNLLOAD_LOCAL_CONNECTION + applet.obReg.allocateServiceIdentifier(); + //register to the resto of the events + applet.obReg.setEventList(applet.eventList,(short)0,(short)applet.eventList.length); + //register to file EF_TARU + applet.obReg.registerFileEvent( EVENT_EXTERNAL_FILE_UPDATE,applet.fileEFtaru,(short) 0,(short) applet.fileEFtaru.length, null, (short) 0, (byte)0x00); + } + + + /* + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + bRes=false; + testCaseNb+=(byte)0x01; + + if (testCaseNb==(byte)0x01|| + testCaseNb==(byte)0x11 ){handler_available=false;} + + else if (testCaseNb==(byte)0x02 || + testCaseNb==(byte)0x21){handler_available=true;} + + + switch (event) { + // -- TC 1 + case EVENT_FIRST_COMMAND_AFTER_ATR: + testCaseNb=(byte)0x01; + checkProactiveHandler(); + obReg.clearEvent(EVENT_FIRST_COMMAND_AFTER_ATR); + break; + // -- TC 2 + case EVENT_PROFILE_DOWNLOAD: + checkProactiveHandler(); + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + break; + + case EVENT_EVENT_DOWNLOAD_CALL_CONNECTED: + if (testCaseNb == (byte) 0x10) { + try { + // test case will be finished on triggering EVENT_PROACTIVE_HANDLER_AVAILABE + testCaseNb=(byte)0x0F; + // register to event + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + // get the Proactive Handler + ProactiveHandler prHdr = ProactiveHandlerSystem.getTheHandler(); + // build a proactive command DISPLAY TEXT + prHdr.initDisplayText((byte) 0x80, (byte) 0x04, TEXT, (short) 0, (short) TEXT.length); + // send the proactive command DISPLAY TEXT + prHdr.send(); + + bRes = true; + } + catch (Exception e) { + bRes = false; + this.reportTestOutcome(testCaseNb, bRes); + } + } + else { + checkProactiveHandler(); + } + break; + + case EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED: + + if (testCaseNb == (byte) 0x1E) {//TC30 + try { + // get the ProactiveHandler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + } + catch (ToolkitException exp) { + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + bRes = true; + } + this.reportTestOutcome(testCaseNb, bRes); + } + else{ + checkProactiveHandler(); + } + break; + //--TC 24 + case EVENT_APPLICATION_DESELECT: + checkProactiveHandler(); + obReg.clearEvent(EVENT_APPLICATION_DESELECT); + break; + //--TC 43,45 + case EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE: + checkProactiveHandler(); + if(testCaseNb==(byte)0x1F) { + obReg.clearEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + } + break; + + default: + //TC 7,8,9,10,11,12,13,14,15,16,16,20,21,23,29, + //30,31,33,34,35,36,37,38,39,40,41, + checkProactiveHandler(); + break; + + } + } + + + + + + /** + * Verify if the proactive handler is available or not + */ + private void checkProactiveHandler(){ + bRes=false; + + //handler shall be available + if (handler_available==true){ + try { + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + bRes=true; + } + catch(Exception exp) {bRes=false;} + } + + + //handler shall not be available + else{ + try { + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + } + catch (ToolkitException e) { + if (e.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes=true; + } + } + catch(Exception exp) {bRes=false;} + } + this.reportTestOutcome(testCaseNb,bRes); + } + + + + + +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_3.java new file mode 100644 index 0000000..323b8a1 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Cre_Mha_Pahd_3.java @@ -0,0 +1,155 @@ +//----------------------------------------------------------------------------- +//Cre_Mha_Pahd +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_pahd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; + + +public class Cre_Mha_Pahd_3 extends TestToolkitApplet { + /** result of specific testcase */ + boolean bRes = false; + /** result of test in install method */ + static boolean bIRes = false; + + /** number of testcase */ + byte testCaseNb = (byte) 0x00; +// private short eventList[] = { +// EVENT_EVENT_BROWSING_STATUS, +// EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, +// EVENT_PROACTIVE_HANDLER_AVAILABLE +// }; + + + /** + */ + private Cre_Mha_Pahd_3 () {} + + + private byte[] baTestsResults = new byte[128]; + private byte[] baTestAppletId = new byte[17]; + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Cre_Mha_Pahd_3 applet = new Cre_Mha_Pahd_3(); + //initialize the data of the test applet + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + applet.init(); + + //register to the resto of the events +// applet.obReg.setEventList(applet.eventList,(short)0,(short)applet.eventList.length); + + + // - TC 1.1 (ld 43) + // - The ProactiveHandler is not available outside the processToolkit() method + try{ + bIRes=false; + //get the Proactive Handler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bIRes=true; + } + } + + } + + public void process(APDU apdu) { + if (selectingApplet()){ + //- TC 1.2 (ld 43) + //- The ProactiveHandler is not available outside the processToolkit() method + if (testCaseNb==(byte)0x00){ + testCaseNb=(byte)0x01; + bRes=false; + try{ + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + //bRes can be only true if the first part of test (1.1) is not failed + if (bIRes==true){bRes=true;} + } + } + this.reportTestOutcome(testCaseNb,bRes); + } + + /* end of th test: result is sent to the Terminal */ + /* Construct and send the results of the tests */ + apdu.setOutgoing(); + apdu.setOutgoingLength((short)((short)(this.baTestAppletId[0] + this.baTestsResults[0]) + + (short)2)); + apdu.sendBytesLong(this.baTestAppletId, (short)0, (short)((short)(this.baTestAppletId[0]) + (short)1)); + apdu.sendBytesLong(this.baTestsResults, (short)0, (short)((short)(this.baTestsResults[0]) + (short)1)); + } + else{ + //call the implementation from the test applet + super.process(apdu); + } + } + + + + /** + * Method called to initialize the AID + */ + public void init() throws SystemException { + + // Get the AID value + this.baTestAppletId[0] = JCSystem.getAID().getBytes(this.baTestAppletId, (short)1); + Util.arrayFillNonAtomic(this.baTestsResults, (short)0, (short)this.baTestsResults.length, (byte)0x00); + } + + /** + * Method called by the test applet to report the result of each test case + * + * @param testCaseNumber test case number + * @param result true if successful, false otherwise + */ + protected void reportTestOutcome(byte testCaseNumber, boolean testCaseResult) { + // Update the total number of tests executed + this.baTestsResults[0] = testCaseNumber; + + // Set the Test Case Result byte to 0xCC (for Card Compliant...) if successful + if (testCaseResult) { + this.baTestsResults[testCaseNumber] = (byte)0xCC; + } + else { + this.baTestsResults[testCaseNumber] = (byte)0x00; + } + } + + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + // + } +} + + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Test_Cre_Mha_Pahd.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Test_Cre_Mha_Pahd.java new file mode 100644 index 0000000..98e5bfc --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/Test_Cre_Mha_Pahd.java @@ -0,0 +1,337 @@ +//----------------------------------------------------------------------------- +//Test_Cre_Mha_Pahd +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_pahd; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- + + +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + + +public class Test_Cre_Mha_Pahd extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/catre/cre_mha_pahd"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + /** test applet 1 class AID */ + private static String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + /** */ + private static String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000 F0"; + /** */ + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + public final byte[] AID_ADF1 = {(byte)0xA0, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x09, (byte)0x00, (byte)0x05, (byte)0xFF, + (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x89, + (byte)0xE0, (byte)0x00, (byte)0x00, (byte)0x02}; + + + + /** + * + */ + public Test_Cre_Mha_Pahd(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + // test script + test.reset(); + test.terminalProfileSession("03010000 0102"); + + // Install Applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "20" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01010202" + // V Pos./Id. of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "01" ); // V Maximum number of services + + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800C" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "01" + // V Max. number of timers + "20" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "03030404" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "01" ); // V Maximum number of services + + test.reset(); + //TC 1 - select MF + response = test.selectFile("3F00"); + //TC 2 - send Terminal Profile except SET_EVENT_LIST,POLL_INTERVALL,SETUP_IDLE_MODE_TEXT,SET_UP_MENU + response = test.terminalProfileSession("FFFFDFD FFEFF1FEF FF0000FF FF9FFFEF" + + "03FF000 0007FE300 01"); + //TC 3 - initialization with all the facilities supported (without SETUP_EVENT_LIST + response = test.terminalProfileSession("FFFFFFFF FEFFFFFF FFFFFFFF FFFFFFFF " + + "FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF " + + "FFFF"); + response = test.envelopeMenuSelection("900102","9500"); + testresult = response.checkSw("9000"); + //TC 4 + response = test.envelopeMenuSelection("900101",""); + testresult &= response.checkSw("9000"); + //TC 5 + response = test.envelopeTimerExpiration("A40101"); + //TC 6 + response = test.envelopeCallControlByNAA(); + testresult &= response.checkSw("9000"); + //TC 7 + response = test.envelopeEventDownloadMTCall(); + testresult &= response.checkSw("9000"); + //TC 8 + response = test.envelopeEventDownloadCallConnected(); + testresult &= response.checkSw("9000"); + //TC 9 + response = test.envelopeEventDownloadCallDisconnected(); + testresult &= response.checkSw("9000"); + //TC 10 + response = test.envelopeEventDownloadLocationStatus(); + testresult &= response.checkSw("9000"); + //TC 11 + response = test.envelopeEventDownloadUserActivity(); + testresult &= response.checkSw("9000"); + //TC 12 + response = test.envelopeEventDownloadIdleScreenAvailable(); + testresult &= response.checkSw("9000"); + //TC 13 + response = test.envelopeEventDownloadCardReaderStatus(); + testresult &= response.checkSw("9000"); + //TC 14 + response = test.envelopeEventDownloadLanguageSelection(); + testresult &= response.checkSw("9000"); + //TC 15 + response = test.envelopeEventDownloadBrowserTermination(); + testresult &= response.checkSw("9000"); + //TC 16 + response = test.status("00","0C","00"); + testresult &= response.checkSw("911A"); + //TC 17 + response = test.fetch("1A"); + response = test.terminalResponse("81030140 01820282 8183010038 0281003502 " + + "03003902 000A"); + testresult &= response.checkSw("9000"); + response = test.envelopeEventDownloadDataAvailable("B8028100"); + testresult &= response.checkSw("9000"); + //TC 18 + response = test.envelopeEventDownloadChannelStatus("B8028100"); + testresult &= response.checkSw("9000"); + //TC 19 + response = test.unrecognizedEnvelope(); + testresult &= response.checkSw("9000"); + //TC 20 + response = test.envelopeEventDownloadAccessTechnologyChange(); + testresult &= response.checkSw("9000"); + //TC 21 + response = test.envelopeEventDownloadDisplayParametersChanged(); + //fetch declare service + response = test.fetch("10"); + //get the service record tlv from declare service command + String servrectlv = getServiceRecordTLV(response.getData()); + response = test.terminalResponse("81030147 0082028281 830100"); + testresult &= response.checkSw("9000"); + //TC 22 + response = test.envelopeEventDownloadLocalConnection(servrectlv); + testresult &= response.checkSw("9000"); + //TC 23 + response = test.envelopeEventDownloadCallConnected(); + //fetch display text + response = test.fetch("14"); + response = test.terminalResponse("81030121 80820282 81030100"); + testresult &= response.checkSw("9000"); + //TC 24 + //- Select for activation ADF1 + response = test.selectApplication (byteArrayToHexString(AID_ADF1)); + //- Select for termination ADF1 + response = test.sendApdu ("00A4044C 10"+byteArrayToHexString(AID_ADF1) ); + testresult &= response.checkSw("9000"); + //TC 25 + test.reset(); + //no terminal profile is sent and proactive handler shall not be available. + response = test.envelopeMenuSelection("900102","9500"); + //TC 26 + response = test.envelopeMenuSelection("900101",""); + //TC 27 + response = test.envelopeTimerExpiration("A40101"); + //TC 28 + response = test.envelopeCallControlByNAA(); + //TC 29 + response = test.envelopeEventDownloadMTCall(); + //TC 30 + response = test.envelopeEventDownloadCallConnected(); + //TC 31 + response = test.envelopeEventDownloadCallDisconnected(); + //TC 32 + response = test.envelopeEventDownloadLocationStatus(); + //TC 33 + response = test.envelopeEventDownloadUserActivity(); + //TC 34 + response = test.envelopeEventDownloadIdleScreenAvailable(); + //TC 35 + response = test.envelopeEventDownloadCardReaderStatus(); + //TC 36 + response = test.envelopeEventDownloadLanguageSelection(); + //TC 37 + response = test.envelopeEventDownloadBrowserTermination(); + //TC 38 + response = test.status("00","0C","00"); + //TC 39 + response = test.unrecognizedEnvelope(); + //TC 40 + response = test.envelopeEventDownloadAccessTechnologyChange(); + //TC 41 + response = test.envelopeEventDownloadDisplayParametersChanged(); + //TC 42 + //The Proactive Handler is not available before the + //Terminal Profile + //TC 43 + response = test.envelopeEventDownloadNetworkSearchModeChange(); + //TC 44 + response = test.envelopeEventDownloadBrowsingStatus(); + //TC 45 + test.reset(); + //initialization with all the facilities supported (without SETUP_EVENT_LIST) + response = test.terminalProfileSession("FFFFFFFF FEFFFFFF FFFFFFFF FFFFFFFF " + + "FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF " + + "FFFF"); + response = test.envelopeEventDownloadNetworkSearchModeChange(); + testresult &= response.checkSw("9000"); + //TC 46 + response = test.envelopeEventDownloadBrowsingStatus(); + testresult &= response.checkSw("9000"); + //TC 47 + test.reset(); + // Install Applet + //initialization with all the facilities supported (without SETUP_EVENT_LIST) + response = test.terminalProfileSession("FFFFFFFF FEFFFFFF FFFFFFFF FFFFFFFF " + + "FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF " + + "FFFF"); + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + response = test.selectApplication(APPLET_AID_3); + + + // get result from applets + test.reset(); + // It is possible, based on implemenation of the card manufacturer, in + // case that a CAT facility is not supported by the terminal profile, + // the applet will not be triggered on an unsupported event. + response = test.selectApplication(APPLET_AID_1); + testresult &= (response.checkData("10" +APPLET_AID_1 + + "2DCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCCCC CCCC") || + response.checkData("10" +APPLET_AID_1 + + "18CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CC") ); + + response = test.selectApplication(APPLET_AID_2); + testresult &= (response.checkData("10" +APPLET_AID_2 + + "22CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCC") || + response.checkData("10" +APPLET_AID_2 + + "11CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC " + + "CCCC") ); + + response = test.selectApplication(APPLET_AID_3); + testresult &= response.checkData("10" +APPLET_AID_3 + "01CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + } + + /** + * Converts a byte array to a hex string + * @param byteArray byte array[] + * @return the byte array as hex string:
+ * E.g: byteArray{(byte)0x11,(byte)0x22,(byte)0x33} will be returned + * as String "112233" + */ + private String byteArrayToHexString(byte[] byteArray){ + StringBuffer stringBuffer = new StringBuffer(); + for(int i=0; i22){ + temp=temp.substring(22);//cut off BER TLV, len command details and dev id + int len = Integer.valueOf(temp.substring(2,4),16).intValue(); + if (len==temp.length()){ + return temp; + } + else{ + // suppress UICC/terminal interface TLV + return temp.substring(0,(Integer.valueOf(temp.substring(2,4),16).intValue())*2+4); + } + } + else return ""; + + } + + + + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/applet.opt new file mode 100644 index 0000000..73d39ec --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_mha_pahd.Cre_Mha_Pahd_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_mha_pahd.Cre_Mha_Pahd_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_mha_pahd.Cre_Mha_Pahd_1 +uicc.test.catre.cre_mha_pahd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/javacard/cre_mha_pahd.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_pahd/javacard/cre_mha_pahd.cap new file mode 100644 index 0000000000000000000000000000000000000000..d5084ed561546e56794f10ca2261fe703d5d5955 GIT binary patch literal 5677 zcmbVQ3vg7`8UF7*=RWqCv&rse^CIC92qBP!mm6aw86Jg3G-!NLE36?lAwbp;0*w?l ziAoAtffA1@KL9=e)bU&!o3sepNqk z=%OzwwwG@0EPFWPTYjg0%OAzjE!$^`{nJi=_Uft}1zWS?jSstvy|E-Sdlb_ujSq`3GNkjTe?zPnn@!lctm(Tsr#rLmw{~$o)3* z&?VyJwCSHbcSZM`$2RmolK0}7Sxvtvyy5!ZQJ*aM@h?~2`0yp`{C8KKRdW}9pf0+@ z3|+JJdVi+#Cq0?-uFZe1^wRc>+@EFT{_D#1Z66(awtw22A9)v5{C?uz^;Z`jn)m3e znubFayB--m^UHxP1Akk!>%hID{OBu(CpA7@zWu%6v8<=AFJ1g*S7GU?#&ORaJ#cu9 z@9?6pUfVHs=g(UP&V=XsI*&~nc&4*)Z^>()&-$06rrI!sr>C4}5wJ@7>ZDx@UeyQ*+_MSZJ`$LL}f-z$X_ z<*|5`N{W^luVSR=!|}aeRowT^rD%qfj*S=m2PbtNaBnNIqX!UA2Vmi&A9U+%u+R+7deTPb®0j z2wH=<)M`88w479fV+bpay~az%iCA5HyTq>fw|;04NlAWjEv#>CXkI28W*8@(tT8fy z_0t6QP=vEzQ33lbVzO^&0;Y*`lM1*R;oMIXbXTNEFGqe&gzGm@fj$&5^`}vOj=263 z%FjXn22C)=M{GtZ6&SS8m!PneXv3o zD}xn=$O~4OqBPjezSn4Ku$u!-3z!yIhXlJ?g54~^)=IFRV7DI7WVMc37VI{nC593Y zcAIFBEg%eOz@_^vxT8)N8>ROTWmB4i6++j8-S&XhX6XrmRktG`yxW}UhO-Q=t};Y+ zm%%rs48EcazMeApid3YA@FF#Z52;N>Viz`~4vxerHX?NiKT@|yN17rskP4BB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X;BAYj@`P!RFb6V6M0KLh8DYbn6rwKW3MgTu zJVu-7fPAzo>U!F&G$0ZUtL$UyqDv4?#ZKSPg!Q=5{C^8#8Xj|^y;JTcHZ zG}F%`Dz^20Eu!Ld;MZk5J`PxCWDK%tnTU6*e6%at4#cw~o;IxNyU)clRGbhPdZtI? z4V$oysIV%MVdYT-VF{;`h{}*L89{#^-q{kBZ2B-F%)+qQ4aKOWJE;NB4pTAq!Y0Eq z;l@jN8>1Vt6~+nLEJq)|Ahl2{qz!+qRyvZeqjuJF1mtq$}7hWjH3!(Vmf4d%%D0aLwW02hD7wl3xgQ?Y%IRynjgD9NJLM(0*Il%o-}&mg+OAA z#M5#thCF^J*Mr$3XXixl#3OGEd}q?&u>)`-dgAvnhJF;E%;cJ$@U=_~k@$&>g($_9 pR&pT{KA4Fi62B0!5ci}c8zTODQB$qq-HLZQ{!Gw51uu4@e*=)31keBg literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_1.java new file mode 100644 index 0000000..35daf04 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_1.java @@ -0,0 +1,272 @@ +//----------------------------------------------------------------------------- +// CAT_RE.CRE_MHA_PRHD +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_prhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; +import uicc.access.UICCConstants; + + +public class Cre_Mha_Prhd_1 extends TestToolkitApplet { + + /* + /** result of specific testcase */ + boolean bRes = false; + + + /** number of testcase */ + byte testCaseNb = (byte) 0x00; + /** */ + boolean handler_available = true; + private final byte[] menuItem1 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ',(byte) '1'}; + private final byte[] menuItem2 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ',(byte) '2'}; + private final byte QUALIFIER_1 = (byte) 0x01; + private final byte[] ADDRESS_VALUE = {(byte) 0x81, (byte) 0x55, (byte) 0x66, (byte) 0x77, (byte) 0x88}; + private final byte[] BEARER_VALUE = {(byte) 0x03, (byte) 0x00}; + private final byte[] BUFFER_SIZE_VALUE = {(byte) 0x00, (byte) 0x01}; + protected byte service_id = (byte)0x00; + protected final byte[] fileEFtaru = new byte[]{ (byte) 0x01, (byte) 0x3F, (byte) 0x00, (byte) 0x7F, (byte) 0x4A,(byte) 0x6F, (byte) 0x03 }; + // Technology independet,servicenr. 0, service record: 00 00 + protected byte[] SERVICE_RECORD_VALUE = {(byte)0x00,(byte)0x00,(byte)0x00}; + + private final short eventList[] = { + EVENT_EVENT_DOWNLOAD_MT_CALL, + EVENT_EVENT_DOWNLOAD_CALL_CONNECTED, + EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED, + EVENT_EVENT_DOWNLOAD_LOCATION_STATUS, + EVENT_EVENT_DOWNLOAD_USER_ACTIVITY, + EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CARD_READER_STATUS, + EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION, + EVENT_EVENT_DOWNLOAD_BROWSER_TERMINATION, + EVENT_UNRECOGNIZED_ENVELOPE, + EVENT_CALL_CONTROL_BY_NAA, + EVENT_PROFILE_DOWNLOAD, + EVENT_FIRST_COMMAND_AFTER_ATR, + EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS, + EVENT_EVENT_DOWNLOAD_ACCESS_TECHNOLOGY_CHANGE, + EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED, + EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, + EVENT_EVENT_BROWSING_STATUS, + EVENT_APPLICATION_DESELECT + }; + + + + + /** + */ + private Cre_Mha_Prhd_1 () {} + + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + + + Cre_Mha_Prhd_1 applet = new Cre_Mha_Prhd_1(); + //initialize the data of the test applet + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + //initalise all values of the TestToolkitApplet + applet.init(); + + //register to EVENT_MENU_SELECTION + applet.obReg.initMenuEntry(applet.menuItem1,(short)0,(short)applet.menuItem1.length,(byte)0x00,false,(byte)0x00,(short)0); + //register to EVENT_MENU_SELECTION_HELP_REQUEST + applet.obReg.initMenuEntry(applet.menuItem2,(short)0,(short)applet.menuItem2.length,(byte)0x00,true ,(byte)0x00,(short)0); + //register to EVENT_STATUS_COMMAND + applet.obReg.requestPollInterval((short)1); + //register to EVENT_EVENT_DOWNLLOAD_LOCAL_CONNECTION + applet.service_id = applet.obReg.allocateServiceIdentifier(); + //store the allocated service id + applet.SERVICE_RECORD_VALUE[(byte)0x01]=applet.service_id; + //register to the rest of the events + applet.obReg.setEventList(applet.eventList,(short)0,(short)(applet.eventList.length)); + //register to file EF_TARU + applet.obReg.registerFileEvent( EVENT_EXTERNAL_FILE_UPDATE,applet.fileEFtaru,(short) 0,(short) applet.fileEFtaru.length, null, (short) 0, (byte)0x00); + //register to EVENT_TIMER_EXPIRATION + for (byte timer=(byte)0x00;timer<(byte)0x08;timer++){ + applet.obReg.allocateTimer(); + } + for (byte timer=(byte)0x02;timer<=(byte)0x08;timer++){ + //release timer from 2 to 8 to be sure that only timer id 1 is allocated + applet.obReg.releaseTimer(timer); + } + + } + + /* + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + bRes=false; + testCaseNb+=(byte)0x01; + + if (testCaseNb==(byte)0x01|| + testCaseNb==(byte)0x18) {handler_available=false;} + + else if (testCaseNb==(byte)0x02 || + testCaseNb==(byte)0x2C ){handler_available=true;} + + switch(event){ + //--TC 1 + case EVENT_FIRST_COMMAND_AFTER_ATR: + + testCaseNb=(byte)0x01; + checkProactiveHandler(); + obReg.clearEvent(EVENT_FIRST_COMMAND_AFTER_ATR); + break; + //--TC 2 + case EVENT_PROFILE_DOWNLOAD: + + checkProactiveHandler(); + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + break; + + //--TC 8,23,30, + case EVENT_EVENT_DOWNLOAD_CALL_CONNECTED: + + if (testCaseNb!=(byte)0x17)checkProactiveHandler(); + else if (testCaseNb==(byte)0x17){ + //tc shall be set afterwards by triggering proactive handler available + testCaseNb=(byte)0x16;//set tc back to nr.23 + //register to event + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + } + break; + //--TC 16 + case EVENT_STATUS_COMMAND: + + if (testCaseNb==(byte)0x10) { + checkProactiveHandler();//check if the proactive handler is available + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + // Open channel(1) proactive command for test case 17 ( + proHdr.init(PRO_CMD_OPEN_CHANNEL, QUALIFIER_1, DEV_ID_TERMINAL); + proHdr.appendTLV(TAG_ADDRESS, ADDRESS_VALUE, (short)0, (short)5); + proHdr.appendTLV(TAG_BEARER_DESCRIPTION, BEARER_VALUE, (short)0, (short)2); + proHdr.appendTLV(TAG_BUFFER_SIZE, BUFFER_SIZE_VALUE, (short)0, (short)2); + proHdr.send(); + } + else { + checkProactiveHandler(); + } + break; + + //--TC 21,41 + case EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED: + + if(testCaseNb==(byte)0x15) { + try { + //get the ProactiveHandler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + proHdr.init(PRO_CMD_DECLARE_SERVICE, (byte)0, DEV_ID_TERMINAL); + proHdr.appendTLV(TAG_SERVICE_RECORD, SERVICE_RECORD_VALUE, (short) 0, (short) 3); + if (proHdr.send() == (byte) 0x00) { + bRes = true; + } + } + catch (Exception exp) { + bRes = false; + } + } + else if (testCaseNb==(byte)0x29){ + try { + //get the ProactiveHandler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp) { + //register to EVENT_PROACTIVE_HANDLER AVAILABLE + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + bRes=true; + } + } + this.reportTestOutcome(testCaseNb,bRes); + break; + + //--TC 24 + case EVENT_APPLICATION_DESELECT: + + checkProactiveHandler(); + obReg.clearEvent(EVENT_APPLICATION_DESELECT); + break; + + //--TC 43,45 + case EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE: + + checkProactiveHandler(); + if(testCaseNb==(byte)0x2A) { + obReg.clearEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + //handler shall not be available + } + break; + + //- TC 3,4,5,6,7,9,10,11,12 + // 13,14,15,17,18,19,20,22 <-handler available + // 24,25,26,27,28,29,31,32,33,34,35,36,37 + // 38,39,40, + default: + checkProactiveHandler(); + break; + } + } + + + /** + * Verify if the proactive response handler is available or not + */ + private void checkProactiveHandler() + { + bRes=false; + + //handler shall be available + if (handler_available==true){ + try { + ProactiveResponseHandler proHdr = ProactiveResponseHandlerSystem.getTheHandler(); + bRes=true; + } + catch(Exception exp) {bRes=false;} + } + + //handler shall not be available + else{ + try { + ProactiveResponseHandler proHdr = ProactiveResponseHandlerSystem.getTheHandler(); + } + catch (ToolkitException e) { + if (e.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes=true; + } + } + catch(Exception exp) {bRes=false;} + } + this.reportTestOutcome(testCaseNb,bRes); + } + + + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_2.java new file mode 100644 index 0000000..48f7b63 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_2.java @@ -0,0 +1,224 @@ +//----------------------------------------------------------------------------- +// CAT_RE.CRE_MHA_PRHD +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_prhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; +import uicc.access.UICCConstants; + + +public class Cre_Mha_Prhd_2 extends TestToolkitApplet { + boolean bRes = false; + + boolean handler_available = true; + /** number of testcase */ + byte testCaseNb = (byte) 0x00; + private final byte[] menuItem1 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ',(byte) '1'}; +// private final byte[] menuItem2 = {(byte) 'I', (byte) 't', (byte) 'e', (byte) 'm', (byte) ' ',(byte) '2'}; + private byte[] TEXT = {(byte)'T',(byte)'E',(byte)'X',(byte)'T',(byte)' ',(byte)'1'}; + + protected final byte[] fileEFtaru = new byte[]{ (byte) 0x01, (byte) 0x3F, (byte) 0x00, (byte) 0x7F, (byte) 0x4A,(byte) 0x6F, (byte) 0x03 }; + + private short eventList[] = { + EVENT_EVENT_DOWNLOAD_MT_CALL, + EVENT_EVENT_DOWNLOAD_CALL_CONNECTED, + EVENT_EVENT_DOWNLOAD_CALL_DISCONNECTED, + EVENT_EVENT_DOWNLOAD_LOCATION_STATUS, + EVENT_EVENT_DOWNLOAD_USER_ACTIVITY, + EVENT_EVENT_DOWNLOAD_IDLE_SCREEN_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CARD_READER_STATUS, + EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION, + EVENT_EVENT_DOWNLOAD_BROWSER_TERMINATION, + EVENT_UNRECOGNIZED_ENVELOPE, + EVENT_PROFILE_DOWNLOAD, + EVENT_FIRST_COMMAND_AFTER_ATR, + EVENT_EVENT_DOWNLOAD_DATA_AVAILABLE, + EVENT_EVENT_DOWNLOAD_CHANNEL_STATUS, + EVENT_EVENT_DOWNLOAD_ACCESS_TECHNOLOGY_CHANGE, + EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED, + EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, + EVENT_EVENT_BROWSING_STATUS, + EVENT_APPLICATION_DESELECT + }; + + + /** + */ + private Cre_Mha_Prhd_2 () {} + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Cre_Mha_Prhd_2 applet = new Cre_Mha_Prhd_2(); + //initialize the data of the test applet + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + applet.init(); + + //- Applet registration + //register to EVENT_MENU_SELECTION + applet.obReg.initMenuEntry(applet.menuItem1,(short)0,(short)applet.menuItem1.length,(byte)0x00,false,(byte)0x00,(short)0); + //register to EVENT_STATUS_COMMAND + applet.obReg.requestPollInterval((short)1); + //register to EVENT_TIMER_EXPIRATION + applet.obReg.allocateTimer(); + //register to EVENT_EVENT_DOWNLLOAD_LOCAL_CONNECTION + applet.obReg.allocateServiceIdentifier(); + //register to the resto of the events + applet.obReg.setEventList(applet.eventList,(short)0,(short)applet.eventList.length); + //register to file EF_TARU + applet.obReg.registerFileEvent( EVENT_EXTERNAL_FILE_UPDATE,applet.fileEFtaru,(short) 0,(short) applet.fileEFtaru.length, null, (short) 0, (byte)0x00); + } + + + /* + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + bRes=false; + testCaseNb+=(byte)0x01; + + if (testCaseNb==(byte)0x01|| + testCaseNb==(byte)0x11 ){handler_available=false;} + + else if (testCaseNb==(byte)0x02 || + testCaseNb==(byte)0x21){handler_available=true;} + + + switch (event) { + // -- TC 1 + case EVENT_FIRST_COMMAND_AFTER_ATR: + testCaseNb=(byte)0x01; + checkProactiveHandler(); + obReg.clearEvent(EVENT_FIRST_COMMAND_AFTER_ATR); + break; + // -- TC 2 + case EVENT_PROFILE_DOWNLOAD: + checkProactiveHandler(); + obReg.clearEvent(EVENT_PROFILE_DOWNLOAD); + break; + + case EVENT_EVENT_DOWNLOAD_CALL_CONNECTED: + if (testCaseNb == (byte) 0x10) { + try { + // test case will be finished on triggering EVENT_PROACTIVE_HANDLER_AVAILABE + testCaseNb=(byte)0x0F; + // register to event + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + // get the Proactive Handler + ProactiveHandler prHdr = ProactiveHandlerSystem.getTheHandler(); + // build a proactive command DISPLAY TEXT + prHdr.initDisplayText((byte) 0x80, (byte) 0x04, TEXT, (short) 0, (short) TEXT.length); + // send the proactive command DISPLAY TEXT + prHdr.send(); + + bRes = true; + } + catch (Exception e) { + bRes = false; + this.reportTestOutcome(testCaseNb, bRes); + } + } + else { + checkProactiveHandler(); + } + break; + + case EVENT_EVENT_DOWNLOAD_DISPLAY_PARAMETER_CHANGED: + + if (testCaseNb == (byte) 0x1E) {//TC30 + try { + // get the ProactiveHandler + ProactiveHandler proHdr = ProactiveHandlerSystem.getTheHandler(); + } + catch (ToolkitException exp) { + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + bRes = true; + } + this.reportTestOutcome(testCaseNb, bRes); + } + else{ + checkProactiveHandler(); + } + break; + //--TC 24 + case EVENT_APPLICATION_DESELECT: + checkProactiveHandler(); + obReg.clearEvent(EVENT_APPLICATION_DESELECT); + break; + //--TC 43,45 + case EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE: + checkProactiveHandler(); + if(testCaseNb==(byte)0x1F) { + obReg.clearEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + } + break; + + default: + //TC 7,8,9,10,11,12,13,14,15,16,16,20,21,23,29, + //30,31,33,34,35,36,37,38,39,40,41, + checkProactiveHandler(); + break; + + } + } + + + + + + /** + * Verify if the proactive handler is available or not + */ + private void checkProactiveHandler(){ + bRes=false; + + //handler shall be available + if (handler_available==true){ + try { + ProactiveResponseHandler proHdr = ProactiveResponseHandlerSystem.getTheHandler(); + bRes=true; + } + catch(Exception exp) {bRes=false;} + } + + + //handler shall not be available + else{ + try { + ProactiveResponseHandler proHdr = ProactiveResponseHandlerSystem.getTheHandler(); + } + catch (ToolkitException e) { + if (e.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE) { + bRes=true; + } + } + catch(Exception exp) {bRes=false;} + } + this.reportTestOutcome(testCaseNb,bRes); + } + + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_3.java new file mode 100644 index 0000000..6214d02 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Cre_Mha_Prhd_3.java @@ -0,0 +1,161 @@ +//----------------------------------------------------------------------------- +//FWK_MHA_PRHD +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_prhd; +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import javacard.framework.*; + +import uicc.test.util.TestToolkitApplet; +import uicc.toolkit.*; +import uicc.access.UICCConstants; + + +public class Cre_Mha_Prhd_3 extends TestToolkitApplet { + + /** result of specific testcase */ + boolean bRes = false; + /** result of test in install method */ + static boolean bInstallRes = false; + /** number of testcase */ + private byte testCaseNb = (byte) 0x00; + /** */ + private boolean HANDLER_AVAILABLE = true; + /** list included registered all events */ +// private short eventList[] = { +// EVENT_EVENT_DOWNLOAD_NETWORK_SEARCH_MODE_CHANGE, +// EVENT_EVENT_BROWSING_STATUS, +// EVENT_PROACTIVE_HANDLER_AVAILABLE, +// }; + + + + /** */ + private Cre_Mha_Prhd_3 () {} + + + private byte[] baTestsResults = new byte[128]; + private byte[] baTestAppletId = new byte[17]; + + /** + * Create an instance of the Applet, the Java Card runtime environment will call this static method first. + * + * @param bArray the array containing installation parameters + * @param bOffset the starting offset in bArray + * @param bLength the length in bytes of the parameter data in bArray The maximum value of bLength is 127. + * @throws ISOException if the install method failed + * @see javacard.framework.Applet + */ + public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException { + Cre_Mha_Prhd_3 applet = new Cre_Mha_Prhd_3(); + //initialize the data of the test applet + byte aidLen = bArray[bOffset]; + if (aidLen == (byte) 0) { + applet.register(); + } + else { + applet.register(bArray, (short) (bOffset + 1), aidLen); + } + + applet.init(); + //register to the resto of the events +// applet.obReg.setEventList(applet.eventList,(short)0,(short)(applet.eventList.length)); + //register to file EF_TARU +// applet.obReg.registerFileEvent(EVENT_EXTERNAL_FILE_UPDATE,new byte[]{(byte) 0x6F03},(short)0,(short)1,null,(short)0,(byte)0x00); + + // - TC 1.1 (ld 43) + // - The ProactiveResponseHandler is not available outside the processToolkit() method + try{ + bInstallRes=false; + //get the ProactiveResponseHandler + ProactiveResponseHandler proRHdr = ProactiveResponseHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + bInstallRes=true; + } + } + } + + + public void process(APDU apdu) { + if (selectingApplet()){ + //- TC 1.2 (ld 43) + //- The ProactiveHandler is not available outside the processToolkit() method + if (testCaseNb==(byte)0x00){ + testCaseNb=(byte)0x01; + bRes=false; + try{ + ProactiveResponseHandler proRHdr = ProactiveResponseHandlerSystem.getTheHandler(); + } + catch(ToolkitException exp){ + if (exp.getReason()==ToolkitException.HANDLER_NOT_AVAILABLE){ + //bRes can be only true if the first part of test (1.1) is not failed + if (bInstallRes==true){bRes=true;} + } + } + this.reportTestOutcome(testCaseNb,bRes); + } + + /* end of th test: result is sent to the Terminal */ + /* Construct and send the results of the tests */ + apdu.setOutgoing(); + apdu.setOutgoingLength((short)((short)(this.baTestAppletId[0] + this.baTestsResults[0]) + + (short)2)); + apdu.sendBytesLong(this.baTestAppletId, (short)0, (short)((short)(this.baTestAppletId[0]) + (short)1)); + apdu.sendBytesLong(this.baTestsResults, (short)0, (short)((short)(this.baTestsResults[0]) + (short)1)); + } + else{ + //call the implementation from the test applet + super.process(apdu); + } + } + + + /** + * Method called to initialize the AID + */ + public void init() throws SystemException { + + // Get the AID value + this.baTestAppletId[0] = JCSystem.getAID().getBytes(this.baTestAppletId, (short)1); + Util.arrayFillNonAtomic(this.baTestsResults, (short)0, (short)this.baTestsResults.length, (byte)0x00); + } + + /** + * Method called by the test applet to report the result of each test case + * + * @param testCaseNumber test case number + * @param result true if successful, false otherwise + */ + protected void reportTestOutcome(byte testCaseNumber, boolean testCaseResult) { + // Update the total number of tests executed + this.baTestsResults[0] = testCaseNumber; + + // Set the Test Case Result byte to 0xCC (for Card Compliant...) if successful + if (testCaseResult) { + this.baTestsResults[testCaseNumber] = (byte)0xCC; + } + else { + this.baTestsResults[testCaseNumber] = (byte)0x00; + } + } + + /* (non-Javadoc) + * @see uicc.toolkit.ToolkitInterface#processToolkit(short) + */ + public void processToolkit(short event) throws ToolkitException { + bRes=false; + + + + } + + +} + \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Test_Cre_Mha_Prhd.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Test_Cre_Mha_Prhd.java new file mode 100644 index 0000000..29ae33a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/Test_Cre_Mha_Prhd.java @@ -0,0 +1,336 @@ +//----------------------------------------------------------------------------- +//Test_Api_2_Bte_Sttg.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_mha_prhd; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccAPITestCardService; +import org.etsi.scp.wg3.uicc.jcapi.userclass.UiccTestModel; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.APDUResponse; +import org.etsi.scp.wg3.uicc.jcapi.userinterface.UiccCardManagementService; + +public class Test_Cre_Mha_Prhd extends UiccTestModel { + /** relative path of the package */ + private static String CAP_FILE_PATH = "uicc/test/catre/cre_mha_prhd"; + /** test applet 1 class AID */ + private static String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + /** test applet 1 class AID */ + private static String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + /** */ + private static String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + /** test applet 1 instance aid */ + private static String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + /** */ + private static String TERMINAL_PROFILE = "09030120 00000000 00000000F"; + /** */ + private static String AID_ADF1 = "A0000000090005FFFFFFFF89E0000002"; + + private UiccAPITestCardService test = null; + /** contains the response from the executed command */ + private APDUResponse response = null; + /** stores the test result */ + private boolean testresult = false; + + /** + * + */ + public Test_Cre_Mha_Prhd(){ + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + /** + * Installs the applet, runs the tests and checks the test result. + */ + public boolean run(){ + + // test script + test.reset(); + test.terminalProfileSession("03010000 0102"); + + // Install Applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "08" + // V Max. number of timers + "20" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01010202" + // V Pos./Id. of menu entries + "01" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "01" ); // V Maximum number of services + + + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800C" + // TLV UICC Toolkit application specific parameters + "02" + // V Priority Level + "01" + // V Max. number of timers + "20" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "03030404" + // V Pos./Id. of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "01" ); // V Maximum number of services + + test.reset(); + //TC 1 - select MF + response = test.selectFile("3F00"); + //TC 2 - send Terminal Profile except SET_EVENT_LIST,POLL_INTERVALL,SETUP_IDLE_MODE_TEXT,SET_UP_MENU + response = test.terminalProfileSession("FFFFDFD FFEFF1FEF FF0000FF FF9FFFEF" + + "03FF000 0007FE300 01"); + //TC 3 - initialization with all the facilities supported (without SETUP_EVENT_LIST + response = test.terminalProfileSession("FFFFFFFF FEFFFFFF FFFFFFFF FFFFFFFF " + + "FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF " + + "FFFF"); + response = test.envelopeMenuSelection("900102","9500"); + testresult = response.checkSw("9000"); + //TC 4 + response = test.envelopeMenuSelection("900101",""); + testresult &= response.checkSw("9000"); + //TC 5 + response = test.envelopeTimerExpiration("A40101"); + //TC 6 + response = test.envelopeCallControlByNAA(); + testresult &= response.checkSw("9000"); + //TC 7 + response = test.envelopeEventDownloadMTCall(); + testresult &= response.checkSw("9000"); + //TC 8 + response = test.envelopeEventDownloadCallConnected(); + testresult &= response.checkSw("9000"); + //TC 9 + response = test.envelopeEventDownloadCallDisconnected(); + testresult &= response.checkSw("9000"); + //TC 10 + response = test.envelopeEventDownloadLocationStatus(); + testresult &= response.checkSw("9000"); + //TC 11 + response = test.envelopeEventDownloadUserActivity(); + testresult &= response.checkSw("9000"); + //TC 12 + response = test.envelopeEventDownloadIdleScreenAvailable(); + testresult &= response.checkSw("9000"); + //TC 13 + response = test.envelopeEventDownloadCardReaderStatus(); + testresult &= response.checkSw("9000"); + //TC 14 + response = test.envelopeEventDownloadLanguageSelection(); + testresult &= response.checkSw("9000"); + //TC 15 + response = test.envelopeEventDownloadBrowserTermination(); + testresult &= response.checkSw("9000"); + //TC 16 + response = test.status("00","0C","00"); + testresult &= response.checkSw("911A"); + //TC 17 + response = test.fetch("1A"); + response = test.terminalResponse("81030140 01820282 8183010038 0281003502 " + + "03003902 000A"); + testresult &= response.checkSw("9000"); + response = test.envelopeEventDownloadDataAvailable("B8028100"); + testresult &= response.checkSw("9000"); + //TC 18 + response = test.envelopeEventDownloadChannelStatus("B8028100"); + testresult &= response.checkSw("9000"); + //TC 19 + response = test.unrecognizedEnvelope(); + testresult &= response.checkSw("9000"); + //TC 20 + response = test.envelopeEventDownloadAccessTechnologyChange(); + testresult &= response.checkSw("9000"); + //TC 21 + response = test.envelopeEventDownloadDisplayParametersChanged(); + //fetch declare service + response = test.fetch("10"); + //get the service record tlv from declare service command + String servrectlv = getServiceRecordTLV(response.getData()); + response = test.terminalResponse("81030147 0082028281 830100"); + testresult &= response.checkSw("9000"); + //TC 22 + response = test.envelopeEventDownloadLocalConnection(servrectlv); + testresult &= response.checkSw("9000"); + //TC 23 + response = test.envelopeEventDownloadCallConnected(); + //fetch display text + response = test.fetch("14"); + response = test.terminalResponse("81030121 80820282 81030100"); + testresult &= response.checkSw("9000"); + //TC 24 + //- Select for activation ADF1 + response = test.selectApplication (AID_ADF1); + //- Select for termination ADF1 + response = test.sendApdu ("00A4044C 10"+AID_ADF1 ); + testresult &= response.checkSw("9000"); + //TC 25 + test.reset(); + //no terminal profile is sent and proactive handler shall not be available. + response = test.envelopeMenuSelection("900102","9500"); + //TC 26 + response = test.envelopeMenuSelection("900101",""); + //TC 27 + response = test.envelopeTimerExpiration("A40101"); + //TC 28 + response = test.envelopeCallControlByNAA(); + //TC 29 + response = test.envelopeEventDownloadMTCall(); + //TC 30 + response = test.envelopeEventDownloadCallConnected(); + //TC 31 + response = test.envelopeEventDownloadCallDisconnected(); + //TC 32 + response = test.envelopeEventDownloadLocationStatus(); + //TC 33 + response = test.envelopeEventDownloadUserActivity(); + //TC 34 + response = test.envelopeEventDownloadIdleScreenAvailable(); + //TC 35 + response = test.envelopeEventDownloadCardReaderStatus(); + //TC 36 + response = test.envelopeEventDownloadLanguageSelection(); + //TC 37 + response = test.envelopeEventDownloadBrowserTermination(); + //TC 38 + response = test.status("00","0C","00"); + //TC 39 + response = test.unrecognizedEnvelope(); + //TC 40 + response = test.envelopeEventDownloadAccessTechnologyChange(); + //TC 41 + response = test.envelopeEventDownloadDisplayParametersChanged(); + //TC 42 + //The Proactive Handler is not available before the + //Terminal Profile + //TC 43 + response = test.envelopeEventDownloadNetworkSearchModeChange(); + //TC 44 + response = test.envelopeEventDownloadBrowsingStatus(); + //TC 45 + test.reset(); + //initialization with all the facilities supported (without SETUP_EVENT_LIST) + response = test.terminalProfileSession("FFFFFFFF FEFFFFFF FFFFFFFF FFFFFFFF " + + "FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF " + + "FFFF"); + response = test.envelopeEventDownloadNetworkSearchModeChange(); + testresult &= response.checkSw("9000"); + //TC 46 + response = test.envelopeEventDownloadBrowsingStatus(); + testresult &= response.checkSw("9000"); + //TC 47 + test.reset(); + // Install Applet + //initialization with all the facilities supported (without SETUP_EVENT_LIST) + response = test.terminalProfileSession("FFFFFFFF FEFFFFFF FFFFFFFF FFFFFFFF " + + "FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF " + + "FFFF"); + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + response = test.selectApplication(APPLET_AID_3); + + + // get result from applets + test.reset(); + + // It is possible, based on implemenation of the card manufacturer, in + // case that a CAT facility is not supported by the terminal profile, + // the applet will not be triggered on an unsupported event. + response = test.selectApplication(APPLET_AID_1); + testresult &= (response.checkData("10" +APPLET_AID_1 + + "2DCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCCCC CCCC" + ) || + response.checkData("10" +APPLET_AID_1 + + "1CCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCCCC CC" + )); + + + response = test.selectApplication(APPLET_AID_2); + testresult &= response.checkData("10" +APPLET_AID_2 + + "22CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCC" + ) + || + response.checkData("10" +APPLET_AID_2 + + "15CCCCCC CCCCCCCC CCCCCCCC CCCCCCCC"+ + "CCCCCCCC CCCC" + ); + + + response = test.selectApplication(APPLET_AID_3); + testresult &= response.checkData("10" +APPLET_AID_3 + "01CC"); + + // delete applet and package + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return testresult; + + } + + + /** + * Converts a byte array to a hex string + * @param byteArray byte array[] + * @return the byte array as hex string:
+ * E.g: byteArray{(byte)0x11,(byte)0x22,(byte)0x33} will be returned + * as String "112233" + */ + private String byteArrayToHexString(byte[] byteArray){ + StringBuffer stringBuffer = new StringBuffer(); + for(int i=0; i22){ + temp=temp.substring(22);//cut off BER TLV, len command details and dev id + int len = Integer.valueOf(temp.substring(2,4),16).intValue(); + if (len==temp.length()){ + return temp; + } + else{ + // suppress UICC/terminal interface TLV + return temp.substring(0,(Integer.valueOf(temp.substring(2,4),16).intValue())*2+4); + } + } + else return ""; + + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/applet.opt new file mode 100644 index 0000000..08d2a6f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_mha_prhd.Cre_Mha_Prhd_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_mha_prhd.Cre_Mha_Prhd_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_mha_prhd.Cre_Mha_Prhd_1 +uicc.test.catre.cre_mha_prhd +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/javacard/cre_mha_prhd.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_mha_prhd/javacard/cre_mha_prhd.cap new file mode 100644 index 0000000000000000000000000000000000000000..79885c7eaae24cf6142529e21e25f28c418158e6 GIT binary patch literal 5710 zcmbVQ3vg7`8UF7*=RWp*Hrc(o$r2I*ND?+AyktWN5CaGTnqsJ^RaugC5<-&gCLmoh zuvw4rE0BE#$s`(Sj(7E7!@6Hd{lAT^gnkA%WiGm>D~R$ zx#vIs<2?TFo=43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++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/Cre_Pcs_Igco_1.java @@ -0,0 +1,118 @@ +//----------------------------------------------------------------------------- +// Cre_Pce_Igco_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_pcs_igco; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import uicc.test.util.* ; + +/** + * Test Area : sim.framework... + * + * Applet is triggered on Install (Install), EVENT_MENU_SELECTION + * + * @version 0.0.1 - 15/07/01 + * + */ + +public class Cre_Pcs_Igco_1 extends TestToolkitApplet +{ + + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + + private static byte IDmenu01; + private static byte IDmenu02; + + byte[] Test = {(byte)'T',(byte)'e',(byte)'s',(byte)'t',(byte)' ',(byte)'A'} ; + + /** + * Constructor of the applet + */ + public Cre_Pcs_Igco_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Cre_Pcs_Igco_1 thisApplet = new Cre_Pcs_Igco_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + IDmenu01 = thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, + (short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + MenuInit [4] = (byte) '2'; + IDmenu02 = thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, + (short) MenuInit.length, (byte) 0, false, + (byte) 0, (short) 0); + } + + + public void processToolkit(short event) + { + // Number of tests + byte testCaseNb = (byte)0; + // Result of tests + boolean bRes = false; + + + // Get the system instance of the ProactiveHandler class + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + if (event != EVENT_MENU_SELECTION) + return; + + // check menu ID + byte menuID = envHdlr.getItemIdentifier(); + + // ----------------------------------------------------------------- + // Test Case 2 : Menu Item 01 + // ----------------------------------------------------------------- + if( menuID == IDmenu01 ) + { + testCaseNb = (byte) 1; + Test[5] = (byte) 'A'; + proHdlr.initDisplayText((byte)0x00, (byte)0x04 /*DCS_8_BIT_DATA*/, Test, (short)0, (short)Test.length) ; + proHdlr.send() ; + + bRes = true; + } + + // ----------------------------------------------------------------- + // Test Case 3 : Menu Item 02 + // ----------------------------------------------------------------- + if( menuID == IDmenu02 ) + { + testCaseNb = (byte) 2; + Test[5] = (byte) 'B'; + proHdlr.initDisplayText((byte)0x00, (byte)0x04 /*DCS_8_BIT_DATA*/, Test, (short)0, (short)Test.length) ; + proHdlr.send() ; + + Test[5] = (byte) 'C'; + proHdlr.initDisplayText((byte)0x00, (byte)0x04 /*DCS_8_BIT_DATA*/, Test, (short)0, (short)Test.length) ; + proHdlr.send() ; + + bRes = true; + } + + reportTestOutcome(testCaseNb, bRes); + + } + +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/Test_Cre_Pcs_Igco.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/Test_Cre_Pcs_Igco.java new file mode 100644 index 0000000..924867f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/Test_Cre_Pcs_Igco.java @@ -0,0 +1,197 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_pcs_igco; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Pcs_Igco extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_pcs_igco"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Pcs_Igco() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // test script + test.reset(); + // Terminal Profile with Set Up Menu + response = test.terminalProfile("09010020"); + // SW1 shall be 91 + result = response.checkSw("9126"); + + // select MF + response = test.selectFile("3F00"); + result &= response.getData().regionMatches(16, "3F00", 0, 4); + result &= response.checkSw("9126"); + + // select failed + response = test.selectFile("03FF"); + // SW = 6A82 + result &= response.checkSw("6A82"); + + // Fetch the Set Up Menu + response = test.fetch("26"); + result &= response.checkData("D0248103 01250082 02818285 09554943" + + "43205445 53548F06 014D656E 75318F06" + + "024D656E 7532"); + + // select MF + response = test.selectFile("3F00"); + result &= response.getData().regionMatches(16, "3F00", 0, 4); + result &= response.checkSw("9000"); + + // Terminal Response + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Trigger Applet1 + response = test.envelopeMenuSelection("100101",""); + // SW1 shall be 91 + result = response.checkSw("9114"); + + // select MF + response = test.selectFile("3F00"); + result &= response.getData().regionMatches(16, "3F00", 0, 4); + result &= response.checkSw("9114"); + + // select failed + response = test.selectFile("03FF"); + // SW = 6A82 + result &= response.checkSw("6A82"); + + // Fetch display Text + response = test.fetch("14"); + result &= response.checkData("D0128103 01210082 0281028D 07045465" + + "73742041"); + + // select MF + response = test.selectFile("3F00"); + result &= response.getData().regionMatches(16, "3F00", 0, 4); + result &= response.checkSw("9000"); + + // Terminal Response + response = test.terminalResponse("81030121 00820282 81830100"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + + // Trigger Applet1 + response = test.envelopeMenuSelection("100102",""); + + // select MF (Testcase 3-1) + response = test.selectFile("3F00"); + result &= response.getData().regionMatches(16, "3F00", 0, 4); + result &= response.checkSw("9114"); + // Fetch display Text + response = test.fetch("14"); + result &= response.checkData("D0128103 01210082 0281028D 07045465" + + "73742042"); + + // select MF (Testcase 3-4) + response = test.selectFile("3F00"); + result &= response.getData().regionMatches(16, "3F00", 0, 4); + result &= response.checkSw("9000"); + // select failed + response = test.selectFile("03FF"); + // SW = 6A82 + result &= response.checkSw("6A82"); + // Terminal Response + response = test.terminalResponse("81030121 00820282 81830100"); + result &= response.checkSw("9114"); + + // select MF (Testcase 3-8) + response = test.selectFile("3F00"); + result &= response.getData().regionMatches(16, "3F00", 0, 4); + result &= response.checkSw("9114"); + // select failed + response = test.selectFile("03FF"); + // SW = 6A82 + result &= response.checkSw("6A82"); + // Fetch display Text + response = test.fetch("14"); + result &= response.checkData("D0128103 01210082 0281028D 07045465" + + "73742043"); + + // select MF (Testcase 3-12) + response = test.selectFile("3F00"); + result &= response.getData().regionMatches(16, "3F00", 0, 4); + result &= response.checkSw("9000"); + // Terminal Response + response = test.terminalResponse("81030121 00820282 81830100"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applet */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "02" + "CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/applet.opt new file mode 100644 index 0000000..5d87910 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_pcs_igco.Cre_Pcs_Igco_1 +uicc.test.catre.cre_pcs_igco +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/javacard/cre_pcs_igco.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_igco/javacard/cre_pcs_igco.cap new file mode 100644 index 0000000000000000000000000000000000000000..d923b4f4904709d0600ca294b14df427a79925c6 GIT binary patch literal 4195 zcma)8dr(y86+id2cXxR$FI@#hMRXNmS$u7xh&+{n#YGruvC&zUi>xfWc=tkuSVZhZ z4WMXarm4<^Oq+*w%(TT?JFS_i*38sS+ljHA{?S;YW@@LVv7GJEfw zd%t_X^PS&0-*;Z_8bM4WBkm7-dsfkxt~3(KRoPgYUtL#aca_#vS5-DN7PzXuxJq<( z%eKu23e)@i-s?Jv+#DWt!Le;k&R7`dyYAtiP1NI^!Kd7FW&DNF!lUT ze)(R`_~~z)TdVZ1cb#sI&$_+!h37wcx9ZAApFM80yOz1VxrwdKhmDIWFAg`q{wK0u znOA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Code/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_1.java new file mode 100644 index 0000000..215655d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_1.java @@ -0,0 +1,188 @@ +//----------------------------------------------------------------------------- +// Cre_Pcs_Spco_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_pcs_spco; + +import javacard.framework.Util; +import uicc.toolkit.* ; +import uicc.test.util.* ; + +public class Cre_Pcs_Spco_1 extends TestToolkitApplet +{ + + private static byte[] MenuInit = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private static byte[] Text1 = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'1'} ; + private static byte testCaseNb = (byte) 0x00; + private static boolean bRes = false; + private static byte nbMenuTriggering = (byte)0; + private static byte nbEnvTriggering = (byte)0; + private static boolean firstInstall = true; + private static byte[] baLocalTestsResults = new byte[128]; + + + /** + * Constructor of the applet + */ + public Cre_Pcs_Spco_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + + // Create a new applet instance. + Cre_Pcs_Spco_1 thisApplet = new Cre_Pcs_Spco_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // ----------------------------------------------------------------- + // Test Case 1 : init MenuEntrys and Send SET UP MENU after Install + // ----------------------------------------------------------------- + thisApplet.obReg.initMenuEntry(MenuInit, (short) 0, (short)MenuInit.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.setEvent((short) EVENT_EVENT_DOWNLOAD_MT_CALL); + thisApplet.obReg.setEvent((short) EVENT_EVENT_DOWNLOAD_LOCATION_STATUS); + thisApplet.obReg.requestPollInterval(POLL_SYSTEM_DURATION); + if (firstInstall) + { + firstInstall = false; + testCaseNb=(byte)0x01; + Util.arrayFillNonAtomic(baLocalTestsResults, (short)0, (short)baLocalTestsResults.length, (byte)0x00); + baLocalTestsResults[0] = (byte)testCaseNb; + baLocalTestsResults[1] = (byte)0xCC; + } + else + { + thisApplet.obReg.setEvent((short) EVENT_UNRECOGNIZED_ENVELOPE); + } + + } + + /** + * Method reportLocalTestOutcome() is used to save result throw applet deletion + * @param testCaseNumber + * @param testCaseResult + */ + protected void reportLocalTestOutcome(byte testCaseNumber, boolean testCaseResult) + { + // Update the total number of tests executed + baLocalTestsResults[0] = testCaseNumber; + + // Set the Test Case Result byte to 0xCC (for Card Compliant...) if successful + if (testCaseResult) { + baLocalTestsResults[testCaseNumber] = (byte)0xCC; + } + else { + baLocalTestsResults[testCaseNumber] = (byte)0x00; + } + + for (byte n = 1; n <= testCaseNumber; n++) + reportTestOutcome(n, (boolean)(baLocalTestsResults[n] == (byte)0xCC)); + } + + public void processToolkit(short event) + { + bRes = false; + + switch (event) + { + case EVENT_MENU_SELECTION: + nbMenuTriggering++; + switch (nbMenuTriggering) + { + case 1: + // ----------------------------------------------------------------- + // Test Case 4 : disable menu + // ----------------------------------------------------------------- + obReg.disableMenuEntry((byte)0x01); + testCaseNb = (byte)2; + bRes = true; + break; + case 2: + // ----------------------------------------------------------------- + // Test Case 8 : clear EVENT_EVENT_DOWNLOAD_MT_CALL + // ----------------------------------------------------------------- + obReg.clearEvent((short) EVENT_EVENT_DOWNLOAD_MT_CALL); + testCaseNb = (byte)3; + bRes = true; + break; + case 3: + // ----------------------------------------------------------------- + // Test Case 8 : set EVENT_EVENT_DOWNLOAD_MT_CALL + // ----------------------------------------------------------------- + obReg.setEvent((short) EVENT_EVENT_DOWNLOAD_MT_CALL); + testCaseNb = (byte)5; + bRes = true; + break; + } + break; + + case EVENT_EVENT_DOWNLOAD_MT_CALL: + obReg.enableMenuEntry((byte)0x01); + testCaseNb = (byte)4; + bRes = true; + break; + + case EVENT_EVENT_DOWNLOAD_LOCATION_STATUS: + obReg.clearEvent(EVENT_EVENT_DOWNLOAD_LOCATION_STATUS); + testCaseNb = (byte)6; + bRes = true; + break; + + case EVENT_STATUS_COMMAND: + // ----------------------------------------------------------------- + // Test Case 12 : + // ----------------------------------------------------------------- + obReg.requestPollInterval(POLL_NO_DURATION); + testCaseNb = (byte)7; + bRes = true; + break; + + case EVENT_UNRECOGNIZED_ENVELOPE: + nbEnvTriggering++; + if (nbEnvTriggering == 1) + { + // ----------------------------------------------------------------- + // Test Case 12 : + // ----------------------------------------------------------------- + obReg.requestPollInterval(POLL_SYSTEM_DURATION); + testCaseNb = (byte)8; + bRes = true; + } + else + { + // ----------------------------------------------------------------- + // Test Case 13 : + // ----------------------------------------------------------------- + obReg.clearEvent(EVENT_EVENT_DOWNLOAD_MT_CALL); + obReg.disableMenuEntry((byte)1); + obReg.requestPollInterval(POLL_NO_DURATION); + obReg.clearEvent(EVENT_UNRECOGNIZED_ENVELOPE); + + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + proHdlr.initDisplayText((byte)0x00, (byte)0x04 /*DCS_8_BIT_DATA*/, Text1, (short)0, (short)Text1.length) ; + proHdlr.send() ; + testCaseNb = (byte)9; + bRes = true; + } + break; + + default: + testCaseNb = (byte)10; + bRes = false; + } + reportLocalTestOutcome(testCaseNb, bRes); + } + +} + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_2.java new file mode 100644 index 0000000..4efbc99 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_2.java @@ -0,0 +1,247 @@ +//----------------------------------------------------------------------------- +// Cre_Pcs_Spco_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_pcs_spco; + +import javacard.framework.*; +import uicc.access.* ; +import uicc.test.util.* ; +import uicc.toolkit.*; + +public class Cre_Pcs_Spco_2 extends TestToolkitApplet +{ + private static short FID_EF_SUME = 0x6F54; + private static byte[] Menu = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'2'}; + private static byte[] Text21 = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'2',(byte)'1'} ; + private static byte[] Text22 = {(byte)'T',(byte)'e',(byte)'x',(byte)'t',(byte)'2',(byte)'2'} ; + private static byte[] boldTextAttr = {(byte)0x00, (byte)0x00, (byte)0x13, (byte)0x90}; + private static byte[] normalTextAttr = {(byte)0x00, (byte)0x00, (byte)0x03, (byte)0x90}; + private byte result = (byte) 0; + private byte NbTriggering = 0; + boolean bRes = false; + private static FileView UiccFileView = null; + + /** + * Constructor of the applet + */ + public Cre_Pcs_Spco_2() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Cre_Pcs_Spco_2 thisApplet = new Cre_Pcs_Spco_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(Menu, (short) 0, (short)Menu.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.setEvent((short) EVENT_UNRECOGNIZED_ENVELOPE); + + // Get the the Uicc File View + UiccFileView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + } + + + public void processToolkit(short event) + { + NbTriggering++; + bRes = false; + + switch (NbTriggering) + { + case 1: + try { + // ----------------------------------------------------------------- + // Test Case 1 + // ----------------------------------------------------------------- + UiccFileView.select(UICCConstants.FID_DF_TELECOM); + UiccFileView.select(FID_EF_SUME); + byte[] ba_Data = {(byte)0x85,(byte)0x09,(byte)0x54,(byte)0x45, + (byte)0x53,(byte)0x54,(byte)0x20,(byte)0x55, + (byte)0x49,(byte)0x43,(byte)0x43,(byte)0xFF, + (byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF, + (byte)0xFF}; + UiccFileView.updateBinary((short)0, ba_Data, (short)0x00, (short)ba_Data.length); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + break; + case 2: + try { + // ----------------------------------------------------------------- + // Test Case 2 + // ----------------------------------------------------------------- + UiccFileView.select(UICCConstants.FID_DF_TELECOM); + UiccFileView.select(FID_EF_SUME); + byte[] ba_Data = {(byte)0x85,(byte)0x09,(byte)0x54,(byte)0x45, + (byte)0x53,(byte)0x54,(byte)0x20,(byte)0x55, + (byte)0x49,(byte)0x43,(byte)0x43,(byte)0x50, + (byte)0x04,(byte)0x00,(byte)0x00,(byte)0x13, + (byte)0x90}; + UiccFileView.updateBinary((short)0, ba_Data, (short)0x00, (short)ba_Data.length); + bRes = true; + + // Release FileView static reference + UiccFileView = null; + } + catch (Exception e) { + bRes = false; + } + break; + case 3: + try { + // ----------------------------------------------------------------- + // Test Case 8 + // ----------------------------------------------------------------- + obReg.setEvent((short)EVENT_EVENT_DOWNLOAD_LOCATION_STATUS); + obReg.setEvent((short)EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION); + bRes = true; + } + catch(Exception e) { + bRes = false; + } + break; + case 4: + try { + // ----------------------------------------------------------------- + // Test Case 8 + // ----------------------------------------------------------------- + if (event != EVENT_EVENT_DOWNLOAD_LOCATION_STATUS) + { + bRes = false; + break; + } + obReg.clearEvent((short)EVENT_EVENT_DOWNLOAD_LOCATION_STATUS); + obReg.clearEvent((short)EVENT_EVENT_DOWNLOAD_LANGUAGE_SELECTION); + bRes = true; + } + catch(Exception e) { + bRes = false; + } + break; + case 6: + try { + // ----------------------------------------------------------------- + // Test Case 13 + // ----------------------------------------------------------------- + if (event != EVENT_UNRECOGNIZED_ENVELOPE) + { + bRes = false; + break; + } + obReg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE); + obReg.disableMenuEntry((byte)2); + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + proHdlr.initDisplayText((byte)0x00, (byte)0x04 /*DCS_8_BIT_DATA*/, Text21, (short)0, (short)Text21.length) ; + proHdlr.send() ; + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + case 7: + try { + // ----------------------------------------------------------------- + // Test Case 13 + // ----------------------------------------------------------------- + if (event != EVENT_PROACTIVE_HANDLER_AVAILABLE) + { + bRes = false; + break; + } + ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler() ; + proHdlr.initDisplayText((byte)0x00, (byte)0x04 /*DCS_8_BIT_DATA*/, Text22, (short)0, (short)Text22.length) ; + proHdlr.send() ; + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + case 8: + try { + // ----------------------------------------------------------------- + // Test Case 14-2 + // ----------------------------------------------------------------- + obReg.enableMenuEntry((byte)2); + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + case 9: + try { + // ----------------------------------------------------------------- + // Test Case 14-5 + // ----------------------------------------------------------------- + obReg.setMenuEntryTextAttribute((byte)2, boldTextAttr, (short)0, (short)4); + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + case 10: + try { + // ----------------------------------------------------------------- + // Test Case 14-7 + // ----------------------------------------------------------------- + obReg.disableMenuEntry((byte)2); + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + case 11: + try { + // ----------------------------------------------------------------- + // Test Case 14-11 + // ----------------------------------------------------------------- + obReg.enableMenuEntry((byte)2); + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + case 12: + try { + // ----------------------------------------------------------------- + // Test Case 14-13 + // ----------------------------------------------------------------- + obReg.setMenuEntryTextAttribute((byte)2, normalTextAttr, (short)0, (short)4); + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + default: + if (event == EVENT_UNRECOGNIZED_ENVELOPE) + { + bRes = true; + break; + } + } + + reportTestOutcome((byte)NbTriggering, bRes); + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_3.java new file mode 100644 index 0000000..44aa8de --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Cre_Pcs_Spco_3.java @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +// Cre_Pcs_Spco_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_pcs_spco; + +import uicc.test.util.* ; + +public class Cre_Pcs_Spco_3 extends TestToolkitApplet +{ + private static short FID_EF_SUME = 0x6F54; + private static byte[] Menu = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'3'}; + private byte result = (byte) 0; + private byte NbTriggering = 0; + boolean bRes = false; + + /** + * Constructor of the applet + */ + public Cre_Pcs_Spco_3() + { + } + + /** + * Method called by the JCRE at the installation of the applet. + */ + public static void install(byte[] bArray, short bOffset, byte bLength) { + // Create a new applet instance. + Cre_Pcs_Spco_3 thisApplet = new Cre_Pcs_Spco_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(Menu, (short) 0, (short)Menu.length, (byte) 0, false, (byte) 0, (short) 0); + } + + + public void processToolkit(short event) + { + NbTriggering++; + bRes = false; + + switch (NbTriggering) + { + case 1: + try { + // ----------------------------------------------------------------- + // Test Case 14-9 + // ----------------------------------------------------------------- + byte[] italicTextAttr = {(byte)0x00, (byte)0x00, (byte)0x23, (byte)0x90}; + obReg.setMenuEntryTextAttribute((byte)3, italicTextAttr, (byte)0, (short)4); + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + case 2: + try { + // ----------------------------------------------------------------- + // Test Case 14-9 + // ----------------------------------------------------------------- + byte[] normalcTextAttr = {(byte)0x00, (byte)0x00, (byte)0x03, (byte)0x90}; + obReg.setMenuEntryTextAttribute((byte)3, normalcTextAttr, (byte)0, (short)4); + bRes = true; + } + catch (Exception e){ + bRes = false; + } + break; + } + + reportTestOutcome((byte)NbTriggering, bRes); + } +} + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Test_Cre_Pcs_Spco.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Test_Cre_Pcs_Spco.java new file mode 100644 index 0000000..7f8b395 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/Test_Cre_Pcs_Spco.java @@ -0,0 +1,739 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_pcs_spco; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; +import java.lang.*; + +public class Test_Cre_Pcs_Spco extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_pcs_spco"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + static final String DF_TELECOM = "7F10"; + static final String EF_SUME = "6F54"; + + private UiccAPITestCardService test; + APDUResponse response; + + + // Fetch a sepUpMenu command, check it according to the parameters + // and send the Terminal Response. + // Return true if the received command corresponds to the one rebuilt using + // the parameters + private boolean fetchSetUpMenu( + String alphaId, // AlphaId TLV Value + String alphaIdTextAtt, // AlphaId Text Attribute TLV Value + byte nbMenu, // Number of menus + String[] menuId, // Menu Id List table + String[] menu, // Text Menu List table (in readable text!) + String nextActionTLV, // Next Action List TLV + String itemTextAttListTLV) // Item Text Attribute List TLV + { + boolean result; + String setUpMenuCmd = ""; + String endOfCmd = ""; + String Cmd = ""; + + // Build the Set Up Menu + if (nextActionTLV != null) + { + endOfCmd = nextActionTLV; + } + if (alphaIdTextAtt != null) + { + endOfCmd += "50" + ToString((byte)(alphaIdTextAtt.length()/2)) + alphaIdTextAtt; + } + if (itemTextAttListTLV != null) + { + endOfCmd += itemTextAttListTLV; + } + + String menuItem = ""; + String menuList = ""; + for (byte i = 0; i < nbMenu; i++) + { + menuItem = menuId[i]; + menuItem += ByteToString(menu[i].getBytes()); + menuList += "8F" + ToString((byte)(menuItem.length()/2)) + menuItem; + } + Cmd = menuList + endOfCmd; + + String alpId = ByteToString(alphaId.getBytes()); + setUpMenuCmd = "85" + ToString((byte)(alpId.length()/2)) + alpId; + setUpMenuCmd += Cmd; + Cmd = setUpMenuCmd; + setUpMenuCmd = "810301250082028182" + Cmd; + Cmd = setUpMenuCmd; + setUpMenuCmd = "D0" + ToString((byte)(Cmd.length()/2)) + Cmd; + + response = test.fetch(ToString((byte)(setUpMenuCmd.length()/2))); + result = response.checkData(setUpMenuCmd); + + test.terminalResponse("81030125 00820282 81830100"); + + return result; + } + + private String ByteToString( byte tab[] ) + { + byte[] tab2; + byte c; + int i, j, k; + + j = tab.length; + tab2 = new byte[ j*2]; + + k = 0; + for ( i=0; i>4)&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + + c = (byte)(tab[ i ]&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + } + + return new String( tab2 ); + } + + // byte => String + private String ToString( byte myByte ) + { + byte[] tab; + byte c; + int i, j, k; + + tab = new byte[1]; + tab[0] = myByte; + + return ByteToString( tab ); + } + + public Test_Cre_Pcs_Spco() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "02" + // V Id of menu entry 1 + "02" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfile("09010020 00000000 00000000 00000008" + + "00000000 00000000 0000003F 7F"); + + // Fetch the SetUpMenu with main menu "UICC TEST" and no text attribute + String[] menuList = new String[6]; + String[] menuIdList = new String[6]; + menuList[0] = "Menu2"; + menuIdList[0] = "02"; + String DefaultAttr = "00000390"; + String BoldAttr = "00001390"; + String ItalicAttr = "00002390"; + result = fetchSetUpMenu("UICC TEST", null, (byte)1, menuIdList, menuList, null, null); + + // Update EFsume with the new menu title "TEST MENU" in bold + test.selectFile(DF_TELECOM); + response = test.selectFile(EF_SUME); + result &= response.checkSw("9000"); + test.sendApdu("00D60000 11850954 45535420 4D454E55" + + "50040000 1390"); + + // Fetch The SetUpMenu with main menu "TEST MENU" and text attribute "00001390" (bold) + menuList[0] = "Menu2"; + menuIdList[0] = "02"; + result &= fetchSetUpMenu("TEST MENU", BoldAttr, (byte)1, menuIdList, menuList, null, null); + + // Send an unrecognized envelope + test.unrecognizedEnvelope(); + // Fetch the SetUpMenu with main menu "TEST UICC" and no text attribute + menuList[0] = "Menu2"; + menuIdList[0] = "02"; + result &= fetchSetUpMenu("TEST UICC", null, (byte)1, menuIdList, menuList, null, null); + + // Send an unrecognized envelope + test.unrecognizedEnvelope(); + menuList[0] = "Menu2"; + menuIdList[0] = "02"; + result &= fetchSetUpMenu("TEST UICC", BoldAttr, (byte)1, menuIdList, menuList, null, null); + + + // restaure EFsume with the menu title "UICC TEST" and no attribute + test.selectFile(DF_TELECOM); + response = test.selectFile(EF_SUME); + result &= response.checkSw("9000"); + test.sendApdu("00D60000 11850955 49434320 54455354" + + "FFFFFFFF FFFF"); + + // Fetch the SetUpMenu with main menu "UICC TEST" and no text attribute + menuList[0] = "Menu2"; + menuIdList[0] = "02"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)1, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + // Fetch the SetUpMenu with the menus + menuList[0] = "Menu1"; + menuIdList[0] = "01"; + menuList[1] = "Menu2"; + menuIdList[1] = "02"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)2, menuIdList, menuList, null, null); + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + + // Lock Applet1 + test.lockApplication(APPLET_AID_1); + // Fetch the SetUpMenu with the menus + menuList[0] = "Menu2"; + menuIdList[0] = "02"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)1, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Make selectable Applet1 + test.unlockApplication(APPLET_AID_1); + // Fetch the SetUpMenu with the menus + menuList[0] = "Menu1"; + menuIdList[0] = "01"; + menuList[1] = "Menu2"; + menuIdList[1] = "02"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)2, menuIdList, menuList, null, null); + + // Send an envelope menu selection - Applet1 disables its menu + test.envelopeMenuSelection("100101", ""); + // Fetch the SetUpMenu with the menus + menuList[0] = "Menu2"; + menuIdList[0] = "02"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)1, menuIdList, menuList, null, null); + + // Send an envelope event download MT Call - Applet1 enables its menu + test.envelopeEventDownloadMTCall(); + // Fetch the SetUpMenu with the menus + menuList[0] = "Menu1"; + menuIdList[0] = "01"; + menuList[1] = "Menu2"; + menuIdList[1] = "02"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)2, menuIdList, menuList, null, null); + + /*********************************************************************/ + /** Testcase 5 */ + /*********************************************************************/ + + // Terminal Profile with Set Up Event List and EventDownload facilities + test.reset(); + test.terminalProfile("09010000 FFFF"); + + // Fetch SetUpEventList command + response = test.fetch("0F"); + result &= response.checkData("D00D8103 01050082 02818219 020003") || + response.checkData("D00D8103 01050082 02818299 020003"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 6 */ + /*********************************************************************/ + + // Lock Applet1 + test.lockApplication(APPLET_AID_1); + // Fetch SetUpEventList command + response = test.fetch("0D"); + result &= response.checkData("D00B8103 01050082 02818219 00") || + response.checkData("D00B8103 01050082 02818299 00"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 7 */ + /*********************************************************************/ + + // Make selectable Applet1 + test.unlockApplication(APPLET_AID_1); + // Fetch SetUpEventList command + response = test.fetch("0F"); + result &= response.checkData("D00D8103 01050082 02818219 020003") || + response.checkData("D00D8103 01050082 02818299 020003"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 8 */ + /*********************************************************************/ + + // Trigger Applet1 + test.envelopeMenuSelection("100101", ""); + // Fetch SetUpEventList command + response = test.fetch("0E"); + result &= response.checkData("D00C8103 01050082 02818219 0103") || + response.checkData("D00C8103 01050082 02818299 0103"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + // Trigger Applet2 + test.unrecognizedEnvelope(); + // Fetch SetUpEventList command + response = test.fetch("0F"); + result &= response.checkData("D00D8103 01050082 02818219 020307") || + response.checkData("D00D8103 01050082 02818299 020307"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + // Trigger Applets + test.envelopeEventDownloadLocationStatus(); + // Fetch SetUpEventList command + response = test.fetch("0D"); + result &= response.checkData("D00B8103 01050082 02818219 00") || + response.checkData("D00B8103 01050082 02818299 00"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + // Trigger Applet1 + test.envelopeMenuSelection("100101", ""); + // Fetch SetUpEventList command + response = test.fetch("0E"); + result &= response.checkData("D00C8103 01050082 02818219 0100") || + response.checkData("D00C8103 01050082 02818299 0100"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + // Delete Applet1 + test.deleteApplet(APPLET_AID_1); + // Fetch SetUpEventList command + response = test.fetch("0D"); + result &= response.checkData("D00B8103 01050082 02818219 00") || + response.checkData("D00B8103 01050082 02818299 00"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + // Fetch SetUpEventList command + response = test.fetch("0F"); + result &= response.checkData("D00D8103 01050082 02818219 020003") || + response.checkData("D00D8103 01050082 02818299 020003"); + response = test.terminalResponse("81030105 00820282 81830100"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 9 */ + /*********************************************************************/ + + // Terminal Profile with polling facilities + test.reset(); + test.terminalProfile("290160"); + // Fetch Poll Interval command + response = test.fetch("0F"); + String pollInterCmd = response.getData(); + result &= pollInterCmd.regionMatches(0, "D00D8103010300820281820402", + 0, "D00D8103010300820281820402".length()) || + pollInterCmd.regionMatches(0, "D00D8103010300820281828402", + 0, "D00D8103010300820281828402".length()); + response = test.terminalResponse("81030103 00820282 81830100 84020010"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 10 */ + /*********************************************************************/ + + // Lock Applet1 + test.lockApplication(APPLET_AID_1); + // Fetch Polling Off command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01040082 028182"); + response = test.terminalResponse("81030104 00820282 81830100"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 11 */ + /*********************************************************************/ + + // Make selectable Applet1 + test.unlockApplication(APPLET_AID_1); + // Fetch Poll Interval command + response = test.fetch("0F"); + result &= response.checkData(pollInterCmd); + response = test.terminalResponse("81030103 00820282 81830100 84020010"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 12 */ + /*********************************************************************/ + + // Trigger Applet1 + test.status("00", "00", "16"); + // Fetch Polling Off command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01040082 028182"); + response = test.terminalResponse("81030104 00820282 81830100"); + result &= response.checkSw("9000"); + + // Trigger Applet1 + test.unrecognizedEnvelope(); + // Fetch Poll Interval command + response = test.fetch("0F"); + result &= response.checkData(pollInterCmd); + response = test.terminalResponse("81030103 00820282 81830100 84020010"); + result &= response.checkSw("9000"); + + // Delete Applet1 + test.deleteApplet(APPLET_AID_1); + // Fetch Polling Off command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01040082 028182"); + response = test.terminalResponse("81030104 00820282 81830100"); + result &= response.checkSw("9000"); + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + // Fetch Poll Interval command + response = test.fetch("0F"); + result &= response.checkData(pollInterCmd); + response = test.terminalResponse("81030103 00820282 81830100 84020010"); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /** Testcase 13 */ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession("29016120 FFFF"); + + // Trigger Applet1 + test.unrecognizedEnvelope(); + // Fetch Diplay text + response = test.fetch("13"); + result &= response.checkData("D0118103 01210082 0281028D 06045465" + + "787431"); + response = test.terminalResponse("81030121 00820282 81830100"); + result &= response.checkSw("9114"); + + // Fetch Diplay text + response = test.fetch("14"); + result &= response.checkData("D0128103 01210082 0281028D 07045465" + + "78743231"); + response = test.terminalResponse("81030121 00820282 81830100"); + result &= response.checkSw("9114"); + + // Fetch Diplay text + response = test.fetch("14"); + result &= response.checkData("D0128103 01210082 0281028D 07045465" + + "78743232"); + response = test.terminalResponse("81030121 00820282 81830100"); + + for (byte i = 0; i < 3; i++) + { + switch (Integer.valueOf(response.getStatusWord(),16).intValue()) + { + case 0x9118: + // Fetch an empty SetUpMenu + response = test.fetch("18"); + result &= response.checkData("D0168103 01250082 02818285 09554943" + + "43205445 53548F00"); + response = test.terminalResponse("81030125 00820282 81830100"); + break; + case 0x910E: + response = test.fetch("0E"); + result &= response.checkData("D00C8103 01050082 02818219 0103") || + response.checkData("D00C8103 01050082 02818299 0103"); + response = test.terminalResponse("81030105 00820282 81830100"); + break; + case 0x910B: + // Fetch Polling Off command + response = test.fetch("0B"); + result &= response.checkData("D0098103 01040082 028182"); + response = test.terminalResponse("81030104 00820282 81830100"); + break; + default: + result = false; + break; + } + } + + /*********************************************************************/ + /** Testcase 14 */ + /*********************************************************************/ + + test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Id of menu entry 1 + "03" + // V Position of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // test script + test.reset(); + // Terminal Profile with Set Up Menu + response = test.terminalProfile("09010020 00000000 00000000 00000008" + + "00000000 00000000 0000003F 7F"); + // Fetch the SetUpMenu + response = test.fetch(response.getStatusWord().substring(2)); + result &= response.checkData("D01C8103 01250082 02818285 09554943" + + "43205445 53548F06 034D656E 7533") || + response.checkData("D0228103 01250082 02818285 09554943" + + "43205445 53548F06 034D656E 75335104" + + "00000390") || + response.checkData("D0228103 01250082 02818285 09554943" + + "43205445 53548F06 034D656E 7533D104" + + "00000390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Trigger Applet2 (testcase 14-2) + response = test.unrecognizedEnvelope(); + // Fetch the SetUpMenu + response = test.fetch(response.getStatusWord().substring(2)); + result &= response.checkData("D0248103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 7533") || + response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 75335108 00000390 00000390") || + response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "024D656E 7533D108 00000390 00000390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Trigger Applet2 (testcase 14-4) + test.envelopeMenuSelection("100102", ""); + // Fetch the SetUpMenu + response = test.fetch("30"); + result &= response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 75335108 00001390 00000390") || + response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 7533D108 00001390 00000390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Trigger Applet2 (testcase 14-6) + response = test.envelopeMenuSelection("100102", ""); + // Fetch the SetUpMenu + response = test.fetch(response.getStatusWord().substring(2)); + result &= response.checkData("D01C8103 01250082 02818285 09554943" + + "43205445 53548F06 034D656E 7533") || + response.checkData("D0228103 01250082 02818285 09554943" + + "43205445 53548F06 034D656E 75335104" + + "00000390") || + response.checkData("D0228103 01250082 02818285 09554943" + + "43205445 53548F06 034D656E 7533D104" + + "00000390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Trigger Applet3 (testcase 14-8) + test.envelopeMenuSelection("100103", ""); + // Fetch the SetUpMenu + response = test.fetch("24"); + result &= response.checkData("D0228103 01250082 02818285 09554943" + + "43205445 53548F06 034D656E 75335104" + + "00002390") || + response.checkData("D0228103 01250082 02818285 09554943" + + "43205445 53548F06 034D656E 7533D104" + + "00002390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Trigger Applet2 (testcase 14-10) + test.unrecognizedEnvelope(); + // Fetch the SetUpMenu + response = test.fetch("30"); + result &= response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 75335108 00001390 00002390") || + response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 7533D108 00001390 00002390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Trigger Applet2 (testcase 14-12) + test.envelopeMenuSelection("100102", ""); + // Fetch the SetUpMenu + response = test.fetch("30"); + result &= response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 75335108 00000390 00002390") || + response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 7533D108 00000390 00002390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Lock Applet3 (testcase 14-14) + response = test.lockApplication(APPLET_AID_3); + // Fetch the SetUpMenu + response = test.fetch(response.getStatusWord().substring(2)); + result &= response.checkData("D01C8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 7532") || + response.checkData("D0228103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75325104" + + "00000390") || + response.checkData("D0228103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 7532D104" + + "00000390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Make selectable Applet3 (testcase 14-15) + test.unlockApplication(APPLET_AID_3); + // Fetch the SetUpMenu + response = test.fetch("30"); + result &= response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 75335108 00000390 00002390") || + response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 7533D108 00000390 00002390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + //Trigger Applet3 (testcase 14-16) + response = test.envelopeMenuSelection("100103", ""); + // Fetch the SetUpMenu + response = test.fetch(response.getStatusWord().substring(2)); + result &= response.checkData("D0248103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 7533") || + response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "034D656E 75335108 00000390 00000390") || + response.checkData("D02E8103 01250082 02818285 09554943" + + "43205445 53548F06 024D656E 75328F06" + + "024D656E 7533D108 00000390 00000390"); + response = test.terminalResponse("81030125 00820282 81830100"); + result &= response.checkSw("9000"); + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "09" + + "CCCCCCCC CCCCCCCC CC"); + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "0C" + + "CCCCCCCC CCCCCCCC CCCCCCCC"); + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "02" + + "CCCC"); + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/applet.opt new file mode 100644 index 0000000..586b76e --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_pcs_spco.Cre_Pcs_Spco_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_pcs_spco.Cre_Pcs_Spco_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_pcs_spco.Cre_Pcs_Spco_1 +uicc.test.catre.cre_pcs_spco +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/javacard/cre_pcs_spco.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_pcs_spco/javacard/cre_pcs_spco.cap new file mode 100644 index 0000000000000000000000000000000000000000..f062d768837bb7a1fe85ad39fc0c480117002f9f GIT binary patch literal 8565 zcmc&(d3aPswm(((-rlm^?45*8A|wzXAt8VSLJ$avLLi~;@Z;sxr^&+YZ{v-)z^M|jA(G# zi=N&&X(#vpE$IPwX5UM6_!iqk`+nb4eU0nJHRUT4?&7xG<4>Mly)mD^_Iv{KKlYLN zr7Nt(=hb~a?mr9q=WXvl{J%Y8%(IldCqKC+=Wy+-efzg{WSFuFpD5T?-+TCuS9AaV zo6X)=rvJ7f!!&upn|E(Hb=TG{drmz!`t!Y)%>U=RIlr5cd)etfpB}q=&3%7(?@#-W zQmT7NOV(?TtZe_L`RJ%ym$YXzKKttW$C@&)f2MKrL-)*HRcouUCt8|YFRbl8)wgD# z`S^3y5BH6GD*KfW8+P4b+?_HruIRGn=aeL9znSblZ{h)v8{Nmb0ZTmW= zuFAjrFVD>U@|CZSU-M1J-@oao|7u46luswTGLZSR#y4O5?}JBL4w>)ldMmHs!LM&^ zII(p9gteU$xBq?F`^WnGPQSnBddoY3rt^;+d%pAXoj3gR_J=CZW)+;a9_%hXYwrB| zThoa*Zl2hD;*5KytCP>#WL?{OaQaPM8TNO2r+<8E*Pkx@BCcVf(bP6~&dPm^XqSPg z0sU*ydR6pqq3P2HW}+lg8B&+a;V2C{1Hn>n&HjnhBLVfQhb{_e5w&TuXhQ*Q?YGb!KUxw--Hs2}4tT#x5>f9faziAYnBevC4z z$9$LH=?HrL-9i;k=h1YenY5Umr&{GpdX3&EV#nhP$OgRz6e*_h9k<el(ZeoYmb7ArA5 z@EKTfX1pC)D}!RgbVva<29>O#^!mhxt9Rd|6LbCx-$gnfX=L3~?ezqLc2BUu>vaoz zDd?BUJOs5UTO@|W^>P`?Whj?vWrZjWNj7XzB`HK^!0AXCN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mebv#k=$YXg;Jf zp!<|Qr+erNtQZCvXC^wr%q)S9vP71QeQF9zrTbYLv(iH>i;bd(nT?I5N7*aa?Df7qY+eh!Lhd@IR1ur>lLivV*Xz}N_&3IJZnKBrubioG4dJQ2ZM7p~0OBS5VH z&LIIO5nqj5M?zqL-XPJ^mBOeDtPV!`0Wn(@=kcr zMev_HXdxZI??P}nN{i@TdKf|d2!2Z-;0bD=U(z~A7>?L%J-hk)73GZ4?XPH7P zn1R`7CCg<+^m8_zO{7(Edb3!BNRXf;kn=97cfuo`l*T2@DG>>{>^I#@kh zMjqD8R*{#rV5s-8Hr7Ud*3Q;afOWEU)Wtl^PdzNa*3%|-IqSyAwSo0gi1o1@v;`+E zd#RUQ%dVxZ>^gQMZDTjFeRLJu&u*n%>^63Qe!=c!hiDHw%#P4rc9cC#*Rn_0<8&Q+ zf*qsl*^BHr-N0UBzo#47TkI{mnZ3>=Qb~&altu zSL|~{!T@L7NO$3+Cz0;vNj!<};VMt1L7v7l=qS(Rx%3dv;|26EFXV;vC?Ctm(_?%B zpGZ&eVqQT{@fmzJJOxlj`K_T za(bPw;H~r)ckm8+o4dG+-r;NcIy%Wc+)IDtKE9DY;G1|aeaQQGAN>#C%CDl+yq{l9 zf8p2QFzpOZw0=ov`CfiA{gvA@6DpzI}i~g<38*bEmlD69a&Vs$q@^P-k8O5kG=Maa_^8vs($nmES7uhtyPq} z5xqGw<3x5?kvptd8L^i?Q5gk@n-R*0Tm{84kG;c*GJkx;%%e9tvD{-%_oCdt#o}*d zs>hu5#fpeM7>kM+i-pR_M8q7E#fpeML5hl4oj6hv!_SjqCB&XSL?vv;NH(%YoI8tX USg7E(5_gXHIpKxhj1r}P0fhsIDgXcg literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Cre_Reg_Evtr_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Cre_Reg_Evtr_1.java new file mode 100644 index 0000000..0bb09a8 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Cre_Reg_Evtr_1.java @@ -0,0 +1,65 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_reg_evtr; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * Cat Runtime Environment, Registration, Event Registration + * Applet1 + */ + +public class Cre_Reg_Evtr_1 extends TestToolkitApplet { + + private byte testCaseNb; + private boolean bRes; + + // Constructor of the applet + public Cre_Reg_Evtr_1() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength){ + + // create a new applet instance + Cre_Reg_Evtr_1 thisApplet = new Cre_Reg_Evtr_1(); + + // register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // initialise the data of the test applet + thisApplet.init(); + + // registration to EVENT_EVENT_DOWNLOAD_USER_ACTIVITY and EVENT_EVENT_DOWNLOAD_MT_CALL + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + thisApplet.obReg.setEvent(EVENT_EVENT_DOWNLOAD_MT_CALL); + } + + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + if (event == EVENT_EVENT_DOWNLOAD_USER_ACTIVITY) { + testCaseNb = 0x01; + try { + obReg.setEvent(EVENT_EVENT_DOWNLOAD_LOCATION_STATUS); + obReg.clearEvent(EVENT_EVENT_DOWNLOAD_USER_ACTIVITY); + bRes = true; + } + catch (Exception e) { + bRes = false; + } + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Cre_Reg_Evtr_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Cre_Reg_Evtr_2.java new file mode 100644 index 0000000..6f17e52 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Cre_Reg_Evtr_2.java @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_reg_evtr; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import javacard.framework.*; +import uicc.test.util.*; + +/** + * Cat Runtime Environment, Registration, Event Registration + * Applet2 + */ + +public class Cre_Reg_Evtr_2 extends TestToolkitApplet { + + private byte testCaseNb; + private boolean bRes; + + byte[] readData = new byte[10]; + + private static byte testCounter = 0; + + // Constructor of the applet + public Cre_Reg_Evtr_2() { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength){ + + // create a new applet instance + Cre_Reg_Evtr_2 thisApplet = new Cre_Reg_Evtr_2(); + + // register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // initialise the data of the test applet + thisApplet.init(); + + // register to UNRECOGNIZED_ENVELOPE + thisApplet.obReg.setEvent(EVENT_UNRECOGNIZED_ENVELOPE); + } + + public Shareable getShareableInterfaceObject(AID clientAID, byte parameter) { + testCounter++; + // According to CAT Runtime Environment behaviour for ToolkitInterface object retrieval + if ((clientAID == null) && (parameter == (byte)0x01)) { + return((Shareable) this); + } else { + return(null); + } + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) { + + if (event == EVENT_UNRECOGNIZED_ENVELOPE) { + testCaseNb = 0x01; + bRes = false; + if (testCounter == (byte)0x01) { + bRes = true; + } + reportTestOutcome(testCaseNb, bRes); + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Test_Cre_Reg_Evtr.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Test_Cre_Reg_Evtr.java new file mode 100644 index 0000000..817d045 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/Test_Cre_Reg_Evtr.java @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------------- +//Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_reg_evtr; + +//----------------------------------------------------------------------------- +//Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + + +public class Test_Cre_Reg_Evtr extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_reg_evtr"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Reg_Evtr() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession("0101000033"); + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Install Applet1 + test.installInstallApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.status("00", "0C", "00"); + + // test script + response = test.makeSelectableApplet(APPLET_AID_1); + result = response.checkSw("910F"); + response = test.fetch("0F"); + result &= (response.checkData("D00D8103 01050082 02818299 020004") || + response.checkData("D00D8103 01050082 02818219 020004")); + test.terminalResponse("81030105 00820282 81830100"); + + // test case 1: trigger applet1 + response = test.envelopeEventDownloadUserActivity(); + result &= response.checkSw("910F"); + response = test.fetch("0F"); + result &= response.checkData("D00D8103 01050082 02818299 020003"); + test.terminalResponse("81030105 00820282 81830100"); + + // Install Applet2 + test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "8008" + // TLV UICC Toolkit application specific parameters + "01" + // V Priority Level + "00" + // V Max. number of timers + "00" + // V Maximum text length for a menu entry + "00" + // V Maximum number of menu entries + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00"); // V Maximum number of services + + test.reset(); + test.terminalProfileSession("0101000033"); + + + // test case 2: trigger applet2 + response = test.unrecognizedEnvelope(); + result &= response.checkSw("9000"); + + // check results + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "01CC"); + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "01CC"); + + + // delete applet and package + test.reset(); + test.terminalProfileSession("0101"); + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/applet.opt new file mode 100644 index 0000000..3091dde --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_reg_evtr.Cre_Reg_Evtr_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_reg_evtr.Cre_Reg_Evtr_1 +uicc.test.catre.cre_reg_evtr +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/javacard/cre_reg_evtr.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_reg_evtr/javacard/cre_reg_evtr.cap new file mode 100644 index 0000000000000000000000000000000000000000..9963b3d9d33d85afa87e897fd032303d99b0f9b5 GIT binary patch literal 4629 zcmb7HeNYtV8GrWOz3)Q~Jj}`Gf$@X#aftF^Q6ircswe_6tu|wqV}X;C!@C8M3DZ;C zqQOX*blN7ihL}v!)=JWeI!$e-t;v{FXWC31ht}98j#2YZs*QhK-s(#JEa&(A&wQ)# zJD2}lcBHRy@}Q!#n!>iudOt?E~ozX$;Cfw{m;nig3qq3`tS9zaQOM3 z-+kTnNXRQMX>4VqwKg|Ltk3UA7+bL= zXZy2nln!(b9c<3>zB0PA@wwYMd1vobNXO0(Ejlsfe!%kUljk}v9zLA<_m(l+$HN6r ziw~WY0uuvIIz6N6caPl~KfWrP)zn!BY1Ykk8dpZ@Td zcT7#|Oy<-T-+XD0K=i1As0q_()h3TmU+ZxHS|z*dEWJcPqikEq>mH9le2|#w$^U zUhZ3fVuEQLe{BN1i18sAcPa9agjipWreE6mH9Y243X4zpnm|uTm3!2tK)}zHFhKDX z7KRVgr@+WX)7LKEX2L$M10y3=h#1z43Fw3C0InI#%nb{ajKC50T8Q_Hb#~)j>&*)E z;O2qF>8xK4g}9eStO}|D+Z0*(im2SfXs=nY?ltkdA_)e#L*sn?@`FxApU3)9H8z!h z30=9xKY@*k+7)Q$j+kgtpoXxEWHJd3*Fj1iG%Oz_^O}QXDNJ)^NL8+k#Uo@(8zD#9 zKCGxijOG(>*|pZ7n4RHpbmzIG{lal_Bx*O&(E2glWxb{Xm$;v~CWHw#Le@d1vA7)8 zr)?^FDmSZ2hr7Qg&A7XOo`V0%7r zxy6s)taPjoAienlJ$y1O$P$h`>wIRhnM9V9u~f2(j8aTSqhyyX))b4=lz^7mWK2(t zrMD$7zjFiB+*ZQk8(ysv@&PaPN$xA^0@R%z?&+^72do>pvttw?R%K6N_V)BM;s3i(z@>9ZSRM^N6O>l=WN{k6-TT^wbS_m0lia6<=gN zigjuiPpfT)uI;t5Dw9pqCeX*V{6eEIuAsC|MV+0a+1c3GwjG58ty-ozuhlrwDXnU# zt*Fku-;-IO3bJ_pJ}7{`@j>)jfXe9sa-$l`hUIBzKJK`{S;-KmBJd;B9s!IT*25^3(kKU< zD6o(u48SWv$0XEZ$#__(iNE6n{w0B7p$&B=AfeR}! zMM+R68F*z8Wl!<(Fi=GhvSyU!*;j->5}sAT4I5QsWJy$m*Hfq#Ze~zDl**)so7M@; z38tBEvwO>Z{%sa}eBPHDN3lkPz2B!n6y+@;-n}mRp`b_C7yME5jacAwCbZeC8&m%4 z3G~H%l;F*{38JOG9$jC;N6}Yf9meN=w4m3c>x=Rz`rC1%&uk?#CAywNUrR?h`mkc+ z8$r!XWvvI-7syfYyK#d@%Vj;fzO0O*FGk{v&vjjqsi)9amQjjt$4#NDGxZeu>M=?o qAsfUuir89G&!8`}q6}-W6U569DY}~0X$O literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_1.java new file mode 100644 index 0000000..56d92e3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_1.java @@ -0,0 +1,176 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Acdo_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +import javacard.framework.* ; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.test.util.* ; + + +public class Cre_Tin_Acdo_1 extends TestToolkitApplet +{ + private static byte[] MenuInit1 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'1'}; + private static byte[] MenuInit2 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'2'}; + final boolean bSecurityException = false; + final boolean bSuccessExecution = true; + AID AID1 = null; + FileView UICCView = null; + FileView ADF1View = null; + byte bTestCaseNb = 0; + byte[] abTestResults = null; + UICCTestConstants testConstants = null; + Cre_Tin_Acdo_8 commonTests = null; + + /** + * Constructor of the applet + */ + + public Cre_Tin_Acdo_1() + { + testConstants = new UICCTestConstants(); + AID1 = new AID(testConstants.AID_ADF1, (short)0, (byte)testConstants.AID_ADF1.length); + commonTests = new Cre_Tin_Acdo_8(); + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance. + Cre_Tin_Acdo_1 thisApplet = new Cre_Tin_Acdo_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(MenuInit1, (short) 0, (short)MenuInit1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(MenuInit2, (short) 0, (short)MenuInit2.length, (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) + { + boolean bRes = true; + boolean bIsAdminFVTest = false; + + // ----------------------------------------------------------------- + // Test Case 1 : Full access Applet + // ----------------------------------------------------------------- + + if (event == EVENT_MENU_SELECTION) { + byte bMenuId = 0; + + try + { + bMenuId = (EnvelopeHandlerSystem.getTheHandler().getItemIdentifier()); + } + catch (Exception e) + { + // Debug purpose: only testcase 0x01 Ok if handler not available + reportTestOutcome((byte)0x01, true); + return; + } + + // Fileview access tests + try + { + if (bMenuId == 1) + { + // Get fileviews... + UICCView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + ADF1View = UICCSystem.getTheFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = false; + } + else if (bMenuId == 2) + { + // Get admin fileviews... + UICCView = (FileView)AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + ADF1View = (FileView)AdminFileViewBuilder.getTheAdminFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = true; + + // Reset local testCaseNumber + commonTests.resetCaseNumber(); + } + + commonTests.SetFileViewRef(UICCView, ADF1View); + } + catch(Exception e) + { + // Debug purpose: only testcase 2 (menuID1) or 3 (menuId2) OK, if fileview not available + reportTestOutcome((byte)(bMenuId + 1), true); + return; + } + + // Sub cases 1.1 & 2.1 : Access tests on cyclic EF methods access + // ------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb == 2) + // Security exception is expected on EFCARR2 + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.2 & 2.2 : Access tests on linear fixed EF methods access + // -------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb == 2) + // Security exception is expected on EFLARR2 + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.3 & 2.3 : Access tests on transparent EF methods access + // ------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb == 2) + // Security exception is expected on EFTARR2 + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 2.4 to 2.6 : Access tests administrative commands + // ----------------------------------------------------------- + if (bMenuId == 2) + { + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb == 2) + // Security exception is expected on EFTAR2T + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSecurityException); + else + // No exception expected + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSuccessExecution); + } + } + + // Update Outcome report with result table + // --------------------------------------- + for (byte n = 1; n <= abTestResults[0]; n++) + { + reportTestOutcome(n, (abTestResults[n] == (byte)0xCC)); + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_2.java new file mode 100644 index 0000000..24f99f0 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_2.java @@ -0,0 +1,160 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Acdo_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +import javacard.framework.* ; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.test.util.* ; + + +public class Cre_Tin_Acdo_2 extends TestToolkitApplet +{ + private static byte[] MenuInit1 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'1'}; + private static byte[] MenuInit2 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'2'}; + final boolean bSecurityException = false; + final boolean bSuccessExecution = true; + AID AID1 = null; + FileView UICCView = null; + FileView ADF1View = null; + byte bTestCaseNb = 0; + byte[] abTestResults = null; + UICCTestConstants testConstants = null; + Cre_Tin_Acdo_8 commonTests = null; + + /** + * Constructor of the applet + */ + + public Cre_Tin_Acdo_2() + { + testConstants = new UICCTestConstants(); + AID1 = new AID(testConstants.AID_ADF1, (short)0, (byte)testConstants.AID_ADF1.length); + commonTests = new Cre_Tin_Acdo_8(); + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance. + Cre_Tin_Acdo_2 thisApplet = new Cre_Tin_Acdo_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(MenuInit1, (short) 0, (short)MenuInit1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(MenuInit2, (short) 0, (short)MenuInit2.length, (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) + { + boolean bRes = true; + boolean bIsAdminFVTest = false; + + // ----------------------------------------------------------------- + // Test Case 2 : No access Applet + // ----------------------------------------------------------------- + + if (event == EVENT_MENU_SELECTION) { + byte bMenuId = 0; + + try + { + bMenuId = (EnvelopeHandlerSystem.getTheHandler().getItemIdentifier()); + } + catch (Exception e) + { + // Debug purpose: only testcase 0x01 Ok if handler not available + reportTestOutcome((byte)0x01, true); + return; + } + + // Fileview access tests + try + { + if (bMenuId == 1) + { + // Get fileviews... + UICCView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + ADF1View = UICCSystem.getTheFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = false; + } + else if (bMenuId == 2) + { + // Get admin fileviews... + UICCView = (FileView)AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + ADF1View = (FileView)AdminFileViewBuilder.getTheAdminFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = true; + + // Reset local testCaseNumber + commonTests.resetCaseNumber(); + } + + commonTests.SetFileViewRef(UICCView, ADF1View); + } + catch(Exception e) + { + // Debug purpose: only testcase 2 (menuID1) or 3 (menuId2) OK, if fileview not available + reportTestOutcome((byte)(bMenuId + 1), true); + return; + } + + // Sub cases 1.1 & 2.1 : Access tests on cyclic EF methods access + // ------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + // Security exception is expected + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + } + + // Sub cases 1.2 & 2.2 : Access tests on linear fixed EF methods access + // -------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + // Security exception is expected + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + } + + // Sub cases 1.3 & 2.3 : Access tests on transparent EF methods access + // ------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + // Security exception is expected + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + } + + // Sub cases 2.4 to 2.6 : Access tests administrative commands + // ----------------------------------------------------------- + if (bMenuId == 2) + { + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + // Security exception is expected + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSecurityException); + } + } + + // Update Outcome report with result table + // --------------------------------------- + for (byte n = 1; n <= abTestResults[0]; n++) + { + reportTestOutcome(n, (abTestResults[n] == (byte)0xCC)); + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_3.java new file mode 100644 index 0000000..67eab05 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_3.java @@ -0,0 +1,176 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Acdo_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +import javacard.framework.* ; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.test.util.* ; + + +public class Cre_Tin_Acdo_3 extends TestToolkitApplet +{ + private static byte[] MenuInit1 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'1'}; + private static byte[] MenuInit2 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'2'}; + final boolean bSecurityException = false; + final boolean bSuccessExecution = true; + AID AID1 = null; + FileView UICCView = null; + FileView ADF1View = null; + byte bTestCaseNb = 0; + byte[] abTestResults = null; + UICCTestConstants testConstants = null; + Cre_Tin_Acdo_8 commonTests = null; + + /** + * Constructor of the applet + */ + + public Cre_Tin_Acdo_3() + { + testConstants = new UICCTestConstants(); + AID1 = new AID(testConstants.AID_ADF1, (short)0, (byte)testConstants.AID_ADF1.length); + commonTests = new Cre_Tin_Acdo_8(); + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance. + Cre_Tin_Acdo_3 thisApplet = new Cre_Tin_Acdo_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(MenuInit1, (short) 0, (short)MenuInit1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(MenuInit2, (short) 0, (short)MenuInit2.length, (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) + { + boolean bRes = true; + boolean bIsAdminFVTest = false; + + // ----------------------------------------------------------------- + // Test Case 3 : Always access right Applet + // ----------------------------------------------------------------- + + if (event == EVENT_MENU_SELECTION) { + byte bMenuId = 0; + + try + { + bMenuId = (EnvelopeHandlerSystem.getTheHandler().getItemIdentifier()); + } + catch (Exception e) + { + // Debug purpose: only testcase 0x01 Ok if handler not available + reportTestOutcome((byte)0x01, true); + return; + } + + // Fileview access tests + try + { + if (bMenuId == 1) + { + // Get fileviews... + UICCView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + ADF1View = UICCSystem.getTheFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = false; + } + else if (bMenuId == 2) + { + // Get admin fileviews... + UICCView = (FileView)AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + ADF1View = (FileView)AdminFileViewBuilder.getTheAdminFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = true; + + // Reset local testCaseNumber + commonTests.resetCaseNumber(); + } + + commonTests.SetFileViewRef(UICCView, ADF1View); + } + catch(Exception e) + { + // Debug purpose: only testcase 2 (menuID1) or 3 (menuId2) OK, if fileview not available + reportTestOutcome((byte)(bMenuId + 1), true); + return; + } + + // Sub cases 1.1 & 2.1 : Access tests on cyclic EF methods access + // ------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 1) + // Security exception is expected, except on EFCARR1 + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.2 & 2.2 : Access tests on linear fixed EF methods access + // -------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 1) + // Security exception is expected, except on EFLARR1 + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.3 & 2.3 : Access tests on transparent EF methods access + // ------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 1) + // Security exception is expected, except on EFTARR1 + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 2.4 to 2.6 : Access tests administrative commands + // ----------------------------------------------------------- + if (bMenuId == 2) + { + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 1) + // Security exception is expected, except on EFTAR1T + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSecurityException); + else + // No exception expected + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSuccessExecution); + } + } + + // Update Outcome report with result table + // --------------------------------------- + for (byte n = 1; n <= abTestResults[0]; n++) + { + reportTestOutcome(n, (abTestResults[n] == (byte)0xCC)); + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_4.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_4.java new file mode 100644 index 0000000..69992c6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_4.java @@ -0,0 +1,176 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Acdo_4.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +import javacard.framework.* ; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.test.util.* ; + + +public class Cre_Tin_Acdo_4 extends TestToolkitApplet +{ + private static byte[] MenuInit1 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'1'}; + private static byte[] MenuInit2 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'2'}; + final boolean bSecurityException = false; + final boolean bSuccessExecution = true; + AID AID1 = null; + FileView UICCView = null; + FileView ADF1View = null; + byte bTestCaseNb = 0; + byte[] abTestResults = null; + UICCTestConstants testConstants = null; + Cre_Tin_Acdo_8 commonTests = null; + + /** + * Constructor of the applet + */ + + public Cre_Tin_Acdo_4() + { + testConstants = new UICCTestConstants(); + AID1 = new AID(testConstants.AID_ADF1, (short)0, (byte)testConstants.AID_ADF1.length); + commonTests = new Cre_Tin_Acdo_8(); + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance. + Cre_Tin_Acdo_4 thisApplet = new Cre_Tin_Acdo_4(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(MenuInit1, (short) 0, (short)MenuInit1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(MenuInit2, (short) 0, (short)MenuInit2.length, (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) + { + boolean bRes = true; + boolean bIsAdminFVTest = false; + + // ----------------------------------------------------------------- + // Test Case 4 : Global PIN2 access right Applet + // ----------------------------------------------------------------- + + if (event == EVENT_MENU_SELECTION) { + byte bMenuId = 0; + + try + { + bMenuId = (EnvelopeHandlerSystem.getTheHandler().getItemIdentifier()); + } + catch (Exception e) + { + // Debug purpose: only testcase 0x01 Ok if handler not available + reportTestOutcome((byte)0x01, true); + return; + } + + // Fileview access tests + try + { + if (bMenuId == 1) + { + // Get fileviews... + UICCView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + ADF1View = UICCSystem.getTheFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = false; + } + else if (bMenuId == 2) + { + // Get admin fileviews... + UICCView = (FileView)AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + ADF1View = (FileView)AdminFileViewBuilder.getTheAdminFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = true; + + // Reset local testCaseNumber + commonTests.resetCaseNumber(); + } + + commonTests.SetFileViewRef(UICCView, ADF1View); + } + catch(Exception e) + { + // Debug purpose: only testcase 2 (menuID1) or 3 (menuId2) OK, if fileview not available + reportTestOutcome((byte)(bMenuId + 1), true); + return; + } + + // Sub cases 1.1 & 2.1 : Access tests on cyclic EF methods access + // ------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 4) + // Security exception is expected, except on EFCARR4 + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.2 & 2.2 : Access tests on linear fixed EF methods access + // -------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 4) + // Security exception is expected, except on EFLARR4 + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.3 & 2.3 : Access tests on transparent EF methods access + // ------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 4) + // Security exception is expected, except on EFTARR4 + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 2.4 to 2.6 : Access tests administrative commands + // ----------------------------------------------------------- + if (bMenuId == 2) + { + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 4) + // Security exception is expected, except on EFTAR4T + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSecurityException); + else + // No exception expected + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSuccessExecution); + } + } + + // Update Outcome report with result table + // --------------------------------------- + for (byte n = 1; n <= abTestResults[0]; n++) + { + reportTestOutcome(n, (abTestResults[n] == (byte)0xCC)); + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_5.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_5.java new file mode 100644 index 0000000..acfbd5a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_5.java @@ -0,0 +1,176 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Acdo_5.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +import javacard.framework.* ; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.test.util.* ; + + +public class Cre_Tin_Acdo_5 extends TestToolkitApplet +{ + private static byte[] MenuInit1 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'1'}; + private static byte[] MenuInit2 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'2'}; + final boolean bSecurityException = false; + final boolean bSuccessExecution = true; + AID AID1 = null; + FileView UICCView = null; + FileView ADF1View = null; + byte bTestCaseNb = 0; + byte[] abTestResults = null; + UICCTestConstants testConstants = null; + Cre_Tin_Acdo_8 commonTests = null; + + /** + * Constructor of the applet + */ + + public Cre_Tin_Acdo_5() + { + testConstants = new UICCTestConstants(); + AID1 = new AID(testConstants.AID_ADF1, (short)0, (byte)testConstants.AID_ADF1.length); + commonTests = new Cre_Tin_Acdo_8(); + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance. + Cre_Tin_Acdo_5 thisApplet = new Cre_Tin_Acdo_5(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(MenuInit1, (short) 0, (short)MenuInit1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(MenuInit2, (short) 0, (short)MenuInit2.length, (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) + { + boolean bRes = true; + boolean bIsAdminFVTest = false; + + // ----------------------------------------------------------------- + // Test Case 5 : Global PIN1 & ADM1 access right Applet + // ----------------------------------------------------------------- + + if (event == EVENT_MENU_SELECTION) { + byte bMenuId = 0; + + try + { + bMenuId = (EnvelopeHandlerSystem.getTheHandler().getItemIdentifier()); + } + catch (Exception e) + { + // Debug purpose: only testcase 0x01 Ok if handler not available + reportTestOutcome((byte)0x01, true); + return; + } + + // Fileview access tests + try + { + if (bMenuId == 1) + { + // Get fileviews... + UICCView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + ADF1View = UICCSystem.getTheFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = false; + } + else if (bMenuId == 2) + { + // Get admin fileviews... + UICCView = (FileView)AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + ADF1View = (FileView)AdminFileViewBuilder.getTheAdminFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = true; + + // Reset local testCaseNumber + commonTests.resetCaseNumber(); + } + + commonTests.SetFileViewRef(UICCView, ADF1View); + } + catch(Exception e) + { + // Debug purpose: only testcase 2 (menuID1) or 3 (menuId2) OK, if fileview not available + reportTestOutcome((byte)(bMenuId + 1), true); + return; + } + + // Sub cases 1.1 & 2.1 : Access tests on cyclic EF methods access + // ------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if ((bARRNb != 3) && (bARRNb != 4)) + // Security exception is expected, except on EFCARR3 and EFCARR4 + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.2 & 2.2 : Access tests on linear fixed EF methods access + // -------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if ((bARRNb != 3) && (bARRNb != 4)) + // Security exception is expected, except on EFLARR3 and EFLARR4 + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.3 & 2.3 : Access tests on transparent EF methods access + // ------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if ((bARRNb != 3) && (bARRNb != 4)) + // Security exception is expected, except on EFTARR3 and EFTARR4 + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 2.4 to 2.6 : Access tests administrative commands + // ----------------------------------------------------------- + if (bMenuId == 2) + { + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if ((bARRNb != 3) && (bARRNb != 4)) + // Security exception is expected, except on EFTAR3T and EFTAR4T + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSecurityException); + else + // No exception expected + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSuccessExecution); + } + } + + // Update Outcome report with result table + // --------------------------------------- + for (byte n = 1; n <= abTestResults[0]; n++) + { + reportTestOutcome(n, (abTestResults[n] == (byte)0xCC)); + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_6.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_6.java new file mode 100644 index 0000000..3736781 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_6.java @@ -0,0 +1,176 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Acdo_6.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +import javacard.framework.* ; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.test.util.* ; + + +public class Cre_Tin_Acdo_6 extends TestToolkitApplet +{ + private static byte[] MenuInit1 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'1'}; + private static byte[] MenuInit2 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1',(byte)'2'}; + final boolean bSecurityException = false; + final boolean bSuccessExecution = true; + AID AID1 = null; + FileView UICCView = null; + FileView ADF1View = null; + byte bTestCaseNb = 0; + byte[] abTestResults = null; + UICCTestConstants testConstants = null; + Cre_Tin_Acdo_8 commonTests = null; + + /** + * Constructor of the applet + */ + + public Cre_Tin_Acdo_6() + { + testConstants = new UICCTestConstants(); + AID1 = new AID(testConstants.AID_ADF1, (short)0, (byte)testConstants.AID_ADF1.length); + commonTests = new Cre_Tin_Acdo_8(); + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance. + Cre_Tin_Acdo_6 thisApplet = new Cre_Tin_Acdo_6(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(MenuInit1, (short) 0, (short)MenuInit1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(MenuInit2, (short) 0, (short)MenuInit2.length, (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) + { + boolean bRes = true; + boolean bIsAdminFVTest = false; + + // ----------------------------------------------------------------- + // Test Case 3 : Local PIN & ADM2 access right Applet + // ----------------------------------------------------------------- + + if (event == EVENT_MENU_SELECTION) { + byte bMenuId = 0; + + try + { + bMenuId = (EnvelopeHandlerSystem.getTheHandler().getItemIdentifier()); + } + catch (Exception e) + { + // Debug purpose: only testcase 0x01 Ok if handler not available + reportTestOutcome((byte)0x01, true); + return; + } + + // Fileview access tests + try + { + if (bMenuId == 1) + { + // Get fileviews... + UICCView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + ADF1View = UICCSystem.getTheFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = false; + } + else if (bMenuId == 2) + { + // Get admin fileviews... + UICCView = (FileView)AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + ADF1View = (FileView)AdminFileViewBuilder.getTheAdminFileView(AID1, JCSystem.CLEAR_ON_RESET); + bIsAdminFVTest = true; + + // Reset local testCaseNumber + commonTests.resetCaseNumber(); + } + + commonTests.SetFileViewRef(UICCView, ADF1View); + } + catch(Exception e) + { + // Debug purpose: only testcase 2 (menuID1) or 3 (menuId2) OK, if fileview not available + reportTestOutcome((byte)(bMenuId + 1), true); + return; + } + + // Sub cases 1.1 & 2.1 : Access tests on cyclic EF methods access + // ------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 5) + // Security exception is expected, except on EFCARR5 + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.cyclicEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.2 & 2.2 : Access tests on linear fixed EF methods access + // -------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 5) + // Security exception is expected, except on EFLARR5 + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.linearEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 1.3 & 2.3 : Access tests on transparent EF methods access + // ------------------------------------------------------------------- + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 5) + // Security exception is expected, except on EFTARR5 + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSecurityException); + else + // No exception expected + abTestResults = commonTests.transpEFTests(bARRNb, bIsAdminFVTest, bSuccessExecution); + } + + // Sub cases 2.4 to 2.6 : Access tests administrative commands + // ----------------------------------------------------------- + if (bMenuId == 2) + { + for (byte bARRNb = 1; bARRNb < 6; bARRNb++) + { + if (bARRNb != 5) + // Security exception is expected, except on EFTAR5T + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSecurityException); + else + // No exception expected + abTestResults = commonTests.adminCmdAccessTests(bARRNb, bSuccessExecution); + } + } + + // Update Outcome report with result table + // --------------------------------------- + for (byte n = 1; n <= abTestResults[0]; n++) + { + reportTestOutcome(n, (abTestResults[n] == (byte)0xCC)); + } + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_7.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_7.java new file mode 100644 index 0000000..70062c6 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_7.java @@ -0,0 +1,316 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Acdo_6.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +import javacard.framework.* ; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.access.fileadministration.*; +import uicc.test.util.* ; + + +public class Cre_Tin_Acdo_7 extends TestToolkitApplet +{ + private static byte[] MenuInit1 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'1'}; + private static byte[] MenuInit2 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'2'}; + private static byte[] MenuInit3 = {(byte)'M',(byte)'e',(byte)'n',(byte)'u',(byte)'3'}; + AID AID1 = null; + FileView UICCView = null; + AdminFileView UICCAdminView = null; + byte bTestCaseNb = 0; + byte[] abRdBin = null; + UICCTestConstants testConstants = null; + + + /** + * Constructor of the applet + */ + + public Cre_Tin_Acdo_7() + { + testConstants = new UICCTestConstants(); + AID1 = new AID(testConstants.AID_ADF1, (short)0, (byte)testConstants.AID_ADF1.length); + abRdBin = new byte[3]; + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance. + Cre_Tin_Acdo_7 thisApplet = new Cre_Tin_Acdo_7(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet. + thisApplet.init(); + + thisApplet.obReg.initMenuEntry(MenuInit1, (short) 0, (short)MenuInit1.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(MenuInit2, (short) 0, (short)MenuInit2.length, (byte) 0, false, (byte) 0, (short) 0); + thisApplet.obReg.initMenuEntry(MenuInit3, (short) 0, (short)MenuInit3.length, (byte) 0, false, (byte) 0, (short) 0); + } + + /** + * Method called by the CAT RE + */ + public void processToolkit(short event) + { + boolean bRes = false; + byte bMenuId = 0; + + // ----------------------------------------------------------------- + // Test Case 7 : AdminFileview and Fileview acces domain parameter differenciation + // ----------------------------------------------------------------- + + bMenuId = (byte)EnvelopeHandlerSystem.getTheHandler().getItemIdentifier(); + + switch(bMenuId) + { + case 1: + // Fileview access tests + try + { + // Get fileviews... + UICCView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + } + catch(Exception e) + { + return; + } + + // Sub cases 1.1 : successful FileView access + // ------------------------------------------ + UICCView.select(UICCTestConstants.FID_DF_TEST); + UICCView.select(UICCTestConstants.FID_EF_TARR1); + try + { + UICCView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 1, bRes); + + // Sub cases 1.2 : Unsuccessful FileView access + // -------------------------------------------- + UICCView.select(UICCTestConstants.FID_DF_TEST); + UICCView.select(UICCTestConstants.FID_EF_TARR5); + try + { + UICCView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = false; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 2, bRes); + + // Sub cases 1.3 : Successful FileView access + // ------------------------------------------ + UICCView.select(UICCTestConstants.FID_DF_TEST); + UICCView.select(UICCTestConstants.FID_EF_TARR4); + try + { + UICCView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 3, bRes); + + break; + + case 2: + // Fileview access tests + try + { + // Get fileviews... + UICCAdminView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + } + catch(Exception e) + { + return; + } + + // Sub cases 4.1 : Unsuccessful adminFileView access + // ------------------------------------------------- + UICCAdminView.select(UICCTestConstants.FID_DF_TEST); + UICCAdminView.select(UICCTestConstants.FID_EF_TARR1); + try + { + UICCAdminView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = false; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 1, bRes); + + // Sub cases 4.2 : successful adminFileView access + // ----------------------------------------------- + UICCAdminView.select(UICCTestConstants.FID_DF_TEST); + UICCAdminView.select(UICCTestConstants.FID_EF_TARR5); + try + { + UICCAdminView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 2, bRes); + + + // Sub cases 4.3 : Successful adminFileView access + // ----------------------------------------------- + UICCAdminView.select(UICCTestConstants.FID_DF_TEST); + UICCAdminView.select(UICCTestConstants.FID_EF_TARR4); + try + { + UICCAdminView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 3, bRes); + break; + + case 3: + // Fileview access tests + try + { + // Get fileviews... + UICCView = UICCSystem.getTheUICCView(JCSystem.CLEAR_ON_RESET); + UICCAdminView = AdminFileViewBuilder.getTheUICCAdminFileView(JCSystem.CLEAR_ON_RESET); + } + catch(Exception e) + { + return; + } + + // Sub cases 7.1 : successful FileView access + // ------------------------------------------ + UICCView.select(UICCTestConstants.FID_DF_TEST); + UICCView.select(UICCTestConstants.FID_EF_TARR1); + try + { + UICCView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 1, bRes); + + // Sub cases 7.2 : Unsuccessful adminFileView access + // ------------------------------------------------- + UICCAdminView.select(UICCTestConstants.FID_DF_TEST); + UICCAdminView.select(UICCTestConstants.FID_EF_TARR1); + try + { + UICCAdminView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = false; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 2, bRes); + + // Sub cases 7.3 : successful adminFileView access + // ----------------------------------------------- + UICCAdminView.select(UICCTestConstants.FID_DF_TEST); + UICCAdminView.select(UICCTestConstants.FID_EF_TARR5); + try + { + UICCAdminView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 3, bRes); + + // Sub cases 7.2 : Unsuccessful FileView access + // -------------------------------------------- + UICCView.select(UICCTestConstants.FID_DF_TEST); + UICCView.select(UICCTestConstants.FID_EF_TARR5); + try + { + UICCView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = false; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED); + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 4, bRes); + + // Sub cases 7.5 : Successful FileView access + // ------------------------------------------ + UICCView.select(UICCTestConstants.FID_DF_TEST); + UICCView.select(UICCTestConstants.FID_EF_TARR4); + try + { + UICCView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 5, bRes); + + // Sub cases 7.6 : Successful adminFileView access + // ----------------------------------------------- + UICCAdminView.select(UICCTestConstants.FID_DF_TEST); + UICCAdminView.select(UICCTestConstants.FID_EF_TARR4); + try + { + UICCAdminView.readBinary((short)0, abRdBin, (short)0, (short)abRdBin.length); + bRes = true; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte) 6, bRes); + break; + } + } +} \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_8.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_8.java new file mode 100644 index 0000000..2ad739a --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Cre_Tin_Acdo_8.java @@ -0,0 +1,751 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Acdo_8.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +import javacard.framework.*; +import uicc.toolkit.*; +import uicc.access.*; +import uicc.system.*; +import uicc.access.fileadministration.*; +import uicc.test.util.* ; + + +public class Cre_Tin_Acdo_8 +{ + private byte[] abUpRec = {0x22, 0x22, 0x22}; + private byte[] abUpbin = {0x11, 0x11, 0x11}; + private byte[] abInc = {0x00, 0x00, 0x00}; + private byte[] abRdRec = null; + private byte[] abRes = null; + private short[] asSearch = null; + private byte bTestCaseNb = (byte) 0x00; + private short[] asCyclicEF = {(short)0, UICCTestConstants.FID_EF_CARR1, UICCTestConstants.FID_EF_CARR2, UICCTestConstants.FID_EF_CARR3, UICCTestConstants.FID_EF_CARR4, UICCTestConstants.FID_EF_CARR5}; + private short[] asLinearEF = {(short)0, UICCTestConstants.FID_EF_LARR1, UICCTestConstants.FID_EF_LARR2, UICCTestConstants.FID_EF_LARR3, UICCTestConstants.FID_EF_LARR4, UICCTestConstants.FID_EF_LARR5}; + private short[] asTranspEF = {(short)0, UICCTestConstants.FID_EF_TARR1, UICCTestConstants.FID_EF_TARR2, UICCTestConstants.FID_EF_TARR3, UICCTestConstants.FID_EF_TARR4, UICCTestConstants.FID_EF_TARR5}; + private short[] asAccessDF = {(short)0, UICCTestConstants.FID_DF_ARR1, UICCTestConstants.FID_DF_ARR2, UICCTestConstants.FID_DF_ARR3, UICCTestConstants.FID_DF_ARR4, UICCTestConstants.FID_DF_ARR5}; + private short[] asAccessEF = {(short)0, UICCTestConstants.FID_EF_TAR1T, UICCTestConstants.FID_EF_TAR2T, UICCTestConstants.FID_EF_TAR3T, UICCTestConstants.FID_EF_TAR4T, UICCTestConstants.FID_EF_TAR5T}; + private byte [] abCreateEF = { + (byte)0x82,(byte)0x02, // Tag, Length - File descriptor + (byte)0x41,(byte)0x21, // Value - File descriptor (Transparent) + (byte)0x83,(byte)0x02, // Tag, Length - File Id + (byte)0xEF,(byte)0x00, // Value - File Id + (byte)0x8A,(byte)0x01,(byte)0x05, // Tag, Length, Value - LCSI (Activated) + (byte)0x8B,(byte)0x03, // Tag, Length - Security attribute + (byte)0x2F,(byte)0x06,(byte)0x01, // Value - Security attribute (EF Arr, record nb) + (byte)0x80,(byte)0x01,(byte)0x05, // Tag, Length, value - File size (5 bytes) + (byte)0x88,(byte)0x00}; // Tag, Length - SFI (no SFI) + private byte [] abCreateEF_inADF = { + (byte)0x82,(byte)0x02, // Tag, Length - File descriptor + (byte)0x41,(byte)0x21, // Value - File descriptor (Transparent) + (byte)0x83,(byte)0x02, // Tag, Length - File Id + (byte)0xEF,(byte)0x00, // Value - File Id + (byte)0x8A,(byte)0x01,(byte)0x05, // Tag, Length, Value - LCSI (Activated) + (byte)0x8B,(byte)0x03, // Tag, Length - Security attribute + (byte)0x6F,(byte)0x06,(byte)0x01, // Value - Security attribute (EF Arr, record nb) + (byte)0x80,(byte)0x01,(byte)0x05, // Tag, Length, value - File size (5 bytes) + (byte)0x88,(byte)0x00}; // Tag, Length - SFI (no SFI) + private byte [] abResizeEF = { + (byte)0x83,(byte)0x02, // Tag, Length - File Id + (byte)0xEF,(byte)0x00, // Value - File Id + (byte)0x80,(byte)0x01,(byte)0x0A}; // Tag, Length, value - File size (5 bytes) + AID AID1 = null; + FileView UICCView = null; + FileView ADF1View = null; + ViewHandler createEFCmd = null; + ViewHandler resizeCmd = null; + byte abTestsResults[] = null; + + public Cre_Tin_Acdo_8() + { + abTestsResults = new byte[128]; + Util.arrayFillNonAtomic(abTestsResults, (short)0, (short)abTestsResults.length, (byte)0x00); + abRdRec = new byte[3]; + abRes = new byte[6]; + asSearch = new short[3]; + bTestCaseNb = 0; + } + + public void SetFileViewRef(FileView theUICCView, FileView theADF1View) + { + UICCView = theUICCView; + ADF1View = theADF1View; + } + + public void resetCaseNumber() + { + bTestCaseNb = 0; + } + + private void reportTestOutcome(byte testCaseNumber, boolean testCaseResult) { + // Update the total number of tests executed + abTestsResults[0] = testCaseNumber; + + // Set the Test Case Result byte to 0xCC (for Card Compliant...) if successful + if (testCaseResult) { + abTestsResults[testCaseNumber] = (byte)0xCC; + } + else { + abTestsResults[testCaseNumber] = (byte)0x00; + } + } + + public byte[] cyclicEFTests(byte bARRNb, boolean bIsAdminFVTest, boolean bIsSuccess) + { + boolean bRes = false; + try + { + // Common calls to FileView and AdminFileView + UICCView.select((short) UICCTestConstants.FID_DF_TEST); + ADF1View.select((short) UICCTestConstants.FID_DF_TEST); + UICCView.select((short) asCyclicEF[bARRNb]); + ADF1View.select((short) asCyclicEF[bARRNb]); + + // Deactivate Command + // ------------------ + try + { + UICCView.deactivateFile(); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.deactivateFile(); + bRes &= true;//bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 1-7-13-19-25- + + // Activate Command + // ---------------- + try + { + UICCView.activateFile(); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.activateFile(); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 2-8-14-20-26 - + + // Update Record Command + // --------------------- + try + { + UICCView.updateRecord((short)0, UICCConstants.REC_ACC_MODE_PREVIOUS, (short)0, + abUpRec, (short)0, (short)abUpRec.length); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.updateRecord((short)0, UICCConstants.REC_ACC_MODE_PREVIOUS, (short)0, + abUpRec, (short)0, (short)abUpRec.length); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 3-9-15-21-27 - + + // Read Record Command + // ------------------- + try + { + UICCView.readRecord((short)0, UICCConstants.REC_ACC_MODE_CURRENT, (short)0, + abRdRec, (short)0, (short)abRdRec.length); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.readRecord((short)0, UICCConstants.REC_ACC_MODE_CURRENT, (short)0, + abRdRec, (short)0, (short)abRdRec.length); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 4-10-16-22-28 - + + // Search Record Command + // --------------------- + try + { + UICCView.searchRecord(UICCConstants.SIMPLE_SEARCH_START_FORWARD, (short) 0, (short)0, + abRdRec, (short)0, (short)abRdRec.length, + asSearch, (short)0, (short)asSearch.length); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.searchRecord(UICCConstants.SIMPLE_SEARCH_START_FORWARD, (short) 0, (short)0, + abRdRec, (short)0, (short)abRdRec.length, + asSearch, (short)0, (short)asSearch.length); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 5-11-17-23-29 - + + // Increase Command + // ---------------- + try + { + UICCView.increase(abInc, (short)0, (short)abInc.length, abRes, (short)0); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.increase(abInc, (short)0, (short)abInc.length, abRes, (short)0); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 6-12-18-24-30 - + } + catch (Exception e) + { + return abTestsResults; + } + return abTestsResults; + } + + public byte[] linearEFTests(byte bARRNb, boolean bIsAdminFVTest, boolean bIsSuccess) + { + boolean bRes = false; + try + { + // Common calls to FileView and AdminFileView + UICCView.select((short) UICCTestConstants.FID_DF_TEST); + ADF1View.select((short) UICCTestConstants.FID_DF_TEST); + UICCView.select((short) asLinearEF[bARRNb]); + ADF1View.select((short) asLinearEF[bARRNb]); + + // Deactivate Command + // ------------------ + try + { + UICCView.deactivateFile(); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.deactivateFile(); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 31-36-41-46-51 - + + // Activate Command + // ---------------- + try + { + UICCView.activateFile(); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.activateFile(); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 32-37-42-47-52 - + + // Update Record Command + // --------------------- + try + { + UICCView.updateRecord((short)0, UICCConstants.REC_ACC_MODE_NEXT, (short)0, + abUpRec, (short)0, (short)abUpRec.length); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.updateRecord((short)0, UICCConstants.REC_ACC_MODE_NEXT, (short)0, + abUpRec, (short)0, (short)abUpRec.length); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 33-38-43-48-53 - + + // Read Record Command + // ------------------- + try + { + UICCView.readRecord((short)0, UICCConstants.REC_ACC_MODE_CURRENT, (short)0, + abRdRec, (short)0, (short)abRdRec.length); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.readRecord((short)0, UICCConstants.REC_ACC_MODE_CURRENT, (short)0, + abRdRec, (short)0, (short)abRdRec.length); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 34-39-44-49-54 - + + // Search Record Command + // --------------------- + try + { + UICCView.searchRecord(UICCConstants.SIMPLE_SEARCH_START_FORWARD, (short) 0, (short)0, + abRdRec, (short)0, (short)abRdRec.length, + asSearch, (short)0, (short)asSearch.length); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.searchRecord(UICCConstants.SIMPLE_SEARCH_START_FORWARD, (short) 0, (short)0, + abRdRec, (short)0, (short)abRdRec.length, + asSearch, (short)0, (short)asSearch.length); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 35-40-45-50-55 - + } + catch (Exception e) + { + return abTestsResults; + } + return abTestsResults; + } + + public byte[] transpEFTests(byte bARRNb, boolean bIsAdminFVTest, boolean bIsSuccess) + { + boolean bRes = false; + try + { + // Common calls to FileView and AdminFileView + UICCView.select((short) UICCTestConstants.FID_DF_TEST); + ADF1View.select((short) UICCTestConstants.FID_DF_TEST); + UICCView.select((short) asTranspEF[bARRNb]); + ADF1View.select((short) asTranspEF[bARRNb]); + + // Deactivate Command + // ------------------ + try + { + UICCView.deactivateFile(); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.deactivateFile(); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 56-60-64-68-72 - + + // Activate Command + // ---------------- + try + { + UICCView.activateFile(); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.activateFile(); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 57-61-65-69-73 - + + // Update Binary Command + // --------------------- + try + { + UICCView.updateBinary((short)0, abUpbin, (short)0, (short)abUpbin.length); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.updateBinary((short)0, abUpbin, (short)0, (short)abUpbin.length); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 58-62-66-70-74 - + + // Read Binary Command + // ------------------- + try + { + UICCView.readBinary((short)0, abRdRec, (short)0, (short)abRdRec.length); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + ADF1View.readBinary((short)0, abRdRec, (short)0, (short)abRdRec.length); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 59-63-67-71-75 - + } + catch (Exception e) + { + return abTestsResults; + } + return abTestsResults; + } + + public byte[] adminCmdAccessTests(byte bARRNb, boolean bIsSuccess) + { + boolean bRes = false; + try + { + AdminFileView adminUICCView = (AdminFileView) UICCView; + AdminFileView adminADF1View = (AdminFileView) ADF1View; + + // AdminFileView methods call only + adminUICCView.select(UICCTestConstants.FID_MF); + adminADF1View.select(UICCTestConstants.FID_ADF); + adminUICCView.select(UICCTestConstants.FID_DF_TEST); + adminADF1View.select(UICCTestConstants.FID_DF_TEST); + adminUICCView.select(asAccessDF[bARRNb]); + adminADF1View.select(asAccessDF[bARRNb]); + + // Create Command + // -------------- + //Create EF with access rule bARRNb in EF 0xAC00 + abCreateEF[15] = (byte)bARRNb; + createEFCmd = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, (short)abCreateEF.length, abCreateEF, (short)0x00, (short)abCreateEF.length); + try + { + adminUICCView.createFile(createEFCmd); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + abCreateEF_inADF[15] = (byte)bARRNb; + createEFCmd = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, (short)abCreateEF_inADF.length, abCreateEF_inADF, (short)0x00, (short)abCreateEF_inADF.length); + try + { + adminADF1View.createFile(createEFCmd); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 76-79-82-85-88 + + // Resize Command + // -------------- + if (bIsSuccess) // file 0xEF00 not created + { + abResizeEF[2] = (byte)0xEF; + abResizeEF[3] = (byte)0x00; + } + else + { + abResizeEF[2] = (byte)((asAccessEF[bARRNb] >> 8) & 0x00FF); + abResizeEF[3] = (byte)(asAccessEF[bARRNb] & 0x00FF); + } + resizeCmd = HandlerBuilder.buildTLVHandler(HandlerBuilder.EDIT_HANDLER, (short)abResizeEF.length, abResizeEF, (short)0x00, (short)abResizeEF.length); + try + { + adminUICCView.resizeFile(resizeCmd); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + adminADF1View.resizeFile(resizeCmd); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 77-80-83-86-89 + + // Delete Command + // -------------- + try + { + if (bIsSuccess) + adminUICCView.deleteFile((short)0xEF00); + else + adminUICCView.deleteFile(asAccessEF[bARRNb]); + bRes = bIsSuccess; + } + catch (UICCException e) + { + bRes = (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + try + { + if (bIsSuccess) + adminADF1View.deleteFile((short)0xEF00); + else + adminADF1View.deleteFile(asAccessEF[bARRNb]); + bRes &= bIsSuccess; + } + catch (UICCException e) + { + bRes &= (e.getReason() == UICCException.SECURITY_STATUS_NOT_SATISFIED) && !bIsSuccess; + } + catch (Exception e) + { + bRes = false; + } + reportTestOutcome((byte)++bTestCaseNb, bRes); // testcaseNb = 78-81-84-87-90 + } + catch (Exception e) + { + return abTestsResults; + } + return abTestsResults; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Test_Cre_Tin_Acdo.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Test_Cre_Tin_Acdo.java new file mode 100644 index 0000000..f4bb134 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/Test_Cre_Tin_Acdo.java @@ -0,0 +1,684 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_acdo; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Acdo extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_acdo"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + static final String CLASS_AID_4 = "A0000000 090005FF FFFFFF89 50040001"; + static final String APPLET_AID_4 = "A0000000 090005FF FFFFFF89 50040102"; + static final String CLASS_AID_5 = "A0000000 090005FF FFFFFF89 50050001"; + static final String APPLET_AID_5 = "A0000000 090005FF FFFFFF89 50050102"; + static final String CLASS_AID_6 = "A0000000 090005FF FFFFFF89 50060001"; + static final String APPLET_AID_6 = "A0000000 090005FF FFFFFF89 50060102"; + static final String CLASS_AID_7 = "A0000000 090005FF FFFFFF89 50070001"; + static final String APPLET_AID_7 = "A0000000 090005FF FFFFFF89 50070102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Acdo() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + public boolean run() { + APDUResponse data = null; + boolean result = false; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // install package and applet + test.loadPackage(CAP_FILE_PATH); + + + /*********************************************************************/ + /** Testcase 1 : Full access Applet */ + /*********************************************************************/ + + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00" + // LV Access Domain DAP field + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = Full Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0100" + // LV Access Domain for ADF1 file system = Full Access + "00"); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + + // Trigger Applet1 on its menu 1 to launch fileview access tests + response = test.envelopeMenuSelection("100101", ""); + result = response.checkSw("9000"); + + /** Check Applet first results */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "4B" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + test.reset(); + test.terminalProfileSession("09010020"); + + // Trigger Applet1 on its menu 2 to launch admin fileview access tests + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "5A" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCC"); + + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + // delete applet + test.deleteApplet(APPLET_AID_1); + + + /*********************************************************************/ + /** Testcase 2 : No access Applet */ + /*********************************************************************/ + + test.installApplet( CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8118" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "01FF" + // LV Access Domain for UICC file system = No Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "01FF" + // LV Access Domain for ADF1 file system = No Access + "00" + // LV Access Domain DAP field + "8218" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "01FF" + // LV Access Domain for UICC file system = No Access + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "01FF" + // LV Access Domain for ADF1 file system = No Access + "00"); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + // Trigger Applet2 on its menu 1 to launch fileview access tests + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Check Applet first results */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "4B" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + // Trigger Applet2 on its menu 2 to launch admin fileview access tests + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_2); + result &= response.checkData("10" + APPLET_AID_2 + "5A" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCC"); + + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + // delete applet + test.deleteApplet(APPLET_AID_2); + + + /*********************************************************************/ + /** Testcase 3 : Always access right Applet */ + /*********************************************************************/ + + test.installApplet( CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "811E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402000004" + // LV Access Domain for UICC file system = Always access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402000004" + // LV Access Domain for ADF1 file system = Always access right + "00" + // LV Access Domain DAP field + "821E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402000004" + // LV Access Domain for UICC file system = Always access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402000004" + // LV Access Domain for ADF1 file system = Always access right + "00" ); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + + // Trigger Applet3 on its menu 1 to launch fileview access tests + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Check Applet first results */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "4B" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + // Trigger Applet3 on its menu 2 to launch admin fileview access tests + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_3); + result &= response.checkData("10" + APPLET_AID_3 + "5A" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applet + test.deleteApplet(APPLET_AID_3); + + + /*********************************************************************/ + /** Testcase 4 : Global PIN1 access right Applet */ + /*********************************************************************/ + + test.installApplet( CAP_FILE_PATH, CLASS_AID_4, APPLET_AID_4, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "811E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402010000" + // LV Access Domain for UICC file system = Global PIN1 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402010000" + // LV Access Domain for ADF1 file system = Global PIN1 access right + "00" + // LV Access Domain DAP field + "821E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402010000" + // LV Access Domain for UICC file system = Global PIN1 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402010000" + // LV Access Domain for ADF1 file system = Global PIN1 access right + "00" ); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + + // Trigger Applet4 on its menu 1 to launch fileview access tests + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Check Applet first results */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_4); + result &= response.checkData("10" + APPLET_AID_4 + "4B" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + // Trigger Applet4 on its menu 2 to launch admin fileview access tests + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_4); + result &= response.checkData("10" + APPLET_AID_4 + "5A" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applet + test.deleteApplet(APPLET_AID_4); + + + /*********************************************************************/ + /** Testcase 5 : Global PIN1 & ADM1 access right Applet */ + /*********************************************************************/ + + test.installApplet( CAP_FILE_PATH, CLASS_AID_5, APPLET_AID_5, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "811E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402010100" + // LV Access Domain for UICC file system = Global PIN1 & ADM1 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402010100" + // LV Access Domain for ADF1 file system = Global PIN1 & ADM1 access right + "00" + // LV Access Domain DAP field + "821E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402010100" + // LV Access Domain for UICC file system = Global PIN1 & ADM1 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402010100" + // LV Access Domain for ADF1 file system = Global PIN1 & ADM1 access right + "00" ); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + + // Trigger Applet5 on its menu 1 to launch fileview access tests + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Check Applet first results */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_5); + result &= response.checkData("10" + APPLET_AID_5 + "4B" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + // Trigger Applet5 on its menu 2 to launch admin fileview access tests + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_5); + result &= response.checkData("10" + APPLET_AID_5 + "5A" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applet + test.deleteApplet(APPLET_AID_5); + + + /*********************************************************************/ + /** Testcase 6 : Local PIN & ADM2 access right Applet */ + /*********************************************************************/ + + test.installApplet( CAP_FILE_PATH, CLASS_AID_6, APPLET_AID_6, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "811E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402000208" + // LV Access Domain for UICC file system = Local PIN & ADM2 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402000208" + // LV Access Domain for ADF1 file system = Local PIN & ADM2 access right + "00" + // LV Access Domain DAP field + "821E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402000208" + // LV Access Domain for UICC file system = Local PIN & ADM2 access right + "00" + // LV UICC File System AID field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402000208" + // LV Access Domain for ADF1 file system = Local PIN & ADM2 access right + "00" ); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + + // Trigger Applet6 on its menu 1 to launch fileview access tests + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Check Applet first results */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_6); + result &= response.checkData("10" + APPLET_AID_6 + "4B" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCC"); + + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + // Trigger Applet6 on its menu 2 to launch admin fileview access tests + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_6); + result &= response.checkData("10" + APPLET_AID_6 + "5A" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCC" + + "CCCCCCCC CCCCCCCC CCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applet + test.deleteApplet(APPLET_AID_6); + + + + /*********************************************************************/ + /** Testcase 7 : Acces domain parameter differenciation */ + /*********************************************************************/ + + /** Subcase 1 **/ + /***************/ + + test.installApplet( CAP_FILE_PATH, CLASS_AID_7, APPLET_AID_7, + "800E" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "03" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "03" + // V Id of menu entry 3 + "04" + // V Position of menu entry 3 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "811E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402000104" + // LV Access Domain for UICC file system = Always & ADM1 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402000104" + // LV Access Domain for ADF1 file system = Always & ADM1 access right + "00" ); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + + // Trigger Applet7 on its menu 2 to launch fileview access tests + response = test.envelopeMenuSelection("100101", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_7); + result &= response.checkData("10" + APPLET_AID_7 + "03" + "CCCCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // delete applet + test.deleteApplet(APPLET_AID_7); + + /** Subcase 2 **/ + /***************/ + + test.installApplet( CAP_FILE_PATH, CLASS_AID_7, APPLET_AID_7, + "800E" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "03" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "03" + // V Id of menu entry 3 + "04" + // V Position of menu entry 3 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "821E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402010200" + // LV Access Domain for UICC file system = Global PIN1 & ADM2 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402010200" + // LV Access Domain for ADF1 file system = Global PIN1 & ADM2 access right + "00" ); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + + // Trigger Applet7 on its menu 2 to launch fileview access tests + response = test.envelopeMenuSelection("100102", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_7); + result &= response.checkData("10" + APPLET_AID_7 + "03" + "CCCCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applet + test.deleteApplet(APPLET_AID_7); + + /** Subcase 3 **/ + /***************/ + test.installApplet(CAP_FILE_PATH, CLASS_AID_7, APPLET_AID_7, + "800E" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0F" + // V Maximum text length for a menu entry + "03" + // V Maximum number of menu entries + "01" + // V Id of menu entry 1 + "01" + // V Position of menu entry 1 + "02" + // V Id of menu entry 2 + "02" + // V Position of menu entry 2 + "03" + // V Id of menu entry 3 + "03" + // V Position of menu entry 3 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "811E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402000104" + // LV Access Domain for UICC file system = Always & ADM1 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402000104" + // LV Access Domain for ADF1 file system = Always & ADM1 access right + "00" + // LV Access Domain DAP field + "821E" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0402010200" + // LV Access Domain for UICC file system = Global PIN1 & ADM2 access right + "00" + // LV Access Domain DAP field + "10A0000000090005FFFFFFFF89E0000002" + // LV ADF1 File System AID field + "0402010200" + // LV Access Domain for ADF1 file system = Global PIN1 & ADM2 access right + "00" ); // LV Access Domain DAP field + // test script + test.reset(); + // Terminal Profile with Set Up Menu + test.terminalProfileSession("09010020"); + + + // Trigger Applet7 on its menu 1 to launch fileview access tests + response = test.envelopeMenuSelection("100103", ""); + result &= response.checkSw("9000"); + + /** Check Applet second results then delete it */ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_7); + result &= response.checkData("10" + APPLET_AID_7 + "06" + + "CCCCCCCC CCCC"); + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applet + test.deleteApplet(APPLET_AID_7); + + // Delete package + test.deletePackage(CAP_FILE_PATH); + + return result; + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/applet.opt new file mode 100644 index 0000000..9a29b71 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/applet.opt @@ -0,0 +1,10 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x04:0x00:0x01 uicc.test.catre.cre_tin_acdo.Cre_Tin_Acdo_4 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_acdo.Cre_Tin_Acdo_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x07:0x00:0x01 uicc.test.catre.cre_tin_acdo.Cre_Tin_Acdo_7 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_tin_acdo.Cre_Tin_Acdo_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_acdo.Cre_Tin_Acdo_1 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x05:0x00:0x01 uicc.test.catre.cre_tin_acdo.Cre_Tin_Acdo_5 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x06:0x00:0x01 uicc.test.catre.cre_tin_acdo.Cre_Tin_Acdo_6 +uicc.test.catre.cre_tin_acdo +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/javacard/cre_tin_acdo.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_acdo/javacard/cre_tin_acdo.cap new file mode 100644 index 0000000000000000000000000000000000000000..2a79ee8f10b4c8e8d711bd8dc00976be6e19b94b GIT binary patch literal 14237 zcmd^Gdwf*Yoj+&pb7nG`nIv;FdCMatU?2}95My`@f`S480t~eUVu%f|$!v%a5-S4< z3?`ars%(j(AmFQBD=l`rSlrgOw7S-|+oyfoZP|~Hs<;Ka)|!6Lxi>R+#(*Ps`^WA~ ze)o5Nzw`T@?>YDTyEk`|GxgUAVir;H_TJS$jaXh;L?nymHO!g3VDbF&MROJ}m_KiM z!<0qy-+!JEeZ`{IBNd)gMg65W}fRU3!hw>_nq9#W5c(O z`TY3t2Xi0!N-%Qzzt5bSKJ}`zpL}B8qi6f-kCnCUePr(DO%I7b9s7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}Fg>I636(b3g%lubFXTFc`oNP|dZ;X_B&fH9(}368Er z=|X5+9!~OlXxbubK)h2A&87zK1%K`#y^`3 zz~`z!j9eSY6*0n5Lig~nzzU*-W{eS_>ERLLk)v*8|Ns#0a@5im82 zmSg<6;KYuQ%LSb-0yD*UYn$siehQYu*mdv0y9B%L#XsM4`D0d$DxaiY8nyS1n3dmQ z)*mY8u%a8?VU4Oe3jw-Sbk4_>th+ORH$kZnkmr|}@Kxn2jim|mGl L#w6ZhM;HAcB*>l7 literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_1.java new file mode 100644 index 0000000..61fba2d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_1.java @@ -0,0 +1,57 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itid_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itid ; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Itid_1 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '1', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itid_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance + Cre_Tin_Itid_1 thisApplet = new Cre_Tin_Itid_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + menuInit [5] = (byte) '2'; + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_2.java new file mode 100644 index 0000000..bcca41d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_2.java @@ -0,0 +1,54 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itid_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itid ; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Itid_2 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '2', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itid_2() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Itid_2 thisApplet = new Cre_Tin_Itid_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_3.java new file mode 100644 index 0000000..a1b13d4 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Cre_Tin_Itid_3.java @@ -0,0 +1,53 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itid_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itid ; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Itid_3 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '3', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itid_3() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Itid_3 thisApplet = new Cre_Tin_Itid_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE */ + public void processToolkit(short event) + { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Test_Cre_Tin_Itid.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Test_Cre_Tin_Itid.java new file mode 100644 index 0000000..b212bd5 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/Test_Cre_Tin_Itid.java @@ -0,0 +1,335 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itid; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Itid extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_itid"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Itid() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + String[] menuList = new String[4]; + String[] menuIdList = new String[4]; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install package + test.loadPackage(CAP_FILE_PATH); + // Bad Install Applet1 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Position of menu entry 1 + "01" + // V Id of menu entry 1 + "02" + // V Position of menu entry 2 + "80" + // V Id of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + result = response.checkSw("6A80"); + + // Select applet1 + response = test.selectApplication(APPLET_AID_1); + result &= !(response.checkData("10" + APPLET_AID_1 + "00") && response.checkSw("9000")); + + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Good Install Applet1 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "01" + // V Position of menu entry 1 + "01" + // V Id of menu entry 1 + "02" + // V Position of menu entry 2 + "7F" + // V ID of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + // Card Initialisation + test.reset(); + response = test.terminalProfile("09030020"); + result &= response.checkSw("9128"); + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu12"; menuIdList[1] = "7F"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)2, menuIdList, menuList, null, null); + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + + // Bad Install Applet2 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "08" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Position of menu entry 1 + "7F" + // V ID of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + result &= response.checkSw("6A80"); + + // Select applet1 + response = test.selectApplication(APPLET_AID_2); + result &= !(response.checkData("10" + APPLET_AID_1 + "00") && response.checkSw("9000")); + + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Good Install Applet2 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Position of menu entry 1 + "00" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.checkSw("9131"); + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu12"; menuIdList[1] = "7F"; + menuList[2] = "Menu21"; menuIdList[2] = "80"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)3, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Good Install Applet3 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "04" + // V Position of menu entry 1 + "00" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.checkSw("913A"); + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu12"; menuIdList[1] = "7F"; + menuList[2] = "Menu21"; menuIdList[2] = "80"; + menuList[3] = "Menu31"; menuIdList[3] = "81"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)4, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 5 */ + /*********************************************************************/ + + // Delete Applet2 + response = test.deleteApplet(APPLET_AID_2); + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.checkSw("9131"); + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu12"; menuIdList[1] = "7F"; + menuList[2] = "Menu31"; menuIdList[2] = "81"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)3, menuIdList, menuList, null, null); + + // Good Install Applet2 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Position of menu entry 1 + "00" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.checkSw("913A"); + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu12"; menuIdList[1] = "7F"; + menuList[2] = "Menu21"; menuIdList[2] = "80"; + menuList[3] = "Menu31"; menuIdList[3] = "81"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)4, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } + + // Fetch a sepUpMenu command, check it according to the parameters + // and send the Terminal Response. + // Return true if the recieved command correspond to the one rebuild using + // the paramaters + private boolean fetchSetUpMenu( + String alphaId, // AlphaId TLV Value + String alphaIdTextAtt, // AlphaId Text Attribute TLV Value + byte nbMenu, // Number of menus + String[] menuId, // Menu Id List table + String[] menu, // Text Menu List table (in readable text!) + String nextActionTLV, // Next Action List TLV + String itemTextAttListTLV) // Item Text Attribute List TLV + { + boolean result; + String setUpMenuCmd = ""; + String endOfCmd = ""; + String Cmd = ""; + + // Build the Set Up Menu + if (nextActionTLV != null) + { + endOfCmd = nextActionTLV; + } + if (alphaIdTextAtt != null) + { + endOfCmd += "50" + ToString((byte)(alphaIdTextAtt.length()/2)) + alphaIdTextAtt; + } + if (itemTextAttListTLV != null) + { + endOfCmd += itemTextAttListTLV; + } + + String menuItem = ""; + String menuList = ""; + for (byte i = 0; i < nbMenu; i++) + { + menuItem = menuId[i]; + menuItem += ByteToString(menu[i].getBytes()); + menuList += "8F" + ToString((byte)(menuItem.length()/2)) + menuItem; + } + Cmd = menuList + endOfCmd; + + String alpId = ByteToString(alphaId.getBytes()); + setUpMenuCmd = "85" + ToString((byte)(alpId.length()/2)) + alpId; + setUpMenuCmd += Cmd; + Cmd = setUpMenuCmd; + setUpMenuCmd = "810301250082028182" + Cmd; + Cmd = setUpMenuCmd; + setUpMenuCmd = "D0" + ToString((byte)(Cmd.length()/2)) + Cmd; + + response = test.fetch(ToString((byte)(setUpMenuCmd.length()/2))); + result = response.checkData(setUpMenuCmd); + + test.terminalResponse("81030125 00820282 81830100"); + + return result; + } + + private String ByteToString( byte tab[] ) + { + byte[] tab2; + byte c; + int i, j, k; + + j = tab.length; + tab2 = new byte[ j*2]; + + k = 0; + for ( i=0; i>4)&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + + c = (byte)(tab[ i ]&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + } + + return new String( tab2 ); + } + + // byte => String + private String ToString( byte myByte ) + { + byte[] tab; + byte c; + int i, j, k; + + tab = new byte[1]; + tab[0] = myByte; + + return ByteToString( tab ); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/applet.opt new file mode 100644 index 0000000..69a638b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/applet.opt @@ -0,0 +1,6 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_itid.Cre_Tin_Itid_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_tin_itid.Cre_Tin_Itid_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_itid.Cre_Tin_Itid_1 +uicc.test.catre.cre_tin_itid +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/javacard/cre_tin_itid.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itid/javacard/cre_tin_itid.cap new file mode 100644 index 0000000000000000000000000000000000000000..9f44ec5034f9c17be6ac1af2f23d52443b44f107 GIT binary patch literal 4552 zcmb7HYj6`)6h8aNv!RqyAhZ;DQwStYn+mp7CiJ1TjSWp*<9*b5mp0n~V3s#}o(QC9-6V9P7DPA_;Q-(<5sQjnkLC^g#hZ+8M5D7E>5srsYO zU%#jRtJu5+7d-9e-I_C&s%_m5B|c$3n=pS$e(yi)Z!l#aEW7au)cxJ_=Tz5@^{lq( z8|(0Kg(JrucGW(qdDPnS;^D5fJ8U0+y}#)E{M^Xw0W_O{z=FCOX0 zSkN=Gc-!#q&X>AR1m+C8!c9Lo=uZQr%;htJ->@cNglFKPc!X%4hc-uljk-E~Wr8kAWnH#^p~|5W+nGqKs* zfA-KX*gpS7f8cNH#uix0Loml{){=WARNC zK!XCnj!UTxEg)IS8&$fxOnf7fic;%#xlBA4;7u+k@8?V|KUdDXz2$D+U1?h4T;X&% z{gtMNIAH*WiSxCujh=TuenCXO^VXUg z562UW3}iB5rzxO7E$*VRt4!R*U{|Zy|5~VT2FsuR1Lk5ck$X|(tw4^?8{nN@-tO~x$do8>>J#XdXgMs*N}y5H zN_@xN2UJjl-s^Eipd>Oz0Zqne3XG(`Ins}93j0|x(K+{R&_9SsL`*0$iF%xY0AZ-a ztpPbJ0eV4;Apym!Xb7q)ZBP~6yQbgXcA;0yDQD;2w>l7vi2UWVaeTF}l8{otaaz$P_911Om|C4<){HK>$X_^ysio7vAuJ&dW3 z0#qZQCJIoCfH6spR09kW0ZP`kE8op|LbIaA2quw>fvdD}-dZ#6@lYcz(nvQWwqzp*>X#eFV=oc;rc1c0A|K{F zx6ex!M1!e=9iKR32Iv(^R>vx16xtYFUn~3&J8YrrCj5jJiI5>@tS}2q+C6!$!y>1Gs~W(Mht80b^V*(WFC~B~hAX zsA&jmu8C-pz>{dQA8R z8Vw@0?HX&?E$mHe~C+|>!s+@`dmPF z;P#e>E~?h02BfvPVBka9287C7iY_g$1#|}^m%dPJOVOpJvw+?u8$FWiBZaiohP3Jx zY&?xSM&1JCL~39uxU_r~z~eEZ<$(*utQ1{Z3kvAtvBH;!E~yNqCZsi=U}A@C6Osy0 xYC>Az2__OSdCT)cT<%FNNb4ZMLNT5UaxH|bB730%JqJ8Ebim;bu?-?`{{pk(eUbnG literal 0 HcmV?d00001 diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_1.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_1.java new file mode 100644 index 0000000..53d3c1c --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_1.java @@ -0,0 +1,77 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itpo_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itpo ; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.*; +import uicc.test.util.* ; + + + +public class Cre_Tin_Itpo_1 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '1', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itpo_1() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance + Cre_Tin_Itpo_1 thisApplet = new Cre_Tin_Itpo_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + menuInit [5] = (byte) '2'; + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + menuInit [5] = (byte) '3'; + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + menuInit [5] = (byte) '4'; + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + // Get the envelope handler + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + if (event == EVENT_MENU_SELECTION) + { + switch (envHdlr.getItemIdentifier()) + { + case (byte)1: + obReg.disableMenuEntry((byte)1); + break; + case (byte)2: + obReg.enableMenuEntry((byte)1); + break; + } + } + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_2.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_2.java new file mode 100644 index 0000000..aa764e3 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_2.java @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itpo_2.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itpo ; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Itpo_2 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '2', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itpo_2() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + // Create a new applet instance + Cre_Tin_Itpo_2 thisApplet = new Cre_Tin_Itpo_2(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_3.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_3.java new file mode 100644 index 0000000..0a8c9eb --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_3.java @@ -0,0 +1,56 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itpo_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itpo ; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Itpo_3 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '3', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itpo_3() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Itpo_3 thisApplet = new Cre_Tin_Itpo_3(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + menuInit [5] = (byte) '2'; + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_4.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_4.java new file mode 100644 index 0000000..61b184b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_4.java @@ -0,0 +1,53 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itid_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itpo; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Itpo_4 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '4', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itpo_4() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Itpo_4 thisApplet = new Cre_Tin_Itpo_4(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE */ + public void processToolkit(short event) + { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_5.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_5.java new file mode 100644 index 0000000..f296b52 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_5.java @@ -0,0 +1,53 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itid_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itpo; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Itpo_5 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '5', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itpo_5() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Itpo_5 thisApplet = new Cre_Tin_Itpo_5(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE */ + public void processToolkit(short event) + { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_6.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_6.java new file mode 100644 index 0000000..c6ebd55 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Cre_Tin_Itpo_6.java @@ -0,0 +1,57 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Itid_3.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itpo; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.test.util.* ; + + + +public class Cre_Tin_Itpo_6 extends TestToolkitApplet +{ + static byte [] menuInit = {(byte) 'M', (byte) 'e', (byte) 'n', (byte) 'u', (byte) '6', (byte) '1'}; + + /** + * Constructor of the applet + */ + public Cre_Tin_Itpo_6() + { + } + + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + // Create a new applet instance + Cre_Tin_Itpo_6 thisApplet = new Cre_Tin_Itpo_6(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + // toolkit registration + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + menuInit [5] = (byte) '2'; + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + menuInit [5] = (byte) '3'; + thisApplet.obReg.initMenuEntry(menuInit, (short) 0, (short) 6, (byte) 0, false, (byte) 0, (short) 0); + } + + + /** + * Method called by the UICC CRE */ + public void processToolkit(short event) + { + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Test_Cre_Tin_Itpo.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Test_Cre_Tin_Itpo.java new file mode 100644 index 0000000..c56443b --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/Test_Cre_Tin_Itpo.java @@ -0,0 +1,517 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_itpo; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Itpo extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_itpo"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + static final String CLASS_AID_2 = "A0000000 090005FF FFFFFF89 50020001"; + static final String APPLET_AID_2 = "A0000000 090005FF FFFFFF89 50020102"; + static final String CLASS_AID_3 = "A0000000 090005FF FFFFFF89 50030001"; + static final String APPLET_AID_3 = "A0000000 090005FF FFFFFF89 50030102"; + static final String CLASS_AID_4 = "A0000000 090005FF FFFFFF89 50040001"; + static final String APPLET_AID_4 = "A0000000 090005FF FFFFFF89 50040102"; + static final String CLASS_AID_5 = "A0000000 090005FF FFFFFF89 50050001"; + static final String APPLET_AID_5 = "A0000000 090005FF FFFFFF89 50050102"; + static final String CLASS_AID_6 = "A0000000 090005FF FFFFFF89 50060001"; + static final String APPLET_AID_6 = "A0000000 090005FF FFFFFF89 50060102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Itpo() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + String[] menuList = new String[12]; + String[] menuIdList = new String[12]; + + // test script + test.reset(); + test.terminalProfileSession("09030020"); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1 */ + /*********************************************************************/ + + // Install Applet1 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "8010" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "04" + // V Maximum number of menu entries + "01" + // V Position of menu entry 1 + "01" + // V Id of menu entry 1 + "02" + // V Position of menu entry 2 + "02" + // V Id of menu entry 2 + "03" + // V Position of menu entry 3 + "03" + // V Id of menu entry 3 + "04" + // V Position of menu entry 4 + "04" + // V Id of menu entry 4 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result = response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu12"; menuIdList[1] = "02"; + menuList[2] = "Menu13"; menuIdList[2] = "03"; + menuList[3] = "Menu14"; menuIdList[3] = "04"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)4, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 2 */ + /*********************************************************************/ + + // Install Applet2 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Position of menu entry 1 + "05" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu12"; menuIdList[1] = "02"; + menuList[2] = "Menu21"; menuIdList[2] = "05"; + menuList[3] = "Menu13"; menuIdList[3] = "03"; + menuList[4] = "Menu14"; menuIdList[4] = "04"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)5, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 3 */ + /*********************************************************************/ + + // Install Applet3 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3, + "800C" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "02" + // V Maximum number of menu entries + "02" + // V Position of menu entry 1 + "06" + // V Id of menu entry 1 + "03" + // V Position of menu entry 2 + "07" + // V Id of menu entry 2 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" + // V Maximum number of services + "8104" + // TLV UICC Access application specific parameters + "00" + // LV UICC File System AID field + "0100" + // LV Access Domain for UICC file system = ALWAYS + "00" ); // LV Access Domain DAP field + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu31"; menuIdList[1] = "06"; + menuList[2] = "Menu32"; menuIdList[2] = "07"; + menuList[3] = "Menu12"; menuIdList[3] = "02"; + menuList[4] = "Menu21"; menuIdList[4] = "05"; + menuList[5] = "Menu13"; menuIdList[5] = "03"; + menuList[6] = "Menu14"; menuIdList[6] = "04"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)7, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Install Applet4 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_4, APPLET_AID_4, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "00" + // V Position of menu entry 1 + "08" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu31"; menuIdList[1] = "06"; + menuList[2] = "Menu32"; menuIdList[2] = "07"; + menuList[3] = "Menu12"; menuIdList[3] = "02"; + menuList[4] = "Menu21"; menuIdList[4] = "05"; + menuList[5] = "Menu13"; menuIdList[5] = "03"; + menuList[6] = "Menu14"; menuIdList[6] = "04"; + menuList[7] = "Menu41"; menuIdList[7] = "08"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)8, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 5 */ + /*********************************************************************/ + + // Install Applet5 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_5, APPLET_AID_5, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "20" + // V Position of menu entry 1 + "09" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu11"; menuIdList[0] = "01"; + menuList[1] = "Menu31"; menuIdList[1] = "06"; + menuList[2] = "Menu32"; menuIdList[2] = "07"; + menuList[3] = "Menu12"; menuIdList[3] = "02"; + menuList[4] = "Menu21"; menuIdList[4] = "05"; + menuList[5] = "Menu13"; menuIdList[5] = "03"; + menuList[6] = "Menu14"; menuIdList[6] = "04"; + menuList[7] = "Menu41"; menuIdList[7] = "08"; + menuList[8] = "Menu51"; menuIdList[8] = "09"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)9, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 6 */ + /*********************************************************************/ + + // Trigger Applet1 + response = test.envelopeMenuSelection("100101",""); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu31"; menuIdList[0] = "06"; + menuList[1] = "Menu32"; menuIdList[1] = "07"; + menuList[2] = "Menu12"; menuIdList[2] = "02"; + menuList[3] = "Menu21"; menuIdList[3] = "05"; + menuList[4] = "Menu13"; menuIdList[4] = "03"; + menuList[5] = "Menu14"; menuIdList[5] = "04"; + menuList[6] = "Menu41"; menuIdList[6] = "08"; + menuList[7] = "Menu51"; menuIdList[7] = "09"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)8, menuIdList, menuList, null, null); + + // Lock Applet2 + response = test.lockApplication(APPLET_AID_2); + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu31"; menuIdList[0] = "06"; + menuList[1] = "Menu32"; menuIdList[1] = "07"; + menuList[2] = "Menu12"; menuIdList[2] = "02"; + menuList[3] = "Menu13"; menuIdList[3] = "03"; + menuList[4] = "Menu14"; menuIdList[4] = "04"; + menuList[5] = "Menu41"; menuIdList[5] = "08"; + menuList[6] = "Menu51"; menuIdList[6] = "09"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)7, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 7 */ + /*********************************************************************/ + + // Install Applet6 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_6, APPLET_AID_6, + "800E" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "03" + // V Maximum number of menu entries + "01" + // V Position of menu entry 1 + "10" + // V Id of menu entry 1 + "04" + // V Position of menu entry 2 + "11" + // V Id of menu entry 2 + "15" + // V Position of menu entry 3 + "12" + // V Id of menu entry 3 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu61"; menuIdList[0] = "10"; + menuList[1] = "Menu31"; menuIdList[1] = "06"; + menuList[2] = "Menu62"; menuIdList[2] = "11"; + menuList[3] = "Menu32"; menuIdList[3] = "07"; + menuList[4] = "Menu12"; menuIdList[4] = "02"; + menuList[5] = "Menu13"; menuIdList[5] = "03"; + menuList[6] = "Menu14"; menuIdList[6] = "04"; + menuList[7] = "Menu41"; menuIdList[7] = "08"; + menuList[8] = "Menu51"; menuIdList[8] = "09"; + menuList[9] = "Menu63"; menuIdList[9] = "12"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)10, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 8 */ + /*********************************************************************/ + + // Trigger Applet1 + response = test.envelopeMenuSelection("100102",""); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu61"; menuIdList[0] = "10"; + menuList[1] = "Menu11"; menuIdList[1] = "01"; + menuList[2] = "Menu31"; menuIdList[2] = "06"; + menuList[3] = "Menu62"; menuIdList[3] = "11"; + menuList[4] = "Menu32"; menuIdList[4] = "07"; + menuList[5] = "Menu12"; menuIdList[5] = "02"; + menuList[6] = "Menu13"; menuIdList[6] = "03"; + menuList[7] = "Menu14"; menuIdList[7] = "04"; + menuList[8] = "Menu41"; menuIdList[8] = "08"; + menuList[9] = "Menu51"; menuIdList[9] = "09"; + menuList[10] = "Menu63"; menuIdList[10] = "12"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)11, menuIdList, menuList, null, null); + + // Unlock Applet2 + response = test.unlockApplication(APPLET_AID_2); + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu61"; menuIdList[0] = "10"; + menuList[1] = "Menu11"; menuIdList[1] = "01"; + menuList[2] = "Menu31"; menuIdList[2] = "06"; + menuList[3] = "Menu62"; menuIdList[3] = "11"; + menuList[4] = "Menu32"; menuIdList[4] = "07"; + menuList[5] = "Menu12"; menuIdList[5] = "02"; + menuList[6] = "Menu21"; menuIdList[6] = "05"; + menuList[7] = "Menu13"; menuIdList[7] = "03"; + menuList[8] = "Menu14"; menuIdList[8] = "04"; + menuList[9] = "Menu41"; menuIdList[9] = "08"; + menuList[10] = "Menu51"; menuIdList[10] = "09"; + menuList[11] = "Menu63"; menuIdList[11] = "12"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)12, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 9 */ + /*********************************************************************/ + + // Delete Applet2 + response = test.deleteApplet(APPLET_AID_2); + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu61"; menuIdList[0] = "10"; + menuList[1] = "Menu11"; menuIdList[1] = "01"; + menuList[2] = "Menu31"; menuIdList[2] = "06"; + menuList[3] = "Menu62"; menuIdList[3] = "11"; + menuList[4] = "Menu32"; menuIdList[4] = "07"; + menuList[5] = "Menu12"; menuIdList[5] = "02"; + menuList[6] = "Menu13"; menuIdList[6] = "03"; + menuList[7] = "Menu14"; menuIdList[7] = "04"; + menuList[8] = "Menu41"; menuIdList[8] = "08"; + menuList[9] = "Menu51"; menuIdList[9] = "09"; + menuList[10] = "Menu63"; menuIdList[10] = "12"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)11, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 10 */ + /*********************************************************************/ + + // Install Applet2 + response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2, + "800A" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "10" + // V Maximum text length for a menu entry + "01" + // V Maximum number of menu entries + "03" + // V Position of menu entry 1 + "05" + // V Id of menu entry 1 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Send a status command to be sure to retrieve the correct status word in the RAPDU + response = test.status("00","0C","00"); + result &= response.getStatusWord().substring(0,2).compareTo("91") == 0; + // Fetch & Terminal response + menuList[0] = "Menu61"; menuIdList[0] = "10"; + menuList[1] = "Menu11"; menuIdList[1] = "01"; + menuList[2] = "Menu21"; menuIdList[2] = "05"; + menuList[3] = "Menu31"; menuIdList[3] = "06"; + menuList[4] = "Menu62"; menuIdList[4] = "11"; + menuList[5] = "Menu32"; menuIdList[5] = "07"; + menuList[6] = "Menu12"; menuIdList[6] = "02"; + menuList[7] = "Menu13"; menuIdList[7] = "03"; + menuList[8] = "Menu14"; menuIdList[8] = "04"; + menuList[9] = "Menu41"; menuIdList[9] = "08"; + menuList[10] = "Menu51"; menuIdList[10] = "09"; + menuList[11] = "Menu63"; menuIdList[11] = "12"; + result &= fetchSetUpMenu("UICC TEST", null, (byte)12, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deleteApplet(APPLET_AID_2); + test.deleteApplet(APPLET_AID_3); + test.deleteApplet(APPLET_AID_4); + test.deleteApplet(APPLET_AID_5); + test.deleteApplet(APPLET_AID_6); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } + + // Fetch a sepUpMenu command, check it according to the parameters + // and send the Terminal Response. + // Return true if the recieved command correspond to the one rebuild using + // the paramaters + private boolean fetchSetUpMenu( + String alphaId, // AlphaId TLV Value + String alphaIdTextAtt, // AlphaId Text Attribute TLV Value + byte nbMenu, // Number of menus + String[] menuId, // Menu Id List table + String[] menu, // Text Menu List table (in readable text!) + String nextActionTLV, // Next Action List TLV + String itemTextAttListTLV) // Item Text Attribute List TLV + { + boolean result; + String setUpMenuCmd = ""; + String endOfCmd = ""; + String Cmd = ""; + + // Build the Set Up Menu + if (nextActionTLV != null) + { + endOfCmd = nextActionTLV; + } + if (alphaIdTextAtt != null) + { + endOfCmd += "50" + ToString((byte)(alphaIdTextAtt.length()/2)) + alphaIdTextAtt; + } + if (itemTextAttListTLV != null) + { + endOfCmd += itemTextAttListTLV; + } + + String menuItem = ""; + String menuList = ""; + for (byte i = 0; i < nbMenu; i++) + { + menuItem = menuId[i]; + menuItem += ByteToString(menu[i].getBytes()); + menuList += "8F" + ToString((byte)(menuItem.length()/2)) + menuItem; + } + Cmd = menuList + endOfCmd; + + String alpId = ByteToString(alphaId.getBytes()); + setUpMenuCmd = "85" + ToString((byte)(alpId.length()/2)) + alpId; + setUpMenuCmd += Cmd; + Cmd = setUpMenuCmd; + setUpMenuCmd = "810301250082028182" + Cmd; + Cmd = setUpMenuCmd; + if ((Cmd.length()/2) > 0x7F) + { + setUpMenuCmd = "D081" + ToString((byte)(Cmd.length()/2)) + Cmd; + } + else + { + setUpMenuCmd = "D0" + ToString((byte)(Cmd.length()/2)) + Cmd; + } + + response = test.fetch(ToString((byte)(setUpMenuCmd.length()/2))); + result = response.checkData(setUpMenuCmd); + + test.terminalResponse("81030125 00820282 81830100"); + + return result; + } + + private String ByteToString( byte tab[] ) + { + byte[] tab2; + byte c; + int i, j, k; + + j = tab.length; + tab2 = new byte[ j*2]; + + k = 0; + for ( i=0; i>4)&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + + c = (byte)(tab[ i ]&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + } + + return new String( tab2 ); + } + + // byte => String + private String ToString( byte myByte ) + { + byte[] tab; + byte c; + int i, j, k; + + tab = new byte[1]; + tab[0] = myByte; + + return ByteToString( tab ); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/applet.opt new file mode 100644 index 0000000..6d81e9d --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/applet.opt @@ -0,0 +1,9 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x04:0x00:0x01 uicc.test.catre.cre_tin_itpo.Cre_Tin_Itpo_4 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_itpo.Cre_Tin_Itpo_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x03:0x00:0x01 uicc.test.catre.cre_tin_itpo.Cre_Tin_Itpo_3 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_itpo.Cre_Tin_Itpo_1 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x05:0x00:0x01 uicc.test.catre.cre_tin_itpo.Cre_Tin_Itpo_5 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x06:0x00:0x01 uicc.test.catre.cre_tin_itpo.Cre_Tin_Itpo_6 +uicc.test.catre.cre_tin_itpo +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/javacard/cre_tin_itpo.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_itpo/javacard/cre_tin_itpo.cap new file mode 100644 index 0000000000000000000000000000000000000000..4151c7d9d51ff388aa6696adfb278eedce2495a1 GIT binary patch literal 6472 zcmb7IeNa@_6+iFoCo9SdD7b)ve8`8ee7aT>1^I}487jmyen1v@=*qIY?yjgXF%c%V zHbTs3f}PgZbif!UMx!P(PNuCRnK4yU?X)wthUgznbTpHesck3IR_X7)-F4r4S?IFM z<=uDQ`%|)mJ^f zLUiiL_nm$D#>;oAzn$~a_`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ex_E_SourceCode/uicc/test/catre/cre_tin_mlme/Cre_Tin_Mlme_1.java new file mode 100644 index 0000000..c1be655 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/Cre_Tin_Mlme_1.java @@ -0,0 +1,316 @@ +//----------------------------------------------------------------------------- +// Cre_Tin_Mlme_1.java +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_mlme; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import uicc.toolkit.* ; +import uicc.test.util.* ; + + + +public class Cre_Tin_Mlme_1 extends TestToolkitApplet +{ + + private static byte [] MenuEntry1 = + {(byte) 'M', + (byte) 'e', + (byte) 'n', + (byte) 'u', + (byte) 'E', + (byte) 'n', + (byte) 't', + (byte) 'r', + (byte) 'y', + (byte) '1'}; + + private static byte [] MenuEntry2 = + {(byte) 'M', + (byte) 'e', + (byte) 'n', + (byte) 'u', + (byte) 'E', + (byte) 'n', + (byte) 't', + (byte) 'r', + (byte) 'y', + (byte) '2'}; + + private static byte [] MenuEntry3 = + {(byte) 'M', + (byte) 'e', + (byte) 'n', + (byte) 'u', + (byte) 'E', + (byte) 'n', + (byte) 't', + (byte) 'r', + (byte) 'y', + (byte) '3'}; + + private static byte [] MenuEntry03 = + {(byte) 'M', + (byte) 'e', + (byte) 'n', + (byte) 'u', + (byte) 'E', + (byte) 'n', + (byte) 't', + (byte) 'r', + (byte) 'y', + (byte) '0', + (byte) '3'}; + + private static byte [] MenuEntry4 = + {(byte) 'M', + (byte) 'e', + (byte) 'n', + (byte) 'u', + (byte) 'E', + (byte) 'n', + (byte) 't', + (byte) 'r', + (byte) 'y', + (byte) '4'}; + + private static byte [] MenuEntry05 = + {(byte) 'M', + (byte) 'e', + (byte) 'n', + (byte) 'u', + (byte) 'E', + (byte) 'n', + (byte) 't', + (byte) 'r', + (byte) 'y', + (byte) '0', + (byte) '5'}; + + private byte result = (byte) 0; + + private byte testCaseNb = (byte)5; + + + + /** + * Constructor of the applet + */ + public Cre_Tin_Mlme_1() + { + } + + /** + * Method called by the JCRE at the installation of the applet + */ + public static void install(byte bArray[], short bOffset, byte bLength) + { + + + // Create a new applet instance + Cre_Tin_Mlme_1 thisApplet = new Cre_Tin_Mlme_1(); + + // Register the new applet instance to the JCRE + thisApplet.register(bArray, (short)(bOffset+1), bArray[bOffset]); + + // Initialise the data of the test applet + thisApplet.init(); + + boolean bRes = true; + + // ----------------------------------------------------------------- + // Test Case 1 : 1- initMenuEntry()with parameters: + // MenuEntry = MenuEntry1 + // Offset = 0 + // Length = MenuEntry1.length + // NextAction = 0 + // HelpSupported = false + // IconQualifier = 0 + // IconIdentifier = 0 + // No exception shall be thrown + // ----------------------------------------------------------------- + thisApplet.testCaseNb = (byte) 1; + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry1, (short) 0, + (short)MenuEntry1.length, (byte) 0, false, (byte) 0, (short) 0); + bRes = true; + } + + catch (Exception e) { + bRes = false; + } + + // ----------------------------------------------------------------- + // 2- initMenuEntry()with parameters: + // MenuEntry = MenuEntry2 + // Offset = 0 + // Length = MenuEntry2.length + // NextAction = 0 + // HelpSupported = false + // IconQualifier = 0 + // IconIdentifier = 0 + // No exception shall be thrown + // ----------------------------------------------------------------- + + if (bRes == true) { + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry2, (short) 0, + (short)MenuEntry2.length, (byte) 0, false, (byte) 0, (short) 0); + } + + catch (Exception e) { + bRes = false; + } + } + + thisApplet.reportTestOutcome(thisApplet.testCaseNb, bRes) ; + + // ----------------------------------------------------------------- + // Test Case 2 : 1- initMenuEntry()with parameters: + // MenuEntry = MenuEntry03 + // Offset = 0 + // Length = MenuEntry03.length + // NextAction = 0 + // HelpSupported = false + // IconQualifier = 0 + // IconIdentifier = 0 + // Shall throw a ToolkitException.ALLOWED_LENGTH_EXCEEDED + // ----------------------------------------------------------------- + + thisApplet.testCaseNb = (byte)2; + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry03, (short) 0, + (short)MenuEntry03.length, (byte) 0, false, (byte) 0, (short) 0); + bRes = false; + } + + catch (ToolkitException e) { + bRes = (e.getReason() == ToolkitException.ALLOWED_LENGTH_EXCEEDED); + } + + catch (Exception e) { + bRes = false; + } + + thisApplet.reportTestOutcome(thisApplet.testCaseNb, bRes) ; + + // ----------------------------------------------------------------- + // Test Case 3 : 1- initMenuEntry()with parameters: + // MenuEntry = MenuEntry3 + // Offset = 0 + // Length = MenuEntry3.length + // NextAction = 0 + // HelpSupported = false + // IconQualifier = 0 + // IconIdentifier = 0 + // No exception shall be thrown + // ----------------------------------------------------------------- + + thisApplet.testCaseNb = (byte)3; + try { + thisApplet.result = thisApplet.obReg.initMenuEntry(MenuEntry3, (byte) 0, + (short)MenuEntry3.length, (byte) 0, false, (byte) 0, (short) 0); + bRes = true; + } + + catch (Exception e) { + bRes = false; + } + + thisApplet.reportTestOutcome(thisApplet.testCaseNb, bRes) ; + } + + + + /** + * Method called by the UICC CRE + */ + public void processToolkit(short event) + { + boolean bRes = true; + + + if (event == EVENT_MENU_SELECTION) { + EnvelopeHandler envHdlr = EnvelopeHandlerSystem.getTheHandler(); + + switch (envHdlr.getItemIdentifier()) + { + case (byte)1: + // ----------------------------------------------------------------- + // Test Case 4 : 1- changeMenuEntry()with parameters: + // Id = 1 + // MenuEntry = MenuEntry4 + // Offset = 0 + // Length = MenuEntry4.length + // NextAction = 0 + // HelpSupported = false + // IconQualifier = 0 + // IconIdentifier = 0 + // No exception shall be thrown + // ----------------------------------------------------------------- + + if ( testCaseNb == (byte)3 ) { + + testCaseNb = (byte)4; + try { + obReg.changeMenuEntry((byte)1, MenuEntry4, (short)0, (short)MenuEntry4.length, + (byte) 0, false, (byte) 0, (short) 0); + bRes = true; + } + + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes) ; + + } + break; + case (byte)2: + // ----------------------------------------------------------------- + // Test Case 5 : 1- changeMenuEntry()with parameters: + // Id = 1 + // MenuEntry = MenuEntry05 + // Offset = 0 + // Length = MenuEntry05.length + // NextAction = 0 + // HelpSupported = false + // IconQualifier = 0 + // IconIdentifier = 0 + // Shall throw a ToolkitException.ALLOWED_LENGTH_EXCEEDED + // ----------------------------------------------------------------- + + if ( testCaseNb == (byte)4 ) { + + testCaseNb = (byte)5; + bRes = false; + + try { + obReg.changeMenuEntry((byte)1, MenuEntry05, (short)0, (short)MenuEntry05.length, + (byte) 0, false, (byte) 0, (short) 0); + } + + catch (ToolkitException e) { + if (e.getReason() == ToolkitException.ALLOWED_LENGTH_EXCEEDED) { + bRes = true; + } + } + + catch (Exception e) { + bRes = false; + } + + reportTestOutcome(testCaseNb, bRes) ; + } + break; + } + } + } +} + + diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/Test_Cre_Tin_Mlme.java b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/Test_Cre_Tin_Mlme.java new file mode 100644 index 0000000..071ff0f --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/Test_Cre_Tin_Mlme.java @@ -0,0 +1,212 @@ +//----------------------------------------------------------------------------- +// Package Definition +//----------------------------------------------------------------------------- +package uicc.test.catre.cre_tin_mlme; + +//----------------------------------------------------------------------------- +// Imports +//----------------------------------------------------------------------------- +import org.etsi.scp.wg3.uicc.jcapi.userinterface.*; +import org.etsi.scp.wg3.uicc.jcapi.userclass.*; + +public class Test_Cre_Tin_Mlme extends UiccTestModel { + + static final String CAP_FILE_PATH = "uicc/test/catre/cre_tin_mlme"; + static final String CLASS_AID_1 = "A0000000 090005FF FFFFFF89 50010001"; + static final String APPLET_AID_1 = "A0000000 090005FF FFFFFF89 50010102"; + + private UiccAPITestCardService test; + APDUResponse response; + + + public Test_Cre_Tin_Mlme() { + test = UiccAPITestCardService.getTheUiccTestCardService(); + } + + public boolean run() { + APDUResponse data = null; + boolean result = false; + + String[] menuList = new String[3]; + String[] menuIdList = new String[3]; + + // test script + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + + // Install package + test.loadPackage(CAP_FILE_PATH); + + /*********************************************************************/ + /** Testcase 1-3 */ + /*********************************************************************/ + + // Install Applet1 + test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1, + "800E" + // TLV UICC Toolkit application specific parameters + "FF" + // V Priority Level + "00" + // V Max. number of timers + "0A" + // V Maximum text length for a menu entry + "03" + // V Maximum number of menu entries + "01" + // V Position of menu entry 1 + "01" + // V Id of menu entry 1 + "02" + // V Position of menu entry 2 + "02" + // V Id of menu entry 2 + "03" + // V Position of menu entry 3 + "03" + // V Id of menu entry 3 + "00" + // V Maximum number of channels + "00" + // LV Minimum Security Level field + "00" + // LV TAR Value(s) + "00" ); // V Maximum number of services + + // Card Initialisation + test.reset(); + test.terminalProfile("09030020"); + // Fetch & Terminal response + menuList[0] = "MenuEntry1"; menuIdList[0] = "01"; + menuList[1] = "MenuEntry2"; menuIdList[1] = "02"; + menuList[2] = "MenuEntry3"; menuIdList[2] = "03"; + result = fetchSetUpMenu("UICC TEST", null, (byte)3, menuIdList, menuList, null, null); + + + /*********************************************************************/ + /** Testcase 4 */ + /*********************************************************************/ + + // Trigger Applet1 + test.envelopeMenuSelection("100101",""); + + // Fetch & Terminal response + menuList[0] = "MenuEntry4"; menuIdList[0] = "01"; + menuList[1] = "MenuEntry2"; menuIdList[1] = "02"; + menuList[2] = "MenuEntry3"; menuIdList[2] = "03"; + result = fetchSetUpMenu("UICC TEST", null, (byte)3, menuIdList, menuList, null, null); + + /*********************************************************************/ + /** Testcase 5 */ + /*********************************************************************/ + + // Trigger Applet1 + response = test.envelopeMenuSelection("100102",""); + result &= response.checkSw("9000"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Check Applets */ + /*********************************************************************/ + /*********************************************************************/ + + response = test.selectApplication(APPLET_AID_1); + result &= response.checkData("10" + APPLET_AID_1 + "05" + "CCCCCCCC CC"); + + + /*********************************************************************/ + /*********************************************************************/ + /** Restore card */ + /*********************************************************************/ + /*********************************************************************/ + + test.reset(); + test.terminalProfileSession(UiccCardManagementService.DEFAULT_TERMINAL_PROFILE); + // delete applets and package + test.deleteApplet(APPLET_AID_1); + test.deletePackage(CAP_FILE_PATH); + + + return result; + } + + // Fetch a sepUpMenu command, check it according to the parameters + // and send the Terminal Response. + // Return true if the recieved command correspond to the one rebuild using + // the paramaters + private boolean fetchSetUpMenu( + String alphaId, // AlphaId TLV Value + String alphaIdTextAtt, // AlphaId Text Attribute TLV Value + byte nbMenu, // Number of menus + String[] menuId, // Menu Id List table + String[] menu, // Text Menu List table (in readable text!) + String nextActionTLV, // Next Action List TLV + String itemTextAttListTLV) // Item Text Attribute List TLV + { + boolean result; + String setUpMenuCmd = ""; + String endOfCmd = ""; + String Cmd = ""; + + // Build the Set Up Menu + if (nextActionTLV != null) + { + endOfCmd = nextActionTLV; + } + if (alphaIdTextAtt != null) + { + endOfCmd += "50" + ToString((byte)(alphaIdTextAtt.length()/2)) + alphaIdTextAtt; + } + if (itemTextAttListTLV != null) + { + endOfCmd += itemTextAttListTLV; + } + + String menuItem = ""; + String menuList = ""; + for (byte i = 0; i < nbMenu; i++) + { + menuItem = menuId[i]; + menuItem += ByteToString(menu[i].getBytes()); + menuList += "8F" + ToString((byte)(menuItem.length()/2)) + menuItem; + } + Cmd = menuList + endOfCmd; + + String alpId = ByteToString(alphaId.getBytes()); + setUpMenuCmd = "85" + ToString((byte)(alpId.length()/2)) + alpId; + setUpMenuCmd += Cmd; + Cmd = setUpMenuCmd; + setUpMenuCmd = "810301250082028182" + Cmd; + Cmd = setUpMenuCmd; + setUpMenuCmd = "D0" + ToString((byte)(Cmd.length()/2)) + Cmd; + + response = test.fetch(ToString((byte)(setUpMenuCmd.length()/2))); + result = response.checkData(setUpMenuCmd); + + test.terminalResponse("81030125 00820282 81830100"); + + return result; + } + + private String ByteToString( byte tab[] ) + { + byte[] tab2; + byte c; + int i, j, k; + + j = tab.length; + tab2 = new byte[ j*2]; + + k = 0; + for ( i=0; i>4)&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + + c = (byte)(tab[ i ]&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + } + + return new String( tab2 ); + } + + // byte => String + private String ToString( byte myByte ) + { + byte[] tab; + byte c; + int i, j, k; + + tab = new byte[1]; + tab[0] = myByte; + + return ByteToString( tab ); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/applet.opt new file mode 100644 index 0000000..332c432 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/applet.opt @@ -0,0 +1,4 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_mlme.Cre_Tin_Mlme_1 +uicc.test.catre.cre_tin_mlme +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/javacard/cre_tin_mlme.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_mlme/javacard/cre_tin_mlme.cap new file mode 100644 index 0000000000000000000000000000000000000000..1ad045d37863562cfa8a7e2426bdfe75f052375b GIT binary patch literal 4852 zcma)932+nF8UEhxN~^;d;VS~!#^yA^SiT52#u#I4e1gFaDTV^Fy~e^qQYG2MCZw`4 zv5A3_W|G!vARNP$4p##q0f&$fI^pP)NtzIjnjSMrN@zneou-{(aQ~HLWbGu3R`ct< zeaH9z@89=dRpq=80}cIdwY5&iuqOrrDvN3grj;%zHdhubC@n6ku1TvbesBpmytvfS zIVa}qOZUcp@p+=UZ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g+kj640S%{8`)@z06WTME)BA1{Mg~yR1YW$Bn zQiu>D1+7ugM(YLb$T9R67pXQ0T0^v;)kTL&wlVcD_BTl?nX-w()8stKUGK6w$(hT7 z>2XYUr5sPW1>eDSYC6S1U(lK%HynJ8;BVCaM&oaE6a!?>~VCArD86+$yim0MJoN$X^7$huW=(o@{KV8pDz=aUcMS#ZN($U7 zGmsQq+~Tp?%rz9^YsjBBTRr}GhUm~8X>zbf{KJsn=(4Pp);V0w=ISPkOS072BqaDj z{V?VLT&dk7xf(6?KQcWOOx#erBzKFA41X?ka>h|;aZ3y8hS@*{xMei=&_XhY^|L}O zXV^sc@QLYA&$8OBp4s42rYwQrX|lR8tsRe`*L5er09ItHKd@o1s}5i5z09u~rmz#1~VIO1Hzkxl9_QBKA5wEhO8;5}OI za2P}Dsl&rWP#SzJP-IP@(Q_&!Vl4gu-rsrM-$|k{Jkme1VrXg>**J)`hxSKd9SIeO zc49Re&k|4qHWSiB^peG8((Wv>{$BE_IoL{RaW1x#_0PtO$R}^H3xz1d9+cy0?8Q&8 zjQYzdX6(lbtil00mKDFHW39zIu%iWM(27plhktjtO8$}vh z$dbtWRxm$bD!MV@ouF{2x=?~Ei-;ij+hKzTO9~~rGC2*RpQU;$Jkb@Ys*;5=pA53F zi{Y|RWS2@7%EU0pLPIV-yi>4)&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + + c = (byte)(tab[ i ]&15); + tab2[ k++ ] = (c>9) ? (byte)(c-10+'A') : (byte)(c+'0'); + } + + return new String( tab2 ); + } + + // byte => String + private String ToString( byte myByte ) + { + byte[] tab; + byte c; + int i, j, k; + + tab = new byte[1]; + tab[0] = myByte; + + return ByteToString( tab ); + } +} diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/applet.opt b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/applet.opt new file mode 100644 index 0000000..b8e1e69 --- /dev/null +++ b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/applet.opt @@ -0,0 +1,5 @@ +-out EXP CAP JCA +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x02:0x00:0x01 uicc.test.catre.cre_tin_nbme.Cre_Tin_Nbme_2 +-applet 0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x01:0x00:0x01 uicc.test.catre.cre_tin_nbme.Cre_Tin_Nbme_1 +uicc.test.catre.cre_tin_nbme +0xa0:0x00:0x00:0x00:0x09:0x00:0x05:0xff:0xff:0xff:0xff:0x89:0x50:0x00:0x00:0x00 1.0 \ No newline at end of file diff --git a/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/javacard/cre_tin_nbme.cap b/source/Annex_E_SourceCode/uicc/test/catre/cre_tin_nbme/javacard/cre_tin_nbme.cap new file mode 100644 index 0000000000000000000000000000000000000000..9794d09068150435b6bcbcc059a01e8478f9c4da GIT binary patch literal 4934 zcmb7H4Nz3q6+Z88cUb`e0YOF3U||zwWd#vYA|M39k0>OHn3&z=Asg4-?c0Z?`^CV#AGty_owAc3u(}oOd{1+HkVDPX{a*Smo?N>RW>!})mMFWn&`)y zTiw2i$=!dhxij>o{?Y4?erEaaiEZD?yRgl1?1@i4_@H2z=kH1P{`1(0Az8kb7aiT( zcbr*Px_4Rn=e0|*%+q$&92aA)sjHTbXoRT?y_0Cr+Q+MsV*|z;(uO z>tf+EZ+?-Gc6!aV+jF+;zxG9Q`MJ%1**jMG;f)0K`o?RcN*3JhN^;p+{aMZpVI63H|^Q+hw<-nx+Oy0?&PQU->W=ky7Skech0U6f3WNDz4z0$ zR9rvX9%tHn-*Mo{pI=O!eth%P-M<`f9Qy3~@-^n0ACLci;+}P}X@@U8w{H8#NwY7! z_`Gjf-^tut`Cr~m`}9_^`AD1dR~3i$_fOb$ujCii9akRx=Togkw~x-M%sZ8NtS