tomasz-lisowski / swsim

A software SIM card.
BSD 3-Clause "New" or "Revised" License
300 stars 34 forks source link

How can i install my own applet on this? #14

Closed annu0412 closed 4 months ago

tomasz-lisowski commented 5 months ago

swSIM doesn't support applets right now. For applet installation/management you need the Global Platform-defined instructions as well a card JVM but neither is present.

If you are willing to write your code in such a way that it could be executed from C, it is quite easy to extend swSIM to run any arbitrary code. It requires you to add an APDU handler function into src/apduh.c (like apduh_gsm_bin_update for example) and then add your function into the APDU DEMUX (sim_apduh_demux inside src/apduh.c). This will allow your code to receive APDU data whenever the terminal sends a CLA and INS that matches what you added in the DEMUX.