How to load CAP file to java card

前端 未结 2 2073
南旧
南旧 2021-01-26 02:02

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.

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-26 02:13

    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 ""
    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  -sdAID  -nvCodeLimit 0
    load -file your.cap
    install_for_install -AID  -pkgAID  -instAID 
    

    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).

提交回复
热议问题