pyecsca.sca.target.PCSC module

Provides a smartcard target communicating via PC/SC (Personal Computer/Smart Card).

class pyecsca.sca.target.PCSC.PCSCTarget(reader)[source]

Bases: ISO7816Target

Smartcard target communicating via PCSC.

connect(protocol=None)[source]

Connect to the card.

Parameters:

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

property atr: bytes

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

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.

disconnect()[source]

Disconnect from the target device.