Freigeben über


Channel.Transmit(Byte[]) Method

Definition

Transmit an APDU command (as per ISO/IEC 7816-4) to the Secure Element.

[Android.Runtime.Register("transmit", "([B)[B", "", ApiSince=28)]
public byte[] Transmit (byte[] command);
[<Android.Runtime.Register("transmit", "([B)[B", "", ApiSince=28)>]
member this.Transmit : byte[] -> byte[]

Parameters

command
Byte[]

the APDU command to be transmitted, as a byte array.

Returns

Byte[]

the response received, as a byte array. The returned byte array contains the data bytes in the following order: [&lt;first data byte&gt;, ..., &lt;last data byte&gt;, &lt;sw1&gt;, &lt;sw2&gt;]

Attributes

Remarks

Transmit an APDU command (as per ISO/IEC 7816-4) to the Secure Element. The underlying layers generate as many TPDUs as necessary to transport this APDU. The API shall ensure that all available data returned from Secure Element, including concatenated responses, are retrieved and made available to the calling application. If a warning status code is received the API wont check for further response data but will return all data received so far and the warning status code.<br> The transport part is invisible from the application. The generated response is the response of the APDU which means that all protocols related responses are handled inside the API or the underlying implementation.<br> The transmit method shall support extended length APDU commands independently of the coding within the ATR.<br> For status word '61 XX' the API or underlying implementation shall issue a GET RESPONSE command as specified by ISO 7816-4 standard with LE=XX; for the status word '6C XX', the API or underlying implementation shall reissue the input command with LE=XX. For other status words, the API (or underlying implementation) shall return the complete response including data and status word to the device application. The API (or underlying implementation) shall not handle internally the received status words. The channel shall not be closed even if the Secure Element answered with an error code. The system ensures the synchronization between all the concurrent calls to this method, and that only one APDU will be sent at a time, irrespective of the number of TPDUs that might be required to transport it to the SE. The entire APDU communication to this SE is locked to the APDU.<br> The channel information in the class byte in the APDU will be ignored. The system will add any required information to ensure the APDU is transported on this channel. The only restrictions on the set of commands that can be sent is defined below, the API implementation shall be able to send all other commands: <br> <ul> <li>MANAGE_CHANNEL commands are not allowed.</li> <li>SELECT by DF Name (p1=04) are not allowed.</li> <li>CLA bytes with channel numbers are de-masked.</li> </ul>

Java documentation for android.se.omapi.Channel.transmit(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