yubikit.core.fido

Attributes

FidoConnection

Classes

SmartCardCtapDevice

CTAP-capable device.

Module Contents

yubikit.core.fido.FidoConnection
class yubikit.core.fido.SmartCardCtapDevice(connection, scp_key_params=None)[source]

Bases: fido2.ctap.CtapDevice

CTAP-capable device.

Subclasses of this should implement call(), as well as list_devices(), which should return a generator over discoverable devices.

Parameters:
protocol
property capabilities: fido2.hid.CAPABILITY

Get device capabilities

Return type:

fido2.hid.CAPABILITY

close()[source]

Close the device, releasing any held resources.

Return type:

None

call(cmd, data=b'', event=None, on_keepalive=None)[source]

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:

bytes

classmethod list_devices()[source]

Generates instances of cls for discoverable devices.

Return type:

Iterator[fido2.ctap.CtapDevice]