SDKs
...
Tutorials
Advanced Usage
Hardware Key Usage
3min
licensespring allows users to bind licenses to a yubikey hardware key dongle prerequisites make sure to set up a yubikey on the licensespring platform and the licensespring provisioning application for desktop see hardware key licensing docid\ twasrtinmfw7pb0qewr6a for instructions c++ platform specific library placement since c++ sdk v7 37 0 , we provide both licensespring sdk libs that do link, and that don't link to libykpiv all samples also have multiple configurations, with and without linking to libykpiv linux & macos shared libraries are located in bin/shared hardwarekey static libraries are located in bin/static hardwarekey note the existing bin/shared and bin/static folders remain unchanged and do not link to libykpiv linux arm (i e arm without hf support), ppc64le sdk builds targeting arm and ppc64le architectures do not link tl libykpiv (no hardware key support) msvc (windows) dynamic libraries are located in bin/dynamic hardwarekey static linking to libykpiv is not supported the existing bin/dynamic folder remains unchanged and does not link to libykpiv mingw we currently don't support hardware the libykpiv library has an external dependency which should be installed on user machines • linux uses the pcsc backend (via pcsclite) to manage the yubikey, 	• macos uses the macscard backend (apple’s built‑in pc/sc layer, pcsclite daemon), 	• windows (msvc targets) uses the winscard backend (microsoft’s winscard api) usage samples \#include \<licensespring/configuration h> \#include \<licensespring/extendedoptions h> // // the following function returns an std vector of all plugged yubikeys' serials auto serials = licensespring hardwarekeyoptions listavailablekeys(); if (!serials empty()) { hardwarekeyoptions hwkeyoptions; hwkeyoptions settargetserial(serials\[0]); // query the user for the correct serial hwkeyoptions setpin("123456"); // query the user for the pin extendedoptions options; options sethardwarekeyoptions(hwkeyoptions); } java identityprovider identityprovider = config getidentityprovider(); string key = identityprovider getkey(); calling extendedoptions sethardwarekeyoptions automatically sets the machine hardware id to the serial of the yubikey afterwards, all calls to the license api require that yubikey to be plugged in, and license localcheck will throw an appropriate licensespring hardwarekeyexception exception in case the yubikey is not plugged in