FindByTransport Method
FindByTransport(Transport)
Enumerate YubiKeys over the given transports.
public static IEnumerable<IYubiKeyDevice> FindByTransport(Transport transport)
Parameters
Type | Name | Description |
---|---|---|
Transport | transport | Argument controls which devices are searched for. Values None will result in exceptions being thrown. FindAll() is a convenience function to find All. |
Returns
A collection of YubiKeys that were found, as IYubiKeyDevices.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
System.UnauthorizedAccessException | Thrown when attempting to find YubiKeys for the transport
|
Remarks
This method will exclude any connection (SmartCard, HidFido, HidKeyboard) that did not successfully respond to a request for its Firmware Version. This means that there may be fewer IYubiKeys returned than expected, or that some IYubiKeys are missing an expected connection.
To the host device, a single YubiKey can appear as multiple devices. This method will attempt to match these devices back together into a single IYubiKeyDevice using their serial number. If they cannot be matched, each connection will be returned as a separate IYubiKeyDevice.
If your application no longer needs to watch for insertion or removal notifications, you can call StopListening() to release resources and avoid the logging and other actions from the listeners.