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 |
---|---|
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. */
}