![]() |
LicenseSpring C++ SDK
Easily add Software Licensing to your application
|
Class for managing Hardware Key (YubiKey PIV) specific options. More...
#include <LicenseSpring/ExtendedOptions.h>
Public Member Functions | |
HardwareKeyOptions ()=default | |
Default constructor. Initializes empty target serial and PIN. More... | |
~HardwareKeyOptions ()=default | |
Default destructor. More... | |
void | setTargetSerial (const std::string &serial) |
Sets the serial number of the target YubiKey to be used for signing. More... | |
const std::string & | getTargetSerial () const |
Gets the configured target YubiKey serial number. More... | |
void | setPin (const std::string &pin) |
Sets the PIN required to access the PIV functions on the target YubiKey. More... | |
const std::string & | getPin () const |
Gets the configured PIN for the YubiKey. More... | |
Static Public Member Functions | |
static std::vector< std::string > | ListAvailableKeys () |
Lists the serial numbers of all connected YubiKeys with PIV support. More... | |
Class for managing Hardware Key (YubiKey PIV) specific options.
Allows discovering available keys, selecting a target key by serial, and setting the required PIN. This object should be configured and then passed to ExtendedOptions.
Definition at line 126 of file ExtendedOptions.h.
|
default |
Default constructor. Initializes empty target serial and PIN.
|
default |
Default destructor.
|
static |
Lists the serial numbers of all connected YubiKeys with PIV support.
This method performs necessary initialization and cleanup of the ykpiv library internally.
void LicenseSpring::HardwareKeyOptions::setTargetSerial | ( | const std::string & | serial | ) |
Sets the serial number of the target YubiKey to be used for signing.
The serial number should match one returned by ListAvailableKeys().
serial | The target YubiKey's serial number as a string. |
const std::string& LicenseSpring::HardwareKeyOptions::getTargetSerial | ( | ) | const |
Gets the configured target YubiKey serial number.
void LicenseSpring::HardwareKeyOptions::setPin | ( | const std::string & | pin | ) |
Sets the PIN required to access the PIV functions on the target YubiKey.
pin | The PIV application PIN. |
const std::string& LicenseSpring::HardwareKeyOptions::getPin | ( | ) | const |
Gets the configured PIN for the YubiKey.