SecureElementChannel.Transmit Method

May 11, 2014

Transmit an APDU (Application Protocol Data Unit) command to the Secure Element. The system ensures that only one APDU is sent to the Secure Element at a time.

Namespace:  Microsoft.Phone.SecureElement
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

public byte[] Transmit(
	byte[] command
)

Parameters

command
Type: System.Byte []
The command to be transmitted to the Secure Element. Maximum size, including header, is 261 bytes.

Return Value

Type: System.Byte []
The response APDU from the Secure Element. This has a maximum length of 255 bytes.

ExceptionCondition
IOException

Unable to communicate with the Secure Element.

COMException

Unable to communicate with the Secure Element.

ArgumentException

The length of the command byte array is less than 4 bytes.

-or-

The length of the APDU is not coherent with the length of the command.

InvalidOperationException

The channel is not open and cannot be used.

UnauthorizedAccessException

The command is not allowed.

The returned byte array is the APDU response from the Secure Element. The last two bytes are sw1 and sw2, the status code bytes.

When using the Transmit method, please note the following:

  • The MANAGE_CHANNEL command is not allowed and will throw an exception.

  • SELECT by DF Name commands are not allowed and will throw an exception.

  • CLA bytes with channel numbers are de-masked

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2014 Microsoft