anjay
Loading...
Searching...
No Matches
security.h
Go to the documentation of this file.
1/*
2 * Copyright 2017-2024 AVSystem <avsystem@avsystem.com>
3 * AVSystem Anjay LwM2M SDK
4 * All rights reserved.
5 *
6 * Licensed under the AVSystem-5-clause License.
7 * See the attached LICENSE file for details.
8 */
9
10#ifndef ANJAY_INCLUDE_ANJAY_SECURITY_H
11#define ANJAY_INCLUDE_ANJAY_SECURITY_H
12
13#include <anjay/dm.h>
14
15#include <avsystem/commons/avs_stream.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21typedef struct {
25 const char *server_uri;
41 const uint8_t *server_public_key;
43#ifdef ANJAY_WITH_SMS
47 const uint8_t *sms_key_parameters;
50 const uint8_t *sms_secret_key;
53 const char *server_sms_number;
54#endif // ANJAY_WITH_SMS
55#ifdef ANJAY_WITH_LWM2M11
57 const uint8_t *matching_type;
61 const uint8_t *certificate_usage;
65 avs_net_socket_tls_ciphersuites_t ciphersuites;
66#endif // ANJAY_WITH_LWM2M11
67#ifdef ANJAY_WITH_SECURITY_STRUCTURED
74 avs_crypto_certificate_chain_info_t public_cert;
81 avs_crypto_private_key_info_t private_key;
87 avs_crypto_psk_identity_info_t psk_identity;
93 avs_crypto_psk_key_info_t psk_key;
94# ifdef ANJAY_WITH_SMS
100 avs_crypto_psk_identity_info_t sms_psk_identity;
106 avs_crypto_psk_key_info_t sms_psk_key;
107# endif // ANJAY_WITH_SMS
108#endif // ANJAY_WITH_SECURITY_STRUCTURED
110
134 anjay_t *anjay,
135 const anjay_security_instance_t *instance,
136 anjay_iid_t *inout_iid);
137
144
153 avs_stream_t *out_stream);
154
166 avs_stream_t *in_stream);
167
174
186
187#ifdef ANJAY_WITH_MODULE_SECURITY_ENGINE_SUPPORT
225 anjay_ssid_t ssid,
226 const void *data,
227 size_t data_size,
228 void *arg);
229
346
378 anjay_t *anjay, const anjay_security_hsm_configuration_t *hsm_config);
379
405#endif // ANJAY_WITH_MODULE_SECURITY_ENGINE_SUPPORT
406
407#ifdef __cplusplus
408}
409#endif
410
411#endif /* ANJAY_INCLUDE_ANJAY_SECURITY_H */
uint16_t anjay_iid_t
Definition core.h:1185
struct anjay_struct anjay_t
Definition core.h:45
uint16_t anjay_ssid_t
Definition core.h:31
anjay_sms_security_mode_t
Definition dm.h:1182
anjay_security_mode_t
Definition dm.h:1169
bool anjay_security_object_is_modified(anjay_t *anjay)
const char * anjay_security_hsm_query_cb_t(anjay_iid_t iid, anjay_ssid_t ssid, const void *data, size_t data_size, void *arg)
Definition security.h:224
int anjay_security_object_install(anjay_t *anjay)
void anjay_security_mark_hsm_permanent(anjay_t *anjay, anjay_ssid_t ssid)
avs_error_t anjay_security_object_restore(anjay_t *anjay, avs_stream_t *in_stream)
avs_error_t anjay_security_object_persist(anjay_t *anjay, avs_stream_t *out_stream)
void anjay_security_object_purge(anjay_t *anjay)
int anjay_security_object_install_with_hsm(anjay_t *anjay, const anjay_security_hsm_configuration_t *hsm_config)
int anjay_security_object_add_instance(anjay_t *anjay, const anjay_security_instance_t *instance, anjay_iid_t *inout_iid)
Definition security.h:235
anjay_security_hsm_query_cb_t * psk_key_cb
Definition security.h:299
void * sms_psk_key_cb_arg
Definition security.h:343
anjay_security_hsm_query_cb_t * psk_identity_cb
Definition security.h:281
anjay_security_hsm_query_cb_t * private_key_cb
Definition security.h:262
anjay_security_hsm_query_cb_t * sms_psk_key_cb
Definition security.h:335
anjay_security_hsm_query_cb_t * sms_psk_identity_cb
Definition security.h:317
void * public_cert_cb_arg
Definition security.h:252
void * private_key_cb_arg
Definition security.h:270
void * psk_identity_cb_arg
Definition security.h:289
void * sms_psk_identity_cb_arg
Definition security.h:325
void * psk_key_cb_arg
Definition security.h:307
anjay_security_hsm_query_cb_t * public_cert_cb
Definition security.h:244
Definition security.h:21
size_t sms_secret_key_size
Definition security.h:51
anjay_security_mode_t security_mode
Definition security.h:29
const uint8_t * sms_key_parameters
Definition security.h:47
anjay_sms_security_mode_t sms_security_mode
Definition security.h:45
avs_crypto_psk_key_info_t sms_psk_key
Definition security.h:106
const uint8_t * server_public_key
Definition security.h:41
int32_t bootstrap_timeout_s
Definition security.h:33
size_t server_public_key_size
Definition security.h:42
size_t sms_key_parameters_size
Definition security.h:48
anjay_ssid_t ssid
Definition security.h:23
avs_crypto_psk_key_info_t psk_key
Definition security.h:93
avs_crypto_psk_identity_info_t psk_identity
Definition security.h:87
const uint8_t * private_cert_or_psk_key
Definition security.h:38
size_t private_cert_or_psk_key_size
Definition security.h:39
size_t public_cert_or_psk_identity_size
Definition security.h:36
bool bootstrap_server
Definition security.h:27
const char * server_name_indication
Definition security.h:59
const uint8_t * sms_secret_key
Definition security.h:50
int32_t client_holdoff_s
Definition security.h:31
avs_net_socket_tls_ciphersuites_t ciphersuites
Definition security.h:65
avs_crypto_psk_identity_info_t sms_psk_identity
Definition security.h:100
const char * server_uri
Definition security.h:25
const uint8_t * certificate_usage
Definition security.h:61
avs_crypto_private_key_info_t private_key
Definition security.h:81
avs_crypto_certificate_chain_info_t public_cert
Definition security.h:74
const char * server_sms_number
Definition security.h:53
const uint8_t * public_cert_or_psk_identity
Definition security.h:35
const uint8_t * matching_type
Definition security.h:57