/// USER SESSION HAS BEEN INITIALIZED
/// USER HAS BEEN ENROLLED
// These are enrollment outputs, load them here before authentication
std::vector<unsigned char> user_key = loadUserKey();
std::vector<unsigned char> user_secret = loadUserSecret();
// IAuthenticationobject will hold the authentication result
keyless::IAuthentication::Ptr auth;
// Perform authentication using previously selected and configured camera device
auth = session->authenticate(*device_selector, user_key, nullptr);
// Verify matching User Secret objects from enrollment and authentication
// in the simplest way here
bool ok = (user_secret.size() == auth->getUserSecret().getDataSize() &&
memcmp(user_secret.data(),
auth->getUserSecret().getData(),
user_secret.size()) == 0);
/// USER SUCCESFULLY AUTHENTICATED
/// USER AUTHENTICATION FAILED
catch (const keyless::IException& e)
std::cerr << e.message() << std::endl;