0

I am new to java card,Can you help me how to parse Aplet CAP file into the APDU, For installing this CAP file to the card suported GP2.2.

abhi294074
  • 257
  • 1
  • 3
  • 9

2 Answers2

2

You should try using GPShell which will do the work for you. You need to perform a number of GlobalPlatform commands :

  • Install [for load]
  • Load
  • Install [for install and make selectable]

GPshell will do this for you, as well as the security (you need to authenticate with SCP02, in a script that will look like this :

mode_211
enable_trace
establish_context
card_connect -reader "<your reader's PC/SC name here>"
select -AID A0000001510000
open_sc -security 1 -keyind 0 -keyver 32 -enc_key 11111111111111111111111111111111 -mac_key 22222222222222222222222222222222 -kek_key 33333333333333333333333333333333 -scp 2 -scpimpl 21
install_for_load -pkgAID <your package AID here> -sdAID <your SSD here> -nvCodeLimit 0
load -file your.cap
install_for_install -AID <your Application AID> -pkgAID <your package AID> -instAID <your instance AID>

Angle bracket items above should of course be edited in the script above. If the SSD is not defined, you might as well use the ISD's AID (A0000001510000).

Toluene
  • 751
  • 3
  • 9
0

You should use cap2cmd.jar That .jar file convert cap file into the LOAD APDU command.

Regards,

LutfiSeto
  • 1
  • 1