licel / jcardsim

https://jcardsim.org
224 stars 123 forks source link

CAP files simulation & Security domain #152

Open Aiosa opened 4 years ago

Aiosa commented 4 years ago

Hello,

1) is it possible to simulate CAP file applets through cli/virtual reader?

I tried following:

com.licel.jcardsim.card.applet.0.Class=JCMemory.JCMemoryApplet
; -- and
com.licel.jcardsim.card.applet.0.Class=JCMemory.javacard.Applet
; -- and
com.licel.jcardsim.card.applet.0.Class=javacard.Applet

while providing the .cap file in the classpath. Tried both cli

Unable to execute demo.apdu due to: null

and BixVReader

Exception in thread "main" javacard.framework.SystemException at javacard.framework.SystemException.throwIt(SystemException.java:87) at com.licel.jcardsim.base.Simulator.loadApplet(Simulator.java:113) at com.licel.jcardsim.base.Simulator.(Simulator.java:80) at com.licel.jcardsim.remote.BixVReaderCard.(BixVReaderCard.java:35) at com.licel.jcardsim.remote.BixVReaderCard.main(BixVReaderCard.java:73)

in all the cases. The helloworld demo works.


2) Also, I tried to

use the simulated card with some manager tools (gppro) and got 0x6999 ``` SCardConnect("Fabio Ottavi Pipe SmartCard Virtual Reader 0", T=*) -> T=1, 3BFA18 00008131FE454A434F5033315632333298 SCardBeginTransaction("Fabio Ottavi Pipe SmartCard Virtual Reader 0") Reader: Fabio Ottavi Pipe SmartCard Virtual Reader 0 ATR: 3BFA1800008131FE454A434F5033315632333298 More information about your card: http://smartcard-atr.appspot.com/parse?ATR=3BFA1800008131FE454A434F503331563 2333298 A>> T=1 (4+0000) 00A40400 00 A<< (0000+2) (1ms) 6999 Could not SELECT default selected: 0x6999 ```

on selecting the SD applet -- does the card have "security domain" - emulate the functionality along with SD - AID (A00..0030000... etc.) ?

Thanks a lot!

Aiosa commented 4 years ago

ok, 2) seems to be part of the GlobalPlatform commercial module

dogtopus commented 4 years ago

IIRC jcardsim "links" with the javacard applet source code instead of being a full javacard VM. So no execution of CAP files.