Share via


Session.OpenLogicalChannel Method

Definition

Overloads

OpenLogicalChannel(Byte[])

This method is provided to ease the development of mobile application and for compliancy with existing applications.

OpenLogicalChannel(Byte[], SByte)

Open a logical channel with the Secure Element, selecting the Applet represented by the given AID.

OpenLogicalChannel(Byte[])

This method is provided to ease the development of mobile application and for compliancy with existing applications.

[Android.Runtime.Register("openLogicalChannel", "([B)Landroid/se/omapi/Channel;", "", ApiSince=28)]
public Android.SE.Omapi.Channel? OpenLogicalChannel (byte[]? aid);
[<Android.Runtime.Register("openLogicalChannel", "([B)Landroid/se/omapi/Channel;", "", ApiSince=28)>]
member this.OpenLogicalChannel : byte[] -> Android.SE.Omapi.Channel

Parameters

aid
Byte[]

the AID of the Applet to be selected on this channel, as a byte array.

Returns

an instance of Channel. Null if the Secure Element is unable to provide a new logical channel.

Attributes

Remarks

This method is provided to ease the development of mobile application and for compliancy with existing applications. This method is equivalent to openLogicalChannel(aid, P2=0x00)

Java documentation for android.se.omapi.Session.openLogicalChannel(byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

OpenLogicalChannel(Byte[], SByte)

Open a logical channel with the Secure Element, selecting the Applet represented by the given AID.

[Android.Runtime.Register("openLogicalChannel", "([BB)Landroid/se/omapi/Channel;", "", ApiSince=28)]
public Android.SE.Omapi.Channel? OpenLogicalChannel (byte[]? aid, sbyte p2);
[<Android.Runtime.Register("openLogicalChannel", "([BB)Landroid/se/omapi/Channel;", "", ApiSince=28)>]
member this.OpenLogicalChannel : byte[] * sbyte -> Android.SE.Omapi.Channel

Parameters

aid
Byte[]

the AID of the Applet to be selected on this channel, as a byte array.

p2
SByte

the P2 parameter of the SELECT APDU executed on this channel.

Returns

an instance of Channel. Null if the Secure Element is unable to provide a new logical channel.

Attributes

Remarks

Open a logical channel with the Secure Element, selecting the Applet represented by the given AID. If the AID is null, which means no Applet is to be selected on this channel, the default Applet is used. It's up to the Secure Element to choose which logical channel will be used. With previous release (V2.05) it was not possible to set P2 value, this value was always set to '00'.Except for specific needs it is recommended to keep P2 to '00'. It is recommended that the device allows all values for P2, however only the following values are mandatory: '00', '04', '08', '0C'(as defined in [2]) The implementation of the underlying SELECT command within this method shall be based on ISO 7816-4 with following options:

<ul> <li>CLA = '01' to '03', '40 to 4F'</li> <li>INS = 'A4'</li> <li>P1 = '04' (Select by DF name/application identifier)</li> </ul>

The select response data can be retrieved with byte[] getSelectResponse(). The API shall handle received status word as follow. If the status word indicates that the Secure Element was able to open a channel (e.g. status word '90 00' or status words referencing a warning in ISO-7816-4: '62 XX' or '63 XX') the API shall keep the channel opened and the next getSelectResponse() shall return the received status word. Other received status codes indicating that the Secure Element was able not to open a channel shall be considered as an error and the corresponding channel shall not be opened. In case of UICC it is recommended for the API to reject the opening of the logical channel without a specific AID, by always answering null to such a request. The function without P2 as parameter is provided for backwards compatibility and will fall back to a select command with P2=00.

Java documentation for android.se.omapi.Session.openLogicalChannel(byte[], byte).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to