The application I am developing needs to emulate cards that exchange information with an external reader through ISO 14443.
I was hoping that a MIDlet could use one of the Connection objects made available by the JSR-257 API or extensions to be able to listen for incoming ISO 14443 APDUs and reply accordingly, thus emulating what a real card would do. However, it seems to me that ISO14443Connection will not work that way, as it doesn't have the means to first receive an APDU then send a reply. All it provides is a method with which the MIDlet will first send an APDU and then receive the reply, thus playing the reader's side.
I have also found about the peer to peer extensions, which have separate methods for sending and receiving data, which allow the phone to play both an initiator (reader) role as a target (card) role. Is this API suited for exchanging data over ISO 14443 with a reader so that the reader thinks it is talking to an ISO 14443 contactless card?
One other alternative I have been thinking -- in case the above doesn't work -- is to write a cardlet that will reside in the internal Secure Element and do the emulation for me. In that case, I would need to download some data to the cardlet to tell it what to do, and then it would emulate the card for me. Now would that be possible?
I have already found the following threads which are related to my problem, but they don't explicitly tell me what I need to know:
Any help welcome.