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:
1
#include "keyless_sdk.h" // Keyless SDK main header
2
#include <iostream>
3
​
4
int main()
5
{
6
try
7
{
8
// ISdkFactory is the top level Keyless SDK interface
9
keyless::ISdkFactory::Ptr factory;
10
11
// Load the factory interface of a specific version
12
factory = reinterpret_cast<keyless::ISdkFactory*>(
13
keyless_createFactoryInstance(KEYLESS_SDK_INTERFACE_V1));
14
15
// ISessionConfigurator allows for a basic configuration overrides
16
// such as the location of the keyless_sdk.conf file
17
keyless::ISessionConfigurator::Ptr session_config =
18
factory->createSessionConfigurator();
19
20
// Set custom config file path
21
session_config->setConfigFile(L"C:\\keyless_sdk_assets\\keyless_sdk.conf");
22
23
// ICaptureDeviceSelectorallows for the configuration of the video capture
24
// such as selecting a camera, resolution, usage of liveness detection etc.
25
keyless::ICaptureDeviceSelector::Ptr device_selector =
26
factory->createCaptureDeviceSelector();
27
28
// Let's keep the default ICaptureDeviceSelector values, this will select
29
// the first available camera with recommended video capture configuration.
30
31
// IUserSession provides an interface to the user enrollment / authentication
32
// and de-enrollment methods.
33
keyless::IUserSession::Ptr session =
34
factory->createUserSessionWithConfig(*session_config, *device_selector);
35
36
/// KEYLESS SDK SESSION IS INITIALIZED HERE
37
/// ENROLLMENT / AUTHENTICATION / DE-ENROLLMENT CALLS ARE NOW AVAILABLE
38
39
return 0;
40
}
41
catch (const keyless::IException& e)
42
{
43
// Print out an error
44
std::cerr << e.message() << std::endl;
45
return e.result();
46
}
47
}
Copied!
Last modified 4mo ago