B Annex - Application Management
A subset of GlobalPlatform Card Specification 2.3.1 [GPCS] is implemented by the simulator to support application management.
More precisely, the Simulator implements the subset defined in the GlobalPlatform Common Implementation Configuration 2.1. This includes loading CAP files, creating and deleting applet instances, and deleting packages. The following section describes the GPCS features implemented by the Simulator.
Refer to the following publications for more information about GlobalPlatform specifications. See the GlobalPlatform website.
- GlobalPlatform Card Specification v2.3.1
- GlobalPlatform Secure Channel Protocol ‘03’ – Amendment D v1.2
- GlobalPlatform Card API (org.globalplatform) v1.6
- GlobalPlatform Card Specification v2.3 Amendment H, Executable Load File Upgrade v1.1
- GlobalPlatform Upgrade API (org.globalplatform.upgrade) v1.1
Mapping of GlobalPlatform terminology to Java Card Simulator terminology:
Table B-1 Mapping terminology
| GlobalPlatform | Java Card |
|---|---|
| Card Content Management | Application Management |
| Executable Load File (ELF) | CAP File |
| Executable Module | Package |
| Application | Applet |
Before you can run the Simulator with the GP functionality, ensure that the initial Issuer Security Domain (ISD) keys and the Global PIN are configured correctly using the Configurator tool. Refer to the Installation section for additional information and instructions.
The Issuer Identification Number (IIN) and Card Image Number (CIN) are set to default values but can be configured through the command line when launching the Simulator. For instructions, refer to the Java Card Development Kit Simulator Command Line section.
Supported GlobalPlatform Features
The ISD with the default AID defined by (GPCS) is the default selected applet after the start of the Simulator.
The ISD implements the secure channel protocol SCP03 with option i=’70’ specified in GP Amendment D. This implementation supports initial AES keys of length 128, 192 or 256 bit length. The initial keyset can be configured with the Configurator tool, please refer to the Configuring the Java Card Development Kit Simulator section of this document for the configuration of the keyset. The keys can be updated using STORE DATA or PUT KEY commands. Supplementary Security Domains (SSDs) can be installed and granted privileges (e.g., AM and DM). Additional hierarchies can be established if an SSD has the AM privilege and is extradited to itself. The SSDs are implementing SCP03 with a configurable option ‘i’ (including S16 mode). The Security Domains can allocate up to 250 bytes for the Data Store.
All the card lifecycle states specified in (GPCS) are supported. The Simulator is in lifecycle state OP_READY after the installation of the Simulator. It is possible to change the lifecycle state according to the rules defined in (GPCS). The ISD is in lifecycle state PERSONALIZED after the installation of the Simulator.
Privileges Supported by the Implementation
| Privilege | Can be assigned to | Details |
|---|---|---|
| Security Domain | ISD, SSD | N/A |
| DAP Verification | ISD, SSD | AES scheme, RSA scheme Variant 1 and Variant 2, ECC scheme |
| Delegated Management | SSD | N/A |
| Card Lock | ISD, SSD, Application | N/A |
| Card Terminate | ISD, SSD, Application | N.A |
| Card Reset | ISD, SSD, Application | N.A |
| CVM Management | ISD, SSD, Application | N/A |
| Mandated DAP Verification | ISD, SSD | Same as DAP Verification |
| Trusted Path | ISD, SSD, Application | N/A |
| Authorized Management | ISD, SSD | N/A |
| Token Verification | ISD, SSD | AES scheme, RSA scheme Variant 1 and Variant 2, ECC scheme |
| Global Delete | ISD, SSD | N/A |
| Global Lock | ISD, SSD | N/A |
| Global Registry | ISD, SSD, Application | N/A |
| Final Application | ISD, SSD, Application | N/A |
| Global Service | ISD, SSD, Application | N/A |
| Receipt Generation | ISD, SSD | AES scheme. |
| Ciphered Load File Data Block | ISD, SSD | AES scheme, Initial Chaining Vector (ICV) |
| Contactless Activation | Not supported | N/A |
| Contactless Self Activation | Not supported | N/A |
The SDs support the following APDU commands. Refer to GPCS for details of each command.
Supported APDU Commands
DELETE
The DELETE command is used to delete applet instances and packages.
GET DATA
The GET DATA command is used to retrieve a single or a set of BER-TLV-coded objects. The ISD supports the following objects identified by their TAG:
- TAG ‘42’: Issuer Identification Number (IIN)
- IIN can be configured with the
-iin=<hexstring>command-line option when starting the Simulator.
- IIN can be configured with the
- TAG ‘45’ Card Image Number (CIN)
- CIN can be configured with the
-cin=<hexstring>command-line option when starting the Simulator.
- CIN can be configured with the
- TAG ‘66’ Card Data
- TAG ‘E0’ Key Information Template
- TAG ‘67’ Card Capability Information
- TAG ‘C1’ Sequence Counter of the default Key Version Number
- TAG ‘D3’ Current Security Level
- TAG ‘CF’ Key derivation data tag
- TAG ‘2F00’ List of applications
GET STATUS
The GET STATUS command is used to retrieve ISD, CAP file, package and applet status information.
INSTALL
The INSTALL command is used to initiate and perform the various steps of the Card Content management defined in the (GPCS).
GP Command chaining is supported for INSTALL with these limitations:
- chaining is not supported for INSTALL [for personalization]
- The APDU command data is limited to 256 bytes excluding security and token.
The following command data fields are supported. Refer to GPCS for details of these fields:
INSTALL [for load]- Supports tag ‘EF’ sub tags: ‘C6’, ‘C7’, ‘C8’ and tag ‘B6’
INSTALL [for install]- Supports tag ‘C9’, tag ‘EF’ sub tags: ‘C7’, ‘C8’, ‘CB’, ‘CF’, ‘D7’, ‘D8’ and tag ‘B6’
INSTALL [for make selectable]INSTALL [for personalization]INSTALL [install and make selectable]- Supports tag ‘C9’, tag ‘EF’ sub tags: ‘C7’, ‘C8’, ‘CB’, ‘CF’, ‘D7’, ‘D8’ and tag ‘B6’
INSTALL[for extradition]- Supports tag ‘B6’
INSTALL[for registry update]- Supports tag ‘EF’ sub tags: ‘CB’, ‘CF’, ‘D9’ and tag ‘B6’
LOAD
The LOAD command is used to load a CAP file (compact as well as extended format) into the Simulator. A CAP file is usually loaded with multiple LOAD commands with a sequential numbering as described in (GPCS). Load File Data Block Hash (LFDBH) algorithms that are supported are SHA-1, SHA-256, SHA-384 and SHA-512.
MANAGE CHANNEL
This command is used to open and close logical channels. The Simulator’s -lcEncoding=<type> command-line option selects the APDU logical channel encoding. The default value, type4type16, supports 20 logical channels (0–19): the basic channel (0) and 19 supplementary channels (1–19). This value is used when the option is omitted or when the Simulator is started with -lcEncoding=type4type16. When started with -lcEncoding=type4, the Simulator supports four logical channels (0–3): the basic channel (0) and three supplementary channels (1–3). See Java Card Development Kit Simulator Command Line for details about this option.
The processing of the MANAGE CHANNEL command follows the rules described in the JCRE specification and in the (GPCS).
MANAGE ELF UPGRADE
The MANAGE ELF UPGRADE command manages a CAP File upgrade session through START, RESUME, RECOVERY, ABORT, and STATUS operations, as defined in Amendment H. The supported capabilities, behavior, and implementation limitations are described below.
- CAP File Upgrade Support and Behavior
- Multiple CAP File upgrades are supported in one session.
- APDU command chaining is supported for
MANAGE ELF UPGRADE. - Both Compact CAP Files and Extended CAP Files are supported.
- During the Saving Phase, applets can save null references, primitive arrays, objects from supported Java Card platform API classes, and
ElementorMappedElementobjects. - Array Views cannot be saved.
- The Simulator processes deletions in the order of the corresponding
STARTrequests. Off-card requests must therefore be ordered so that each deletion is permitted when processed. - Static Resources associated with an old CAP File are deleted during its deletion sequence. They are not automatically migrated to the new CAP File.
- Limitations
- Arrays of object references cannot be saved.
- When using APDU command chaining for
MANAGE ELF UPGRADE, the maximum accumulated command-data size is 768 bytes, including secure-messaging overhead. - The “Automatically resume after power loss” option is ignored. Do not rely on resuming a CAP File upgrade after interruption of the Simulator.
SELECT
The SELECT command is used for selecting an Applet or a Security Domain (SD). The processing of the SELECT command follows the rules described in the JCRE specification and in the (GPCS).
SET STATUS
The SET STATUS command can be used to manage the card lifecycle state or the application life cycle state.
PUT KEY
The PUT KEY command can be used for key loading. GP Command chaining is supported with a maximum of three consecutive APDUs.
STORE DATA
The STORE DATA command is used to transfer data to an Applet or the ISD. If an Applet wants to receive these data, it has to use the mechanism described in the GlobalPlatform API. The Simulator supports key loading for the ISD or SSDs with the STORE DATA command. The command can be used to change the default Secure Channel Key Set.
GlobalPlatform API
The Simulator implements the GlobalPlatform API v. 1.6 (org.globalplatform). The documentation and the export files are available on the GlobalPlatform website. Refer to the link at the beginning of this chapter. The entire package is available in the Simulator but not all services are enabled. The following interfaces are not implemented:
- HTTPAdministration
- HTTPReportListener
- Authority
GlobalPlatform Upgrade API
The Simulator provides the GlobalPlatform Upgrade API v1.1 (org.globalplatform.upgrade).