The most common way to use gpshell is a scriptfile. But it is also possible to read the commands from stdin.
- mode_201
-
Set protocol mode to OpenPlatform 2.0.1
- mode_211
-
Set protocol mode to GlobalPlatform 2.1.1
- visa_key_derivation
-
If you have a card which uses the VISA key derivation scheme for the key calculation,
like GemXpresso Pro or some JCOP cards you must set this.
- emv_cps11_key_derivation
-
If you have a card which uses the EMV CPS 1.1 key derivation scheme for the key calculation, like a Sm@rtCafe Expert 3.0 you must set this.
- enable_trace
-
Enable APDU trace
You will see the sent APDUs in clear text. The last two bytes of the
reponse are the response code. A reponse code of 9000 means success,
otherwise the response code indicates an error. This may be OK when
deleting a non existing applet or package.
- enable_timer
-
Enables the logging of the execution time of a command.
- establish_context
-
Establish context
- card_connect
-
-reader readerName
Connect to card in the reader with readerName
- card_connect
-
-readerNumber x
Connect to card in the xth reader in the system
- open_sc
-
-keyind x -keyver x -key xyz -mac_key xyz -enc_key xyz -kek_key xyz -security x -scp x -scpimpl x -keyDerivation x
Open secure channel
For OpenPlatform 2.0.1' card only -keyind -keyver -mac_key and enc_key are necessary.
For GlobalPlatform 2.1.1 cards -scp and -scpimpl should be not necessary to supply. You must also specify -kek_key.
If your card supports a Secure Channel Protocol Implementation with only one base key, specify this key with -key and omit the others.
If you have a card which uses key derivation you must enable the derivation mode with the -keyDerivation option and you must specify with -key the master (mother) key.
-kek_key, -mac_key and -enc_key are not relevant. See the section Options and Key derivation.
- select
-
-AID AID
Select AID instance
- install
-
-file appletFile -priv privilege -sdAID sdAID -AID AIDInPkg -pkgAID packageAID -instAID instanceAID -nvCodeLimit x -nvDataLimit x
Load and installs in one step
The parameters -AID -instAID -pkgAID -nvCodeLimit can be detected automatically and the -AID and -instAID is set to the first applet in appletfile.
For the sdAID the AID selected with the select command is chosen if not given. Otherwise the default Card Manager / Security Issuer Domain AID is chosen. So usually you do not have to pass it.
- install_for_load
-
-pkgAID x -sdAID sdAID -nvCodeLimit y
Install for Load
For the sdAID the AID selected with the select command is chosen if not given. Otherwise the default Card Manager / Security Issuer Domain AID is chosen. So usually you do not have to pass it.
You may need to use this command if the combined install command does not work.
- load
-
-file appletFile
Load applet
You may need to use this command if the combined install command does not work.
- install_for_install
-
-priv privilege -AID AIDInPkg -pkgAID pkgAID -instAID instanceAID -nvDataLimit x
Instantiate applet
You may need to use this command if the combined install command does not work. Or you want to install a preinstalled Security Domain.
- card_disconnect
-
Disconnect card
- get_status
-
-
-element e0
List applets and packages and security domains
-
-element 20
List packages
-
-element 40
List applets or security domains
-
-element 80
List Card Manager / Security Issuer Domain
- release_context
-
Release context
- put_sc_key
-
-keyver 0 -newkeyver 2 -mac_key new_MAC_key -enc_key new_ENC_key -kek_key new_KEK_key -cur_kek current_KEK_key
Add new key set version 2
- put_sc_key
-
-keyver 1 -newkeyver 1 -mac_key new_MAC_key -enc_key new_ENC_key -kek_key new_KEK_key -cur_kek current_KEK_key
Replace key set version 1
- put_dm_keys
-
-keyver 0 -newkeyver 2 -file public_rsa_key_file -pass password -key new_receipt_generation_key
Put delegated management keys for GP 2.1.1 in version 2
- put_dm_keys
-
-keyver 0 -newkeyver 2 -file public_rsa_key_file -pass password -key new_receipt_generation_key -cur_kek current_KEK_key
Put delegated management keys for OP 2.0.1' in version 2
- send_apdu
-
-sc 0 -APDU xxx
Send APDU xxx without secure channel
The APDU is given as hex without spaces and without leadings 0x.
- send_apdu_nostop
-
-sc 0 -APDU xxx
Does not stop in case of an error
The APDU is given as hex without spaces and without leadings 0x.
- get_data
-
-identifier identifier
A GET DATA command returning the data for the given identifier.