Show / Hide Table of Contents

OathSession Constructor

OathSession(IYubiKeyDevice, ScpKeyParameters?)

Create an instance of OathSession class, the object that represents the OATH application on the YubiKey.

C#
public OathSession(IYubiKeyDevice yubiKey, ScpKeyParameters? keyParameters = null)

Parameters

Type Name Description
IYubiKeyDevice yubiKey

The object that represents the actual YubiKey which will perform the operations.

ScpKeyParameters keyParameters

If supplied, the parameters used open the SCP connection.

Exceptions

Type Condition
ArgumentNullException

The yubiKey argument is null.

InvalidOperationException

The SelectApplicationData received from the yubiKey is null.

Remarks

Because this class implements IDisposable, use the using keyword. For example,

IYubiKeyDevice yubiKeyToUse = SelectYubiKey();
using (var oath = new OathSession(yubiKeyToUse))
{
    /* Perform OATH operations. */
}
In this article
Back to top Generated by DocFX