Reputation: 235
We know that Applet.process() method is calling "between" APDU request and its APDU response, i.e. it can read some incomiung APDU and send some outgoing as a response.
But, can Applet send its own APDU command and get the response? I.e.:
public void process(APDU apdu)
{
...
APDU resp = SomeAPI.someMethod("00A40101FF...");
...
}
Upvotes: 2
Views: 510
Reputation: 656
But, can Applet send its own APDU command and get the response?
The plain answer is NO, you cannot send an APDU for another applet since you does not have access to the command dispatcher. But there is a way to do it, read below.
public void process(APDU apdu) { ... APDU resp = SomeAPI.someMethod("00A40101FF..."); ... }
Anything like this is not possible in java card applet (till latest version 3.0.5u) because here you are storing a reference of APDU object, which a Temporary JCRE Entry Point Objects and its reference cannot be stored.
Now, to achieve the functionality you want. Use a shareable interface object. Obviously, you need to modify the target applet (which you want to call) here. Calling an applet via shareable object will do the context switching for you and you can return to your applet after it.
Refer http://www.oracle.com/technetwork/java/javacard/specs-jsp-136430.html
Upvotes: 2
Reputation: 5333
I assume, that you are not intending to communicate with the target Applet via serial interface, but look for "execute the same functionality as you would do on receiving this APDU".
I have some doubts, whether such an interface exists and don't see the use case for these reasons:
Upvotes: 1