问题
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.
回答1:
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).
回答2:
You should use cap2cmd.jar That .jar file convert cap file into the LOAD APDU command.
Regards,
来源:https://stackoverflow.com/questions/19651128/how-to-load-cap-file-to-java-card