Loading...
Searching...
No Matches
creds.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 HAW Hamburg
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
21#ifndef NET_SOCK_DTLS_CREDS_H
22#define NET_SOCK_DTLS_CREDS_H
23
24#include "net/sock/udp.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
37#ifndef CONFIG_DTLS_PSK_ID_HINT_MAX_SIZE
38#define CONFIG_DTLS_PSK_ID_HINT_MAX_SIZE 32
39#endif
40
44#ifndef CONFIG_DTLS_CREDENTIALS_MAX
45#define CONFIG_DTLS_CREDENTIALS_MAX 4
46#endif
63 credman_tag_t tags[], unsigned tags_len,
64 const char* hint, size_t hint_len);
65
78 credman_tag_t tags[], unsigned tags_len);
79
91int sock_dtls_set_server_psk_id_hint(sock_dtls_t *sock, const char *hint);
92
105
118
128
137
146
147#ifdef __cplusplus
148}
149#endif
150
151#endif /* NET_SOCK_DTLS_CREDS_H */
uint16_t credman_tag_t
Tag of the credential.
Definition credman.h:96
int sock_dtls_set_server_psk_id_hint(sock_dtls_t *sock, const char *hint)
Sets the PSK Identity hint to be sent to clients during handshake.
void sock_dtls_set_client_psk_cb(sock_dtls_t *sock, sock_dtls_client_psk_cb_t cb)
Sets the callback function for clients to specify a credential to use for a given connection.
credman_tag_t(* sock_dtls_client_psk_cb_t)(sock_dtls_t *sock, sock_udp_ep_t *ep, credman_tag_t tags[], unsigned tags_len, const char *hint, size_t hint_len)
Pre-Shared Key client callback.
Definition creds.h:62
void sock_dtls_set_rpk_cb(sock_dtls_t *sock, sock_dtls_rpk_cb_t cb)
Sets the callback function to specify a credential to use for a given connection, when using Raw Publ...
size_t sock_dtls_get_credentials(sock_dtls_t *sock, const credman_tag_t **out)
Returns an array of tags of the registered credentials in sock.
int sock_dtls_remove_credential(sock_dtls_t *sock, credman_tag_t tag)
Removes a credential tag of the list of available credentials for sock.
credman_tag_t(* sock_dtls_rpk_cb_t)(sock_dtls_t *sock, sock_udp_ep_t *ep, credman_tag_t tags[], unsigned tags_len)
Raw Public Key callback.
Definition creds.h:77
int sock_dtls_add_credential(sock_dtls_t *sock, credman_tag_t tag)
Adds a credential tag to list of available credentials for sock.
UDP sock definitions.
Common IP-based transport layer end point.
Definition sock.h:215
Information about DTLS sock.