Site Tools


Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcre: Client Applet B Obtains the Shareable Interface Object

1. To access applet A's object O, applet B creates an object reference SIO of type SI.

2. Applet B invokes a special method (JCSystem.getAppletShareableInterfaceObject, described in Section, JCSystem.getAppletShareableInterfaceObject Method) to request a shared interface object reference from applet A.

3. Applet A receives the request and the AID of the requester (B) via Applet.getShareableInterfaceObject, and determines whether it will share object O with applet B. A's implementation of the getShareableInterfaceObject method executes in A's context.

4. If applet A agrees to share with applet B, A responds to the request with a reference to O. As this reference is returned as type Shareable, none of the fields or methods of O are visible.

5. Applet B receives the object reference from applet A, casts it to the interface type SI, and stores it in object reference variable SIO. Even though SIO actually refers to A's object O, SIO is an interface of type SI. Only the shareable interface methods defined in SI are visible to B. The firewall prevents the other fields and methods of O from being accessed by B.

In this sequence, applet B initiates communication with applet A using the special system method in the JCSystem class to request a Shareable Interface Object from applet A. Once this communication is established, applet B can obtain other Shareable Interface Objects from applet A using normal parameter passing and return mechanisms. It can also continue to use the special JCSystem method described above to obtain other Shareable Interface Objects.

javacard/jcre/ · Last modified: 2017/05/13 04:06 (external edit)