#include "keyless_sdk.h" // Keyless SDK main header
// ISdkFactory is the top level Keyless SDK interface
keyless::ISdkFactory::Ptr factory;
// Load the factory interface of a specific version
factory = reinterpret_cast<keyless::ISdkFactory*>(
keyless_createFactoryInstance(KEYLESS_SDK_INTERFACE_V1));
// ISessionConfigurator allows for a basic configuration overrides
// such as the location of the keyless_sdk.conf file
keyless::ISessionConfigurator::Ptr session_config =
factory->createSessionConfigurator();
// Set custom config file path
session_config->setConfigFile(L"C:\\keyless_sdk_assets\\keyless_sdk.conf");
// ICaptureDeviceSelectorallows for the configuration of the video capture
// such as selecting a camera, resolution, usage of liveness detection etc.
keyless::ICaptureDeviceSelector::Ptr device_selector =
factory->createCaptureDeviceSelector();
// Let's keep the default ICaptureDeviceSelector values, this will select
// the first available camera with recommended video capture configuration.
// IUserSession provides an interface to the user enrollment / authentication
// and de-enrollment methods.
keyless::IUserSession::Ptr session =
factory->createUserSessionWithConfig(*session_config, *device_selector);
/// KEYLESS SDK SESSION IS INITIALIZED HERE
/// ENROLLMENT / AUTHENTICATION / DE-ENROLLMENT CALLS ARE NOW AVAILABLE
catch (const keyless::IException& e)
std::cerr << e.message() << std::endl;