Connection Property
Connection
The object that represents the connection to the YubiKey. Most applications can ignore this, but it can be used to call command classes and send APDUs directly to the YubiKey during advanced scenarios.
public IYubiKeyConnection Connection { get; }
Property Value
Type | Description |
---|---|
IYubiKeyConnection |
Remarks
Most common FIDO2 operations can be done using the various methods contained on the Fido2Session class. There are some cases where you will need to issue a very specific command that is otherwise not available to you using the session's methods.
This property gives you direct access to the existing connection to the YubiKey using the
IYubiKeyConnection interface. To send your own commands, call the
SendCommand<TResponse>(IYubiKeyCommand<TResponse>) method like in the following example:
using (var fido2 = new Fido2Session(yubiKey))
{
var command = new ClientPinCommand(){ /* Set properties to your needs */ }; }
// Sends a command to the FIDO2 application
var response = fido2.Connection.SendCommand(command);
/* Read and handle the response */