Table of Contents

YubiHSM Auth session APIs

The high level YubiHSM Auth session APIs provide a simpler way to work with the YubiHSM Auth application on the YubiKey. The YubiHSM Auth session API is a layer built on the lower level command API. Session APIs help perform YubiHSM Auth scenarios in a shorter amount of development time and without getting involved with each command's details.

For more information on the YubiHSM Auth application and commands, see YubiHSM Auth Overview.

A guide for creating a secure session with a YubiHSM 2 device is covered in Interacting with a YubiHSM 2

YubiHsmAuthSession

To perform YubiHSM Auth operations, first select the IYubiKeyDevice you would like to use. Next, create an instance of the YubiHsmAuthSession class using that device. During the lifetime of that session, you can use the session APIs as a simple way to work with the YubiHSM Auth application on the YubiKey.

// use the first YubiKey found
var yubiKeyToUse = YubiKeyDevice.FindAll().First();
using (var YubiHsmAuthSession = new YubiHsmAuthSession(yubiKeyToUse))
{
    // call session methods
}
Note

For more information on connecting to a YubiKey with the YubiKeyDevice class, please see the SDK programming guide.

Methods

Clicking on the method will bring you to the API documentation where more information can be found.

Method Description Try-Parse version
Add credential Add a credential. Try add credential
Change management key Change the management key. Try change management key
Delete credential Delete a credential. Try delete credential
Get AES-128 session keys Calculate session keys from an AES-128 credential. These session keys are used to establish a secure session with a YubiHSM 2 device. n/a
Get application version Get the version of the YubiHSM Auth application returned as a major, minor, and patch value. n/a
Get management key retries Get the number of retries remaining for the management key. n/a
List credentials Get the public properties of all credentials in the YubiHSM Auth application, along with the number of retries remaining for each. n/a
Reset application Reset the YubiHSM Auth application, which will delete all credentials and set the management key to its default value (all zeros). n/a