pyecsca.sca.target.leia module

Provides a smartcard target communicating via the LEIA board in solo mode.

class LEIATarget(leia)[source]

Bases: ISO7816Target

Smartcard target communicating via LEIA in solo mode.

property atr: bytes

Return the ATR (Answer To Reset) of the target.

property card_present: bool
select(aid)[source]

Select an applet with aid.

Parameters:

aid (bytes) – The AID of the applet to select.

Return type:

bool

Returns:

Whether the selection was successful.

send_apdu(apdu)[source]

Send an APDU to the selected applet.

Parameters:

apdu (CommandAPDU) – The APDU to send.

Return type:

ResponseAPDU

Returns:

The response.

connect(protocol=None)[source]

Connect to the card.

Parameters:

protocol (Optional[CardProtocol]) – CardProtocol to use.

disconnect()[source]

Disconnect from the target device.