Show / Hide Table of Contents

TryConnect Method

TryConnect(YubiKeyApplication, out IYubiKeyConnection)

Attempt to connect to the YubiKey device.

C#
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

bool

Boolean indicating whether the call was successful.

TryConnect(byte[], out IYubiKeyConnection)

Attempt to connect to the YubiKey device.

C#
bool TryConnect(byte[] applicationId, out IYubiKeyConnection connection)

Parameters

Type Name Description
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

bool

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

C#
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

bool

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

C#
bool TryConnect(byte[] applicationId, ScpKeyParameters keyParameters, out IScpYubiKeyConnection connection)

Parameters

Type Name Description
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

bool

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.

In this article
Back to top Generated by DocFX