User manual
Version: v4.5.2
26
buffer .data[ 0xfu ] = 0x21;
27
buffer .size = 16u;
28
29
if
( ftkSetData ( lib , sn , setKeyId , & buffer ) != ftkError :: FTK_OK )
30
{
31
// handle error
32
}
33
34
std :: default_random_engine generator ;
35
std :: uniform_int_distribution <uint64_t > distribution ();
36
37
38
buffer .reset ();
39
uint64_t value( distribution ( generator ) );
40
memcpy ( buffer .data , &value ,
sizeof
( value ) );
41
buffer .size = 8u;
42
43
if
( ftkSetData ( lib , sn , requestChallengeId , & buffer ) != ftkError :: FTK_OK )
44
{
45
// handle error
46
}
47
48
int32_t result ( 0 );
49
50
if
( ftkGetInt32 ( lib , sn , checkChallengeId , &result ,
51
ftkOptionGetter :: FTK_VALUE ) != ftkError :: FTK_OK )
52
{
53
// handle error
54
}
55
56
if
( value == 1 )
57
{
58
cout <<
" Device successfully authenticated "
<< endl;
59
}
60
else
61
{
62
cerr <<
" Could not authenticate device "
<< endl;
63
}
Listing 16.3: Full example of key setting, challenge requesting and checking.
The GUI demo application also allows to check if the connected fusionTrack device is correctly config-
ured (see Figure 16.1).
Atracsys / 2020-06-17 / 16:48:00
89 / 113