pax_global_header 0000666 0000000 0000000 00000000064 14061656526 0014525 g ustar 00root root 0000000 0000000 52 comment=5b4c752ed8e1f4a833990b5f99986f92656c4011
ts-102-268-uicc-api-testspec-REL-6.2.0/ 0000775 0000000 0000000 00000000000 14061656526 0016735 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/LICENSE 0000664 0000000 0000000 00000002704 14061656526 0017745 0 ustar 00root root 0000000 0000000 Copyright 2021 ETSI
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
ts-102-268-uicc-api-testspec-REL-6.2.0/README.md 0000664 0000000 0000000 00000000116 14061656526 0020212 0 ustar 00root root 0000000 0000000 # Draft TS 102 268 UICC API Test spec
## Licensing information
See LICENSE.
ts-102-268-uicc-api-testspec-REL-6.2.0/source/ 0000775 0000000 0000000 00000000000 14061656526 0020235 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_Example/ 0000775 0000000 0000000 00000000000 14061656526 0023224 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_Example/uicc/ 0000775 0000000 0000000 00000000000 14061656526 0024147 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_Example/uicc/test/ 0000775 0000000 0000000 00000000000 14061656526 0025126 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_Example/uicc/test/example/ 0000775 0000000 0000000 00000000000 14061656526 0026561 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_Example/uicc/test/example/uicc_example/ 0000775 0000000 0000000 00000000000 14061656526 0031217 5 ustar 00root root 0000000 0000000 Test_uicc_example.java 0000664 0000000 0000000 00000010655 14061656526 0035447 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_Example/uicc/test/example/uicc_example //-----------------------------------------------------------------------------
// 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;
}
}
ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/ 0000775 0000000 0000000 00000000000 14061656526 0024520 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/ 0000775 0000000 0000000 00000000000 14061656526 0025307 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/ 0000775 0000000 0000000 00000000000 14061656526 0026253 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/ 0000775 0000000 0000000 00000000000 14061656526 0027040 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/ 0000775 0000000 0000000 00000000000 14061656526 0027540 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/ 0000775 0000000 0000000 00000000000 14061656526 0030463 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/ 0000775 0000000 0000000 00000000000 14061656526 0031551 5 ustar 00root root 0000000 0000000 userclass/ 0000775 0000000 0000000 00000000000 14061656526 0033476 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi UiccAPITestCardService.java 0000664 0000000 0000000 00000001350 14061656526 0040530 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass /**
* @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;
}
}
}
UiccTestModel.java 0000664 0000000 0000000 00000002422 14061656526 0037045 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userclass /**
* @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();
/**
* Initialises the results, removing all previous results.
*/
protected final void initialiseResults()
{
UiccAPITestCardService.getTheUiccTestCardService().initialiseResults();
}
/**
* Adds a new result.
*/
protected final void addResult(boolean result)
{
UiccAPITestCardService.getTheUiccTestCardService().addResult(result);
}
/**
* Returns the overall result, based on all results submitted via {@link #addResult(boolean)}
* since the last call to {@link #initialiseResults()}.
*
* The following logic is used:
*
* - if no results have been submitted,
false
will be returned;
* - if any
false
results have been submitted, false
will be returned;
* - otherwise,
true
will be returned.
*
*/
protected final boolean getOverallResult()
{
return UiccAPITestCardService.getTheUiccTestCardService().getOverallResult();
}
}
userinterface/ 0000775 0000000 0000000 00000000000 14061656526 0034331 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi APDUResponse.java 0000664 0000000 0000000 00000001573 14061656526 0037452 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface /**
* @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);
}
UiccAdministrativeCommandsService.java 0000664 0000000 0000000 00000002753 14061656526 0043775 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface /**
* @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);
}
UiccApplicationManagementService.java 0000664 0000000 0000000 00000006201 14061656526 0043560 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface /**
* @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);
}
UiccCardManagementService.java 0000664 0000000 0000000 00000021404 14061656526 0042170 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface /**
* @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);
}
UiccResultsService.java 0000664 0000000 0000000 00000001603 14061656526 0040762 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface package org.etsi.scp.wg3.uicc.jcapi.userinterface;
/**
* A service to allow results to be reported.
*/
public interface UiccResultsService
{
/**
* Initialises the results, removing all previous results.
*/
public void initialiseResults();
/**
* Adds a new result.
*/
public void addResult(boolean result);
/**
* Returns the overall result, based on all results submitted via {@link #addResult(boolean)}
* since the last call to {@link #initialiseResults()}.
*
* The following logic is used:
*
* - if no results have been submitted,
false
will be returned;
* - if any
false
results have been submitted, false
will be returned;
* - otherwise,
true
will be returned.
*
*/
public boolean getOverallResult();
}
UiccToolkitService.java 0000664 0000000 0000000 00000015325 14061656526 0040754 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccInterfaces/org/etsi/scp/wg3/uicc/jcapi/userinterface /**
* @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();
}
ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/ 0000775 0000000 0000000 00000000000 14061656526 0024212 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/ 0000775 0000000 0000000 00000000000 14061656526 0025135 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/test/ 0000775 0000000 0000000 00000000000 14061656526 0026114 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/test/util/ 0000775 0000000 0000000 00000000000 14061656526 0027071 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/test/util/LoadUtil.java 0000664 0000000 0000000 00000002026 14061656526 0031451 0 ustar 00root root 0000000 0000000 //-----------------------------------------------------------------------------
// 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);
}
} TestToolkitApplet.java 0000664 0000000 0000000 00000010372 14061656526 0033313 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/test/util //-----------------------------------------------------------------------------
// 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);
}
}
}
TestToolkitApplet.opt 0000664 0000000 0000000 00000000217 14061656526 0033171 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/test/util -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 UICCTestConstants.java 0000664 0000000 0000000 00000011757 14061656526 0033150 0 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/test/util 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};
}
ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/test/util/javacard/ 0000775 0000000 0000000 00000000000 14061656526 0030644 5 ustar 00root root 0000000 0000000 ts-102-268-uicc-api-testspec-REL-6.2.0/source/Annex_D_UiccTestUtil/uicc/test/util/javacard/util.cap 0000664 0000000 0000000 00000005424 14061656526 0032313 0 ustar 00root root 0000000 0000000 PK `R;5 META-INF/MANIFEST.MF ]O0?KhnNH0b#zi4%}0v;}yۅTeEQ*0NQVǽpO*3XH徬0-aEΫLQ@hTQ]<˭$1ERF_r$$tGeJ[%ȳ-M:ߪAOErzt}ݚ$:LmW_U6ú<~Jc,`濄ӾC
2Y)c ~
fvLpJ'C'jRl*^?g+Zl+?QGsD/_,zrw)ۿ궺PK1= t PK
`R;5 " uicc/test/util/javacard/Header.cap PK
`R;5ve" " % uicc/test/util/javacard/Directory.cap ( J *[
$
PK
`R;5t?i+ + " uicc/test/util/javacard/Import.cap ( b b PK
`R;5̦M M ( uicc/test/util/javacard/ConstantPool.cap J
PK
`R;5b- - ! uicc/test/util/javacard/Class.cap *C D i Q
PK
`R;5T-z^ ^ " uicc/test/util/javacard/Method.cap[ z m 8 ;z0gkww08`
8p8z
`2 ; %%AA %A
%A
pm z@ =8=8=8=8= 8=8=8=8=8= 8=
8=8=8=
8=8=8=8=8=8=8= 8=8=8=8=8= 8=
8=8=8=
8=8=8zPK
`R;5kط
' uicc/test/util/javacard/StaticField.cap
PK
`R;5' ' ' uicc/test/util/javacard/RefLocation.cap $
mU -
PK
`R;5[$ " uicc/test/util/javacard/Export.cap
PK
`R;5 &