Commits (2)
......@@ -23,7 +23,24 @@ public interface UiccApplicationManagementService {
* @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);
default APDUResponse installApplet(String capFilePath, String classAID, String appAID, String uiccSystemSpecificParameters)
{
return installApplet(capFilePath, classAID, appAID, uiccSystemSpecificParameters, false);
}
/**
* 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
* @param immediate91XXExpected whether the card is expected to return 91XX immediately after this operation.
* If {@code true}, this parameter is intended as a hint when using an SCP such as SCP80,
* to NOT fetch the corresponding proactive command,
* as it is expected to occur subsequently in the test case.
* @return ResponseAPDU Object, corresponding to the GlobalPlatform command response.
*/
APDUResponse installApplet(String capFilePath, String classAID, String appAID, String uiccSystemSpecificParameters, boolean immediate91XXExpected);
/**
* install an applet in installed state
......@@ -40,7 +57,21 @@ public interface UiccApplicationManagementService {
* @param AID of the instance, as String
* @return ResponseAPDU Object, corresponding to the GlobalPlatform command response.
*/
public APDUResponse makeSelectableApplet(String appAID);
default APDUResponse makeSelectableApplet(String appAID)
{
return makeSelectableApplet(appAID, false);
}
/**
* make an applet selectable (install for make selectable)
* @param AID of the instance, as String
* @param immediate91XXExpected whether the card is expected to return 91XX immediately after this operation.
* If {@code true}, this parameter is intended as a hint when using an SCP such as SCP80,
* to NOT fetch the corresponding proactive command,
* as it is expected to occur subsequently in the test case.
* @return ResponseAPDU Object, corresponding to the GlobalPlatform command response.
*/
APDUResponse makeSelectableApplet(String appAID, boolean immediate91XXExpected);
/**
* perform a SelectApplication APDU command
......@@ -56,21 +87,63 @@ public interface UiccApplicationManagementService {
* @param AID of application, as String
* @return ResponseAPDU Object, containing the application response
*/
public APDUResponse lockApplication(String appletAid);
default APDUResponse lockApplication(String appletAid)
{
return lockApplication(appletAid, false);
}
/**
* lock an application
* @param AID of application, as String
* @param immediate91XXExpected whether the card is expected to return 91XX immediately after this operation.
* If {@code true}, this parameter is intended as a hint when using an SCP such as SCP80,
* to NOT fetch the corresponding proactive command,
* as it is expected to occur subsequently in the test case.
* @return ResponseAPDU Object, containing the application response
*/
APDUResponse lockApplication(String appletAid, boolean immediate91XXExpected);
/**
* unlock an application
* @param AID of application, as String
* @return ResponseAPDU Object, containing the application response
*/
default APDUResponse unlockApplication(String appletAid)
{
return unlockApplication(appletAid, false);
}
/**
* unlock an application
* @param AID of application, as String
* @param immediate91XXExpected whether the card is expected to return 91XX immediately after this operation.
* If {@code true}, this parameter is intended as a hint when using an SCP such as SCP80,
* to NOT fetch the corresponding proactive command,
* as it is expected to occur subsequently in the test case.
* @return ResponseAPDU Object, containing the application response
*/
public APDUResponse unlockApplication(String appletAid);
APDUResponse unlockApplication(String appletAid, boolean immediate91XXExpected);
/**
* delete an applet specified by its AID
* @param AID of applet, as String
* @return ResponseAPDU Object
*/
default APDUResponse deleteApplet(String AID)
{
return deleteApplet(AID, false);
}
/**
* delete an applet specified by its AID
* @param AID of applet, as String
* @param immediate91XXExpected whether the card is expected to return 91XX immediately after this operation.
* If {@code true}, this parameter is intended as a hint when using an SCP such as SCP80,
* to NOT fetch the corresponding proactive command,
* as it is expected to occur subsequently in the test case.
* @return ResponseAPDU Object
*/
public APDUResponse deleteApplet(String AID);
APDUResponse deleteApplet(String AID, boolean immediate91XXExpected);
/**
* delete a package specified by its path
......
......@@ -210,6 +210,7 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
/** Testcase 2 */
/*********************************************************************/
// note that we don't want this method to consume any unnecessary 91XX -> true
test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1,
"800A" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -225,7 +226,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
"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
"00", // LV Access Domain DAP field
true);
// Fetch the SetUpMenu with the menus
menuList[0] = "Menu1";
......@@ -238,8 +240,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
/** Testcase 3 */
/*********************************************************************/
// Lock Applet1
test.lockApplication(APPLET_AID_1);
// Lock Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.lockApplication(APPLET_AID_1, true);
// Fetch the SetUpMenu with the menus
menuList[0] = "Menu2";
menuIdList[0] = "02";
......@@ -250,8 +252,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
/** Testcase 4 */
/*********************************************************************/
// Make selectable Applet1
test.unlockApplication(APPLET_AID_1);
// Make selectable Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.unlockApplication(APPLET_AID_1, true);
// Fetch the SetUpMenu with the menus
menuList[0] = "Menu1";
menuIdList[0] = "01";
......@@ -295,8 +297,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
/** Testcase 6 */
/*********************************************************************/
// Lock Applet1
test.lockApplication(APPLET_AID_1);
// Lock Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.lockApplication(APPLET_AID_1, true);
// Fetch SetUpEventList command
response = test.fetch("0D");
addResult(response.checkData("D00B8103 01050082 02818219 00") ||
......@@ -309,8 +311,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
/** Testcase 7 */
/*********************************************************************/
// Make selectable Applet1
test.unlockApplication(APPLET_AID_1);
// Make selectable Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.unlockApplication(APPLET_AID_1, true);
// Fetch SetUpEventList command
response = test.fetch("0F");
addResult(response.checkData("D00D8103 01050082 02818219 020003") ||
......@@ -359,8 +361,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
response = test.terminalResponse("81030105 00820282 81830100");
addResult(response.checkSw("9000"));
// Delete Applet1
test.deleteApplet(APPLET_AID_1);
// Delete Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.deleteApplet(APPLET_AID_1, true);
// Fetch SetUpEventList command
response = test.fetch("0D");
addResult(response.checkData("D00B8103 01050082 02818219 00") ||
......@@ -380,7 +382,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Fetch SetUpEventList command
response = test.fetch("0F");
addResult(response.checkData("D00D8103 01050082 02818219 020003") ||
......@@ -411,8 +414,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
/** Testcase 10 */
/*********************************************************************/
// Lock Applet1
test.lockApplication(APPLET_AID_1);
// Lock Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.lockApplication(APPLET_AID_1, true);
// Fetch Polling Off command
response = test.fetch("0B");
addResult(response.checkData("D0098103 01040082 028182"));
......@@ -424,8 +427,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
/** Testcase 11 */
/*********************************************************************/
// Make selectable Applet1
test.unlockApplication(APPLET_AID_1);
// Make selectable Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.unlockApplication(APPLET_AID_1, true);
// Fetch Poll Interval command
response = test.fetch("0F");
addResult(response.checkData(pollInterCmd));
......@@ -453,8 +456,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
response = test.terminalResponse("81030103 00820282 81830100 84020010");
addResult(response.checkSw("9000"));
// Delete Applet1
test.deleteApplet(APPLET_AID_1);
// Delete Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.deleteApplet(APPLET_AID_1, true);
// Fetch Polling Off command
response = test.fetch("0B");
addResult(response.checkData("D0098103 01040082 028182"));
......@@ -473,7 +476,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Fetch Poll Interval command
response = test.fetch("0F");
addResult(response.checkData(pollInterCmd));
......@@ -686,8 +690,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
response = test.terminalResponse("81030125 00820282 81830100");
addResult(response.checkSw("9000"));
//Lock Applet3 (testcase 14-14)
response = test.lockApplication(APPLET_AID_3);
//Lock Applet3 (testcase 14-14); note that we don't want this method to consume any unnecessary 91XX -> true
response = test.lockApplication(APPLET_AID_3, true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
// Fetch the SetUpMenu
......@@ -703,8 +707,8 @@ public class Test_Cre_Pcs_Spco extends UiccTestModel {
response = test.terminalResponse("81030125 00820282 81830100");
addResult(response.checkSw("9000"));
//Make selectable Applet3 (testcase 14-15)
test.unlockApplication(APPLET_AID_3);
//Make selectable Applet3 (testcase 14-15); note that we don't want this method to consume any unnecessary 91XX -> true
test.unlockApplication(APPLET_AID_3, true);
// Fetch the SetUpMenu
response = test.fetch("30");
addResult(response.checkData("D02E8103 01250082 02818285 09554943" +
......
......@@ -54,8 +54,8 @@ public class Test_Cre_Reg_Evtr extends UiccTestModel {
"00" + // LV TAR Value(s)
"00"); // V Maximum number of services
// test script
response = test.makeSelectableApplet(APPLET_AID_1);
// test script; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.makeSelectableApplet(APPLET_AID_1, true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00", "0C", "00");
addResult(response.checkSw("910F"));
......
......@@ -128,7 +128,7 @@ public class Test_Cre_Tin_Itid extends UiccTestModel {
/** Testcase 4 */
/*********************************************************************/
// Good Install Applet2
// Good Install Applet2; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2,
"800A" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -140,7 +140,8 @@ public class Test_Cre_Tin_Itid extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......@@ -156,7 +157,7 @@ public class Test_Cre_Tin_Itid extends UiccTestModel {
/** Testcase 4 */
/*********************************************************************/
// Good Install Applet3
// Good Install Applet3; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3,
"800A" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -168,7 +169,8 @@ public class Test_Cre_Tin_Itid extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......@@ -185,8 +187,8 @@ public class Test_Cre_Tin_Itid extends UiccTestModel {
/** Testcase 5 */
/*********************************************************************/
// Delete Applet2
response = test.deleteApplet(APPLET_AID_2);
// Delete Applet2; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.deleteApplet(APPLET_AID_2, true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......@@ -197,7 +199,7 @@ public class Test_Cre_Tin_Itid extends UiccTestModel {
menuList[2] = "Menu31"; menuIdList[2] = "81";
fetchSetUpMenu("UICC TEST", null, (byte)3, menuIdList, menuList, null, null);
// Good Install Applet2
// Good Install Applet2; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2,
"800A" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -209,7 +211,8 @@ public class Test_Cre_Tin_Itid extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......
......@@ -51,7 +51,7 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
/** Testcase 1 */
/*********************************************************************/
// Install Applet1
// Install Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1,
"8010" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -69,7 +69,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......@@ -86,7 +87,7 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
/** Testcase 2 */
/*********************************************************************/
// Install Applet2
// Install Applet2; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2,
"800A" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -98,7 +99,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
......@@ -117,7 +119,7 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
/** Testcase 3 */
/*********************************************************************/
// Install Applet3
// Install Applet3; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_3, APPLET_AID_3,
"800C" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -135,7 +137,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
"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
"00", // LV Access Domain DAP field
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......@@ -155,7 +158,7 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
/** Testcase 4 */
/*********************************************************************/
// Install Applet4
// Install Applet4; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_4, APPLET_AID_4,
"800A" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -167,7 +170,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......@@ -188,7 +192,7 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
/** Testcase 5 */
/*********************************************************************/
// Install Applet5
// Install Applet5; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_5, APPLET_AID_5,
"800A" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -200,7 +204,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......@@ -236,8 +241,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
menuList[7] = "Menu51"; menuIdList[7] = "09";
fetchSetUpMenu("UICC TEST", null, (byte)8, menuIdList, menuList, null, null);
// Lock Applet2
response = test.lockApplication(APPLET_AID_2);
// Lock Applet2; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.lockApplication(APPLET_AID_2, true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
addResult(response.getStatusWord().substring(0,2).compareTo("91") == 0);
......@@ -256,7 +261,7 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
/** Testcase 7 */
/*********************************************************************/
// Install Applet6
// Install Applet6; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_6, APPLET_AID_6,
"800E" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -272,7 +277,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......@@ -312,8 +318,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
menuList[10] = "Menu63"; menuIdList[10] = "12";
fetchSetUpMenu("UICC TEST", null, (byte)11, menuIdList, menuList, null, null);
// Unlock Applet2
response = test.unlockApplication(APPLET_AID_2);
// Unlock Applet2; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.unlockApplication(APPLET_AID_2, true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
addResult(response.getStatusWord().substring(0,2).compareTo("91") == 0);
......@@ -337,8 +343,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
/** Testcase 9 */
/*********************************************************************/
// Delete Applet2
response = test.deleteApplet(APPLET_AID_2);
// Delete Applet2; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.deleteApplet(APPLET_AID_2, true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
addResult(response.getStatusWord().substring(0,2).compareTo("91") == 0);
......@@ -361,7 +367,7 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
/** Testcase 10 */
/*********************************************************************/
// Install Applet2
// Install Applet2; note that we don't want this method to consume any unnecessary 91XX -> true
response = test.installApplet(CAP_FILE_PATH, CLASS_AID_2, APPLET_AID_2,
"800A" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -373,7 +379,8 @@ public class Test_Cre_Tin_Itpo extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Send a status command to be sure to retrieve the correct status word in the RAPDU
response = test.status("00","0C","00");
......
......@@ -47,7 +47,7 @@ public class Test_Cre_Tin_Nbme extends UiccTestModel {
/** Testcase 1-2 */
/*********************************************************************/
// Install Applet1
// Install Applet1; note that we don't want this method to consume any unnecessary 91XX -> true
test.installApplet(CAP_FILE_PATH, CLASS_AID_1, APPLET_AID_1,
"800E" + // TLV UICC Toolkit application specific parameters
"FF" + // V Priority Level
......@@ -63,7 +63,8 @@ public class Test_Cre_Tin_Nbme extends UiccTestModel {
"00" + // V Maximum number of channels
"00" + // LV Minimum Security Level field
"00" + // LV TAR Value(s)
"00" ); // V Maximum number of services
"00", // V Maximum number of services
true);
// Fetch & Terminal response
menuList[0] = "Menu1"; menuIdList[0] = "01";
......