ykman.pcsc
Attributes
Exceptions
Raised when the caller cancels an operation. |
Classes
Create a collection of name/value pairs. |
|
YubiKey device reference, with optional PID |
|
A connection to a YubiKey |
|
YubiKey Smart card device |
Functions
|
Package Contents
- class ykman.pcsc.REINSERT_STATUS(*args, **kwds)[source]
Bases:
enum.Enum
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- REMOVE = 1
- REINSERT = 2
- exception ykman.pcsc.CancelledException[source]
Bases:
Exception
Raised when the caller cancels an operation.
- class ykman.pcsc.YkmanDevice(transport, fingerprint, pid)[source]
Bases:
yubikit.core.YubiKeyDevice
YubiKey device reference, with optional PID
- Parameters:
transport (yubikit.core.TRANSPORT)
fingerprint (Hashable)
pid (yubikit.core.PID | None)
- property pid: yubikit.core.PID | None
Return the PID of the YubiKey, if available.
- Return type:
yubikit.core.PID | None
- reinsert(reinsert_cb=None, event=None)[source]
Wait for the user to remove and reinsert the YubiKey.
This may be required to perform certain operations, such as FIDO reset.
This method will attempt to verify that the same YubiKey is reinserted, but it will only fail when this is definitely not the case (eg. if the serial number does not match).
- Parameters:
reinsert_cb (Callable[[REINSERT_STATUS], None] | None) – Callback to indicate the the YubiKey has been removed,
event (threading.Event | None)
- Return type:
None
and should be reinserted. :param event: Optional event to cancel (throws CancelledException).
- ykman.pcsc.YK_READER_NAME = 'yubico yubikey'
- class ykman.pcsc.ScardSmartCardConnection(connection)[source]
Bases:
yubikit.core.smartcard.SmartCardConnection
A connection to a YubiKey
- connection
- property transport
Get the transport type of the connection (USB or NFC)