Loading...
Searching...
No Matches
coap_oscore.h
Go to the documentation of this file.
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* coap_oscore.h -- Object Security for Constrained RESTful Environments
* (OSCORE) support for libcoap
*
* Copyright (C) 2019-2024 Olaf Bergmann <bergmann@tzi.org>
* Copyright (C) 2021-2024 Jon Shallow <supjps-libcoap@jpshallow.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
#ifndef COAP_OSCORE_H_
#define COAP_OSCORE_H_
COAP_API coap_session_t *coap_new_client_session_oscore(coap_context_t *ctx,
const coap_address_t *local_if,
const coap_address_t *server,
coap_proto_t proto,
coap_oscore_conf_t *oscore_conf);
COAP_API coap_session_t *coap_new_client_session_oscore_psk(coap_context_t *ctx,
const coap_address_t *local_if,
const coap_address_t *server,
coap_proto_t proto,
coap_dtls_cpsk_t *psk_data,
coap_oscore_conf_t *oscore_conf);
COAP_API coap_session_t *coap_new_client_session_oscore_pki(coap_context_t *ctx,
const coap_address_t *local_if,
const coap_address_t *server,
coap_proto_t proto,
coap_dtls_pki_t *pki_data,
coap_oscore_conf_t *oscore_conf);
COAP_API int coap_context_oscore_server(coap_context_t *context,
coap_oscore_conf_t *oscore_conf);
typedef int (*coap_oscore_save_seq_num_t)(uint64_t sender_seq_num, void *param);
coap_oscore_conf_t *coap_new_oscore_conf(coap_str_const_t conf_mem,
coap_oscore_save_seq_num_t save_seq_num_func,
void *save_seq_num_func_param,
uint64_t start_seq_num);
int coap_delete_oscore_conf(coap_oscore_conf_t *oscore_conf);
COAP_API int coap_new_oscore_recipient(coap_context_t *context,
coap_bin_const_t *recipient_id);
COAP_API int coap_delete_oscore_recipient(coap_context_t *context,
coap_bin_const_t *recipient_id);
#endif /* COAP_OSCORE_H */
COAP_API
#define COAP_API
Definition coap_libcoap_build.h:41
coap_new_oscore_conf
coap_oscore_conf_t * coap_new_oscore_conf(coap_str_const_t conf_mem, coap_oscore_save_seq_num_t save_seq_num_func, void *save_seq_num_func_param, uint64_t start_seq_num)
Parse an OSCORE configuration (held in memory) and populate a OSCORE configuration structure.
Definition coap_oscore.c:2243
coap_new_client_session_oscore_psk
COAP_API coap_session_t * coap_new_client_session_oscore_psk(coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, coap_dtls_cpsk_t *psk_data, coap_oscore_conf_t *oscore_conf)
Creates a new client session to the designated server with PSK credentials as well as protecting the ...
Definition coap_oscore.c:2203
coap_delete_oscore_conf
int coap_delete_oscore_conf(coap_oscore_conf_t *oscore_conf)
Release all the information associated with the OSCORE configuration.
Definition coap_oscore.c:2255
coap_new_client_session_oscore
COAP_API coap_session_t * coap_new_client_session_oscore(coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, coap_oscore_conf_t *oscore_conf)
Creates a new client session to the designated server, protecting the data using OSCORE.
Definition coap_oscore.c:2189
coap_context_oscore_server
COAP_API int coap_context_oscore_server(coap_context_t *context, coap_oscore_conf_t *oscore_conf)
Set the context's default OSCORE configuration for a server.
Definition coap_oscore.c:2235
coap_new_client_session_oscore_pki
COAP_API coap_session_t * coap_new_client_session_oscore_pki(coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, coap_dtls_pki_t *pki_data, coap_oscore_conf_t *oscore_conf)
Creates a new client session to the designated server with PKI credentials as well as protecting the ...
Definition coap_oscore.c:2219
coap_new_oscore_recipient
COAP_API int coap_new_oscore_recipient(coap_context_t *context, coap_bin_const_t *recipient_id)
Add in the specific Recipient ID into the OSCORE context (server only).
Definition coap_oscore.c:2261
coap_oscore_save_seq_num_t
int(* coap_oscore_save_seq_num_t)(uint64_t sender_seq_num, void *param)
Definition of the function used to save the current Sender Sequence Number.
Definition coap_oscore.h:130
coap_delete_oscore_recipient
COAP_API int coap_delete_oscore_recipient(coap_context_t *context, coap_bin_const_t *recipient_id)
Release all the information associated for the specific Recipient ID (and hence and stop any further ...
Definition coap_oscore.c:2269
coap_proto_t
coap_proto_t
CoAP protocol types.
Definition coap_pdu.h:312
coap_address_t
Multi-purpose address abstraction.
Definition coap_address.h:148
coap_bin_const_t
CoAP binary data definition with const data.
Definition coap_str.h:64
coap_context_t
The CoAP stack's global state is stored in a coap_context_t object.
Definition coap_net_internal.h:50
coap_dtls_cpsk_t
The structure used for defining the Client PSK setup data to be used.
Definition coap_dtls.h:410
coap_dtls_pki_t
The structure used for defining the PKI setup data to be used.
Definition coap_dtls.h:312
coap_oscore_conf_t
The structure used to hold the OSCORE configuration information.
Definition coap_oscore_internal.h:36
coap_session_t
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...
Definition coap_session_internal.h:68
coap_str_const_t
CoAP string data definition with const data.
Definition coap_str.h:46