How to load CAP file to java card

半腔热情 提交于 2019-12-20 07:49:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!