TryConnect Method
TryConnect(YubiKeyApplication, out IYubiKeyConnection)
Attempt to connect to the YubiKey device.
bool TryConnect(YubiKeyApplication application, out IYubiKeyConnection connection)
Parameters
Type | Name | Description |
---|---|---|
YubiKeyApplication | application | The application to reference on the device. |
IYubiKeyConnection | connection | Out parameter containing the IYubiKeyConnection instance. |
Returns
Boolean indicating whether the call was successful.
TryConnect(Byte[], out IYubiKeyConnection)
Attempt to connect to the YubiKey device.
bool TryConnect(byte[] applicationId, out IYubiKeyConnection connection)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | applicationId | A byte array representing the smart card Application ID (AID) for the application to open. |
IYubiKeyConnection | connection | Out parameter containing the IYubiKeyConnection instance. |
Returns
Boolean indicating whether the call was successful.
TryConnect(YubiKeyApplication, ScpKeyParameters, out IScpYubiKeyConnection)
Attempt to connect to the YubiKey device over SCP using the specified ScpKeyParameters
bool TryConnect(YubiKeyApplication application, ScpKeyParameters keyParameters, out IScpYubiKeyConnection connection)
Parameters
Type | Name | Description |
---|---|---|
YubiKeyApplication | application | The application to reference on the device. |
ScpKeyParameters | keyParameters | The ScpKeyParameters key set to use in making an SCP connection. |
IScpYubiKeyConnection | connection | Out parameter containing the IYubiKeyConnection instance. |
Returns
Boolean indicating whether the call was successful.
Remarks
Note that SCP works only with SmartCard applications, namely PIV, OATH, OTP, Security Domain and YubiHsmAuth and OpenPgp. However, SCP03 is supported only on series 5 YubiKeys with firmware version on 5.3 and above. SCP 11 is supported only firmware version 5.7.2 and above.
Note also that the return is an instance of a class that implements IScpYubiKeyConnection which is a "subclass" of IYubiKeyConnection.
TryConnect(Byte[], ScpKeyParameters, out IScpYubiKeyConnection)
Attempt to connect to the YubiKey device over SCP using the specified ScpKeyParameters
bool TryConnect(byte[] applicationId, ScpKeyParameters keyParameters, out IScpYubiKeyConnection connection)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | applicationId | The Iso7816 application ID to use for the connection. |
ScpKeyParameters | keyParameters | The ScpKeyParameters parameters for the SCP connection. |
IScpYubiKeyConnection | connection | The connection to the YubiKey, or null if unable to connect. |
Returns
True if the connection was successful, false otherwise.
Remarks
Note that SCP works only with SmartCard applications, namely PIV, OATH, OTP, Security Domain and YubiHsmAuth and OpenPgp. However, SCP03 is supported only on series 5 YubiKeys with firmware version on 5.3 and above. SCP 11 is supported only firmware version 5.7.2 and above.
Note also that the return is an instance of a class that implements IScpYubiKeyConnection which is a "subclass" of IYubiKeyConnection.