credman.h File Reference

(D)TLS credentials management module definitions More...

Detailed Description

(D)TLS credentials management module definitions

This module DOES NOT copy the credentials into the system. It just holds the pointers to the credentials given by the user. The user must make sure that these pointers are valid during the lifetime of the application.
Aiman Ismail

Definition in file credman.h.

#include <unistd.h>
#include <stdint.h>
#include "kernel_defines.h"
+ Include dependency graph for credman.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...


 Maximum number of credentials in credential pool.
 Maximum number of ASN.1 objects when decoding keys.
#define CREDMAN_TAG_EMPTY   (0)
 Used to signal empty/no tag.


typedef uint16_t credman_tag_t
 Tag of the credential.


enum  credman_type_t { CREDMAN_TYPE_EMPTY = 0 , CREDMAN_TYPE_PSK = 1 , CREDMAN_TYPE_ECDSA = 2 }
 Credential types. More...
enum  {
 Return values. More...


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...
int credman_load_public_key (const void *buf, size_t buf_len, ecdsa_public_key_t *out)
 Load a public key from a buffer, as a SubjectPublicKeyInfo sequence, according to RFC5280. More...
int credman_load_private_key (const void *buf, size_t buf_len, credman_credential_t *cred)
 Load a private key from a buffer, as a OneAsymmetricKey sequence, according to RFC5958. More...
int credman_load_private_ecc_key (const void *buf, size_t buf_len, credman_credential_t *cred)
 Load an ECC private key from a buffer, as an ECPrivateKey sequence, according to RFC5915. More...
void credman_reset (void)
 Empties the credential pool.