| Zephyr Project API 4.2.99
    A Scalable Open Source RTOS | 
TLS credentials management. More...
| Macros | |
| #define | SEC_TAG_TLS_INVALID (-1) | 
| Invalid secure tag value. | |
| Typedefs | |
| typedef int | sec_tag_t | 
| Secure tag, a reference to TLS credential. | |
| Enumerations | |
| enum | tls_credential_type { TLS_CREDENTIAL_NONE , TLS_CREDENTIAL_CA_CERTIFICATE , TLS_CREDENTIAL_PUBLIC_CERTIFICATE , TLS_CREDENTIAL_SERVER_CERTIFICATE = TLS_CREDENTIAL_PUBLIC_CERTIFICATE , TLS_CREDENTIAL_PRIVATE_KEY , TLS_CREDENTIAL_PSK , TLS_CREDENTIAL_PSK_ID } | 
| TLS credential types.  More... | |
| Functions | |
| int | tls_credential_add (sec_tag_t tag, enum tls_credential_type type, const void *cred, size_t credlen) | 
| Add a TLS credential. | |
| int | tls_credential_get (sec_tag_t tag, enum tls_credential_type type, void *cred, size_t *credlen) | 
| Get a TLS credential. | |
| int | tls_credential_delete (sec_tag_t tag, enum tls_credential_type type) | 
| Delete a TLS credential. | |
TLS credentials management.
| #define SEC_TAG_TLS_INVALID (-1) | 
#include <include/zephyr/net/tls_credentials.h>
Invalid secure tag value.
| typedef int sec_tag_t | 
#include <include/zephyr/net/tls_credentials.h>
Secure tag, a reference to TLS credential.
Secure tag can be used to reference credential after it was registered in the system.
| enum tls_credential_type | 
#include <include/zephyr/net/tls_credentials.h>
TLS credential types.
| Enumerator | |
|---|---|
| TLS_CREDENTIAL_NONE | Unspecified credential. | 
| TLS_CREDENTIAL_CA_CERTIFICATE | A trusted CA certificate. Use this to authenticate remote servers. Used with certificate-based ciphersuites. | 
| TLS_CREDENTIAL_PUBLIC_CERTIFICATE | A public client or server certificate. Use this to register your own certificate. Should be registered together with a corresponding private key. Used with certificate-based ciphersuites. | 
| TLS_CREDENTIAL_SERVER_CERTIFICATE | 
 | 
| TLS_CREDENTIAL_PRIVATE_KEY | Private key. Should be registered together with a corresponding public certificate. Used with certificate-based ciphersuites. | 
| TLS_CREDENTIAL_PSK | Pre-shared key. Should be registered together with a corresponding PSK identity. Used with PSK-based ciphersuites. | 
| TLS_CREDENTIAL_PSK_ID | Pre-shared key identity. Should be registered together with a corresponding PSK. Used with PSK-based ciphersuites. | 
| int tls_credential_add | ( | sec_tag_t | tag, | 
| enum tls_credential_type | type, | ||
| const void * | cred, | ||
| size_t | credlen | ||
| ) | 
#include <include/zephyr/net/tls_credentials.h>
Add a TLS credential.
This function adds a TLS credential, that can be used by TLS/DTLS for authentication.
| tag | A security tag that credential will be referenced with. | 
| type | A TLS/DTLS credential type. | 
| cred | A TLS/DTLS credential. | 
| credlen | A TLS/DTLS credential length. | 
| 0 | TLS credential successfully added. | 
| -EACCES | Access to the TLS credential subsystem was denied. | 
| -ENOMEM | Not enough memory to add new TLS credential. | 
| -EEXIST | TLS credential of specific tag and type already exists. | 
| int tls_credential_delete | ( | sec_tag_t | tag, | 
| enum tls_credential_type | type | ||
| ) | 
#include <include/zephyr/net/tls_credentials.h>
Delete a TLS credential.
This function removes a TLS credential, referenced by tag secure tag of type.
| tag | A security tag corresponding to removed credential. | 
| type | A TLS/DTLS credential type of removed credential. | 
| 0 | TLS credential successfully deleted. | 
| -EACCES | Access to the TLS credential subsystem was denied. | 
| -ENOENT | Requested TLS credential was not found. | 
| int tls_credential_get | ( | sec_tag_t | tag, | 
| enum tls_credential_type | type, | ||
| void * | cred, | ||
| size_t * | credlen | ||
| ) | 
#include <include/zephyr/net/tls_credentials.h>
Get a TLS credential.
This function gets an already registered TLS credential, referenced by tag secure tag of type.
| tag | A security tag of requested credential. | 
| type | A TLS/DTLS credential type of requested credential. | 
| cred | A buffer for TLS/DTLS credential. | 
| credlen | A buffer size on input. TLS/DTLS credential length on output. | 
| 0 | TLS credential successfully obtained. | 
| -EACCES | Access to the TLS credential subsystem was denied. | 
| -ENOENT | Requested TLS credential was not found. | 
| -EFBIG | Requested TLS credential does not fit in the buffer provided. Check *credlen for size required. |