sendAPDU

Sends an Application Protocol Data Unit (APDU) command to the smart card.

This function transmits the provided APDU command to the smart card currently interacting with the Contact interface and returns the card's response.

Return

A String containing the response APDU received from the card. This response usually includes a status word (SW1, SW2) and may contain response data.

Parameters

apdu

A ByteArray representing the APDU command to be sent to the card. This typically includes fields like CLA, INS, P1, P2, Lc (if present), Data (if present), and Le (if present).

Throws

if an error occurs during the APDU exchange, such as a communication failure or an error reported by the card.