Links

Getting Started

Quickstart guide for Windows projects using Keyless.

🚀
Lets get started!

In this Getting Started guide, we will show two ways to add the Keyless SDK to your Visual Studio Windows application project: a. Keyless SDK as a NuGet package (recommended) b. Keyless SDK manual integration
This will allow you to enroll and authenticate users with the Keyless protocol.

Prerequisites

  • Windows 8 or later (* not N or KN versions)
  • Visual Studio 2012 or later
  • Visual C++ runtime v14 (included in VS 2015 and later)
  • Customer information provided by Keyless
    • Direct package download link
    • Keyless NuGet source location
    • Keyless NuGet source credentials
    • Authentication information to Keyless Network

👨🔧
Installation (via NuGet package manager)

Step 1: Add Keyless NuGet source location to your Visual Studio configuration: Tools -> Options -> NuGet Package Manager -> Package sources
Step 2: Add Keyless SDK NuGet package to your application project, authenticating with your Keyless NuGet source credentials : Project (right-click) -> Manage NuGet packages -> Browse package source -> Install
Step 3: Verify your project is set to build for x64 platform. If so, your project should be set up with Keyless SDK include path and linker information.
Step 4 (optional): For convenience you may define User Macro AssetsDir. This will copy SDK runtime assets from the package to a specific folder during the build allowing easier deployment. Property manager -> Project (right-click) -> Add New Project Property Sheet Property sheet (right-click) -> Common Properties -> User Macros -> Add Macro (Name: AssetsDir, Value: C:\path\to\your\folder\)
Step 5: Copy out and edit the keyless_sdk.conf file from the assets folder (located either in the NuGet package or custom path set in Step 4):
  • Fill the Authentication information to Keyless Network provided to you by Keyless.
  • Make sure the root_dir value points to an empty folder accessible by the application and secure against tampering.
  • Make sure the other paths in the configuration file point to the assets.

👨🔧
Installation (manual)

Step 1: Download Keyless SDK package via direct download link provided to you.
Step 2: Open the package file (with a .nupkg extension) as a zip file. Copy out the contents to a desired location and set up your project accordingly. Package contents:
Path
Content
assets\
example configuration file and other SDK runtime assets
build\native\
headers, import libraries and dynamic library binaries
build\native\include\
header files
build\native\lib\<arch>
import library files
build\native\bin\<arch>
dynamic library binaries
doc\
documentation, API reference
Step 3: Edit the keyless_sdk.conf file from the assets folder:
  • Fill the Authentication information to Keyless Network provided to you by Keyless.
  • Make sure the root_dir value points to an empty folder accessible by the application and secure against tampering.
  • Make sure the other paths in the configuration file point to the assets.

🛸
Implementation

Basic initialization with a custom keyless_sdk.conf file:
#include "keyless_sdk.h" // Keyless SDK main header
#include <iostream>
int main()
{
try
{
// 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
return 0;
}
catch (const keyless::IException& e)
{
// Print out an error
std::cerr << e.message() << std::endl;
return e.result();
}
}