How to load CAP file to java card

前端 未结 2 2041
南旧
南旧 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:05

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

    Regards,

    0 讨论(0)
  • 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 "<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).

    0 讨论(0)
提交回复
热议问题