Smart Card Solution
User Manual
- R502 Manual
JavaCard API Samples
- Algorithm
Java Card Specification
Knowledge Sharing
Smart Card Solution
User Manual
JavaCard API Samples
Java Card Specification
Knowledge Sharing
Any given object in the Java Card platform's object space has a context and an owner associated with it. When a new object is created, it is associated with the currently active context, but the object is owned by the applet instance within the currently active context when the object is instantiated. An object can be owned by an applet instance, or by the Java Card RE.
Following are the combined rules of context and object ownership within the firewall:
For example, assume that applets A and B are in the same package, and applet C is in another package. A and B therefore belong to the same context: 1. C belongs to a different context: 2. For an illustration of this situation, see FIGURE 6-2.
If context 1 is the currently active context, and a method m1 in an object owned by applet A is invoked, no context switch occurs. If method m1 invokes a method m2 in an object owned by applet B, again no context switch occurs (in spite of the object “owner” change), and no firewall restrictions apply.
However, if the method m2 now calls a method m0 in an object owned by applet C, firewall restrictions apply and, if access is allowed, a context switch shall occur. Upon return to method m2 from the method m0, the context of applet B is restored.
FIGURE 6-2 Context Switching and Object Access
Keep the following points in mind: