Page 1 of 1

Communicate with two applets on the same java card

Posted: Tue Sep 22, 2015 3:18 am
by conliaOdk
I have two applets separately in two different packages on the same java card. And I want to communicate with each applet.

I also know that i can not communicate with the two applets simultaneously .
So I should select the first applet and send APDU to it,
deselect the first applet and select the second one, send APDU to it...

I really wonder to know how to do it properly with logical channels. Is there a method to save my operation flow ? I mean I don't need to select and deselect every time i send APDU.

Re: Communicate with two applets on the same java card

Posted: Thu Sep 24, 2015 1:56 am
by horse dream
You can use MANAGE CHANNEL command(see GP Spec.)to open two logical channel.
Then select the first applet in channel 0 and the second applet in channel 1.
Change reference control parameter to specify to which channel you want to send APDU.

Note: If your two applets in a single package, you must also implement MultiSelectable interface in both applets.