OPTIGA Trust M  1.1.0
C++ library for Optiga Trust M Chip Security Controller
optiga_example.h
Go to the documentation of this file.
1 
39 #ifndef _OPTIGA_EXAMPLE_H_
40 #define _OPTIGA_EXAMPLE_H_
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 #include "optiga_lib_config.h"
46 #include "optiga_lib_logger.h"
47 
48 // Macro to enable logger for Application
49 #define OPTIGA_LIB_ENABLE_EXAMPLE_LOGGING
50 
51 // Logger levels
52 #define OPTIGA_EXAMPLE "[optiga example] : "
53 
54 // Logger color for different layers and data
55 #define OPTIGA_EXAMPLE_COLOR OPTIGA_LIB_LOGGER_COLOR_DEFAULT
56 
57 #if defined (OPTIGA_LIB_ENABLE_LOGGING) && defined (OPTIGA_LIB_ENABLE_EXAMPLE_LOGGING)
58 
72 #define OPTIGA_EXAMPLE_LOG_MESSAGE(msg) \
73 {\
74  optiga_lib_print_message(msg,OPTIGA_EXAMPLE,OPTIGA_EXAMPLE_COLOR);\
75 }
76 
92 #define OPTIGA_EXAMPLE_LOG_HEX_DATA(array,array_len) \
93 {\
94  optiga_lib_print_array_hex_format(array,array_len,OPTIGA_UNPROTECTED_DATA_COLOR);\
95 }
96 
111 #define OPTIGA_EXAMPLE_LOG_STATUS(return_value) \
112 { \
113  if (OPTIGA_LIB_SUCCESS != return_value) \
114  { \
115  optiga_lib_print_status(OPTIGA_EXAMPLE,OPTIGA_ERROR_COLOR,return_value); \
116  } \
117  else\
118  { \
119  optiga_lib_print_status(OPTIGA_EXAMPLE,OPTIGA_EXAMPLE_COLOR,return_value); \
120  } \
121 }
122 #else
123 
124 #define OPTIGA_EXAMPLE_LOG_MESSAGE(msg)
125 #define OPTIGA_EXAMPLE_LOG_HEX_DATA(array, array_len)
126 #define OPTIGA_EXAMPLE_LOG_STATUS(return_value)
127 
128 #endif
129 
130 
131 void example_optiga_crypt_hash (void);
135 void example_optiga_crypt_ecdh(void);
136 void example_optiga_crypt_random(void);
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /*_OPTIGA_EXAMPLE_H_ */
158 
This file provides the prototypes for the OPTIGA library logger.
void example_optiga_util_read_uuid(void)
Definition: optiga_example.c:3095
void example_optiga_util_write_data(void)
Definition: optiga_example.c:1443
void example_optiga_crypt_ecc_generate_keypair(void)
Definition: optiga_example.c:227
void example_optiga_crypt_rsa_decrypt_and_export(void)
Definition: optiga_example.c:2140
void example_optiga_crypt_hash(void)
Definition: optiga_example.c:33
void example_optiga_util_update_count(void)
Definition: optiga_example.c:2550
void example_optiga_crypt_ecdsa_sign(void)
Definition: optiga_example.c:368
void example_optiga_crypt_ecdsa_verify(void)
Definition: optiga_example.c:506
void example_optiga_crypt_rsa_generate_keypair(void)
Definition: optiga_example.c:1653
void example_optiga_crypt_ecdh(void)
Definition: optiga_example.c:691
void example_optiga_util_read_data(void)
Definition: optiga_example.c:1289
void example_optiga_crypt_rsa_sign(void)
Definition: optiga_example.c:1802
void example_optiga_util_protected_update(void)
Definition: optiga_example.c:2709
void example_optiga_crypt_rsa_encrypt_message(void)
Definition: optiga_example.c:2150
void example_optiga_crypt_rsa_encrypt_session(void)
Definition: optiga_example.c:2339
void example_optiga_crypt_rsa_verify(void)
Definition: optiga_example.c:1949
void example_optiga_crypt_rsa_decrypt_and_store(void)
Definition: optiga_example.c:2145
void example_pair_host_and_optiga_using_pre_shared_secret(void)
Definition: optiga_example.c:3248
void example_optiga_util_hibernate_restore(void)
Definition: optiga_example.c:3253
void example_optiga_crypt_tls_prf_sha256(void)
Definition: optiga_example.c:1022
void example_optiga_crypt_random(void)
Definition: optiga_example.c:892
This file is defines the compilation switches to build code with required features.