Upon receiving a MANAGE CHANNEL OPEN command on an I/O interface, the Java Card RE shall run the following procedure:
1. The MANAGE CHANNEL OPEN command uses: CLA=%b000000cc* (where cc in the bits (b2,b1) denotes the origin logical channel: 0-3), or CLA=%0100dddd* (where dddd in the bits (b4-b1) denote the origin logical channel: 4-19), INS=0x70 and P1=0. Two variants of this command are supported:
2. If the origin logical channel on that I/O interface is not open, the Java Card RE responds with status code 0x6881 (SW_LOGICAL_CHANNEL_NOT_SUPPORTED).
3. If the Java Card RE supports only the basic logical channel on that I/O interface, the Java Card RE responds with status code 0x6881 (SW_LOGICAL_CHANNEL_NOT_SUPPORTED).
4. If the P2=0 variant is used:
5. If the P2 != 0 variant is used:
If resources for the specified logical channel are not available or the logical channel is already open, the Java Card RE responds with status code 0x6A86 (SW_INCORRECT_P1P2).
6. The new logical channel on the I/O interface that received the MANAGE CHANNEL OPEN command is now open. This logical channel will be the assigned channel for the applet instance that will be selected on it.
7. Determine the applet instance to be selected on the new logical channel.
8. If the candidate applet instance is not a multiselectable applet (as defined in Section 4.2, Multiselectable Applets) and the candidate applet's context is active, the Java Card RE shall close the new logical channel. The Java Card RE responds with status code 0x6985 (SW_CONDITIONS_NOT_SATISFIED).
9. Assign the CLEAR_ON_DESELECT transient memory segment for the new logical channel:
10. Check whether the candidate applet instance accepts selection:
11. The Java Card RE responds with status code 0x9000 (and if the P2=0 variant is used, 1 data byte containing the newly assigned logical channel number.)
Note - Unlike the SELECT FILE commands to select an applet instance, the MANAGE CHANNEL command is never forwarded to the applet instance.