fido2.pcsc
Attributes
Classes
CtapDevice implementation using pyscard (PCSC). |
Module Contents
- fido2.pcsc.AID_FIDO = b'\xa0\x00\x00\x06G/\x00\x01'
- fido2.pcsc.SW_SUCCESS = (144, 0)
- fido2.pcsc.SW_UPDATE = (145, 0)
- fido2.pcsc.SW1_MORE_DATA = 97
- class fido2.pcsc.CtapPcscDevice(connection, name)
Bases:
fido2.ctap.CtapDevice
CtapDevice implementation using pyscard (PCSC).
This class is intended for use with NFC readers.
- Parameters:
connection (smartcard.CardConnection.CardConnection)
name (str)
- use_ext_apdu = False
- connect()
- __repr__()
- property capabilities: fido2.hid.CAPABILITY
Capabilities supported by the device.
- Return type:
fido2.hid.CAPABILITY
- apdu_exchange(apdu, protocol=None)
Exchange data with smart card.
- control_exchange(control_code, control_data=b'')
Sends control sequence to reader’s driver.
- call(cmd, data=b'', event=None, on_keepalive=None)
Sends a command to the authenticator, and reads the response.
- Parameters:
cmd (int) – The integer value of the command.
data (bytes) – The payload of the command.
event (Optional[threading.Event]) – An optional threading.Event which can be used to cancel the invocation.
on_keepalive (Optional[Callable[[fido2.ctap.STATUS], None]]) – An optional callback to handle keep-alive messages from the authenticator. The function is only called once for consecutive keep-alive messages with the same status.
- Returns:
The response from the authenticator.
- Return type:
- close()
Close the device, releasing any held resources.
- Return type:
None
- classmethod list_devices(name='')
Generates instances of cls for discoverable devices.
- Parameters:
name (str)
- Return type:
Iterator[CtapPcscDevice]