OathSession Constructor
OathSession(IYubiKeyDevice)
Create an instance of OathSession
class, the object that represents
the OATH application on the YubiKey.
C#
public OathSession(IYubiKeyDevice yubiKey)
Parameters
Type | Name | Description |
---|---|---|
IYubiKeyDevice | yubiKey | The object that represents the actual YubiKey which will perform the operations. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.InvalidOperationException | The |
Remarks
Because this class implements IDisposable
, use the using
keyword.
For example,
IYubiKeyDevice yubiKeyToUse = SelectYubiKey();
using (var oath = new OathSession(yubiKeyToUse))
{
/* Perform OATH operations. */
}