ca298472aaa04d0f6d6ea8b337628f0fe2dd43e2
[libcontrac.git] / include / contrac / contrac.h
1 /** \ingroup contrac
2 * @file
3 * @author David Llewellyn-Jones
4 * @version $(VERSION)
5 *
6 * @section LICENSE
7 *
8 *
9 *
10 * @brief
11 * @section DESCRIPTION
12 *
13 *
14 *
15 */
16
17 #ifndef __CONTRAC_H
18 #define __CONTRAC_H
19
20 // Includes
21
22 #include <stdint.h>
23 #include <stdbool.h>
24
25 // Defines
26
27 // Data sizes in bytes
28 #define TK_SIZE (32)
29 #define TK_SIZE_BASE64 (44)
30
31 // Structures
32
33 typedef struct _Contrac Contrac;
34
35 // Function prototypes
36
37 Contrac * contrac_new();
38 void contrac_delete(Contrac * data);
39
40 bool contrac_generate_tracing_key(Contrac * data);
41 bool contrac_set_day_number(Contrac * data, uint32_t day_number);
42 bool contrac_set_time_interval_number(Contrac * data, uint8_t time_interval_number);
43 bool contrac_update_current_time(Contrac * data);
44 bool contrac_get_initialised(Contrac const * data);
45
46 const unsigned char * contrac_get_tracing_key(Contrac const * data);
47 void contrac_get_tracing_key_base64(Contrac const * data, char * base64);
48
49 void contrac_set_tracing_key(Contrac * data, unsigned char const * tracing_key);
50 bool contrac_set_tracing_key_base64(Contrac * data, char const * tracing_key);
51
52 const unsigned char * contrac_get_daily_key(Contrac const * data);
53 void contrac_get_daily_key_base64(Contrac const * data, char * base64);
54
55 const unsigned char * contrac_get_proximity_id(Contrac const * data);
56 void contrac_get_proximity_id_base64(Contrac const * data, char * base64);
57
58 // Function definitions
59
60 #endif // __CONTRAC_H
61