Credential handling for DTLS sock.
More...
Credential handling for DTLS sock.
|
file | creds.h |
| DTLS sock definitions.
|
|
◆ CONFIG_DTLS_CREDENTIALS_MAX
#define CONFIG_DTLS_CREDENTIALS_MAX 4 |
Default buffer size for TLS credential tags.
Definition at line 45 of file creds.h.
◆ sock_dtls_client_psk_cb_t
Pre-Shared Key client callback.
Called during handshake to determine session credential.
- Parameters
-
[in] | sock | DTLS sock object |
[in] | ep | Remove UDP endpoint representing the session |
[in] | tags | List of credential tags available for sock |
[in] | tags_len | Number of credentials in tags |
[in] | hint | Hint sent by the server. May be NULL |
[in] | hint_len | Length of hint |
- Returns
- Tag of the credential to use when a suitable one is found
- Return values
-
CREDMAN_TAG_EMPTY | otherwise |
Definition at line 62 of file creds.h.
◆ sock_dtls_rpk_cb_t
Raw Public Key callback.
Called during handshake to determine the session credential.
- Parameters
-
[in] | sock | DTLS sock object |
[in] | ep | Remote UDP endpoint representing the session |
[in] | tags | List of credential tags available for sock |
[in] | tags_len | Number of credentials in tags |
- Returns
- Tag of the credential to use when a suitable one is found
- Return values
-
CREDMAN_TAG_EMPTY | otherwise |
Definition at line 77 of file creds.h.
◆ sock_dtls_add_credential()
Adds a credential tag to list of available credentials for sock
.
- Precondition
- sock != NULL
- Parameters
-
[in] | sock | DTLS sock object |
[in] | tag | Tag of the credential to add |
- Return values
-
◆ sock_dtls_get_credentials()
Returns an array of tags of the registered credentials in sock
.
- Parameters
-
[in] | sock | DTLS sock object |
[out] | out | Pointer to place the reference to a read-only array of credman_tag_t |
- Returns
- Number of registered credentials
◆ sock_dtls_remove_credential()
Removes a credential tag of the list of available credentials for sock
.
- Precondition
- sock != NULL
- Parameters
-
[in] | sock | DTLS sock object |
[in] | tag | Tag of the credential to remove |
- Return values
-
◆ sock_dtls_set_client_psk_cb()
Sets the callback function for clients to specify a credential to use for a given connection.
- Parameters
-
[in] | sock | The DTLS sock object to set the callback to. |
[in] | cb | Callback to set. |
◆ sock_dtls_set_rpk_cb()
Sets the callback function to specify a credential to use for a given connection, when using Raw Public Keys.
- Parameters
-
[in] | sock | The DTLS sock object to set the callback to. |
[in] | cb | Callback to set. |
◆ sock_dtls_set_server_psk_id_hint()
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.
This hint is optional. It helps clients to decide which PSK Identity to use.
- Parameters
-
[in,out] | sock | The DTLS sock object to set the hint to. |
[in] | hint | PSK Identity hint as NULL-terminated string. |
- Return values
-