Credentials management module for (D)TLS. More...
Credentials management module for (D)TLS.
Modules | |
(D)TLS Credential Manager compile configurations | |
Files | |
file | credman.h |
(D)TLS credentials management module definitions | |
Data Structures | |
struct | credman_buffer_t |
Buffer of the credential. More... | |
struct | psk_params_t |
PSK parameters. More... | |
struct | ecdsa_public_key_t |
ECDSA public keys. More... | |
struct | ecdsa_params_t |
ECDSA parameters. More... | |
struct | credman_credential_t |
Credential information. More... | |
Macros | |
#define | CREDMAN_TAG_EMPTY (0) |
Used to signal empty/no tag. | |
Typedefs | |
typedef uint16_t | credman_tag_t |
Tag of the credential. | |
Enumerations | |
enum | credman_type_t { CREDMAN_TYPE_EMPTY = 0, CREDMAN_TYPE_PSK = 1, CREDMAN_TYPE_ECDSA = 2 } |
Credential types. More... | |
enum | { CREDMAN_OK = 0, CREDMAN_EXIST = -1, CREDMAN_NO_SPACE = -2, CREDMAN_NOT_FOUND = -3, CREDMAN_INVALID = -4, CREDMAN_TYPE_UNKNOWN = -5, CREDMAN_ERROR = -6 } |
Return values. More... | |
Functions | |
int | credman_add (const credman_credential_t *credential) |
Adds a credential to the credential pool. More... | |
int | credman_get (credman_credential_t *credential, credman_tag_t tag, credman_type_t type) |
Gets a credential from credential pool. More... | |
void | credman_delete (credman_tag_t tag, credman_type_t type) |
Delete a credential from the credential pool. More... | |
int | credman_get_used_count (void) |
Gets the number of credentials currently in the credential pool. More... | |
void | credman_reset (void) |
Empties the credential pool. | |
anonymous enum |
Return values.
enum credman_type_t |
Credential types.
Enumerator | |
---|---|
CREDMAN_TYPE_EMPTY | Empty type. Used to detect uninitialized credman_credential_t internally. |
CREDMAN_TYPE_PSK | PSK credential type. |
CREDMAN_TYPE_ECDSA | ECDSA credential type. |
int credman_add | ( | const credman_credential_t * | credential | ) |
Adds a credential to the credential pool.
[in] | credential | Credential to add. |
tag
and type
already exist credential
has unknown credman_credential_t::type credential
has void credman_delete | ( | credman_tag_t | tag, |
credman_type_t | type | ||
) |
Delete a credential from the credential pool.
Does nothing if credential with credman_credential_t::tag tag
and credman_credential_t::type type
is not found.
[in] | tag | Tag of the credential |
[in] | type | Type of the credential |
int credman_get | ( | credman_credential_t * | credential, |
credman_tag_t | tag, | ||
credman_type_t | type | ||
) |
Gets a credential from credential pool.
[out] | credential | Found credential |
[in] | tag | Tag of credential to get |
[in] | type | Type of credential to get |
tag
and type
found int credman_get_used_count | ( | void | ) |
Gets the number of credentials currently in the credential pool.
Maximum number of allowed credentials is defined by CONFIG_CREDMAN_MAX_CREDENTIALS