IoTivity-Lite
|
#include "oc_export.h"
#include "oc_ri.h"
#include "oc_uuid.h"
#include "util/oc_list.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Data Structures | |
struct | oc_cred_data_t |
credential data info More... | |
struct | oc_sec_certs_data_t |
Selected certificate data used for verification. More... | |
struct | oc_sec_cred_t |
security credential information More... | |
struct | oc_sec_creds_t |
credential and rowner information More... | |
Typedefs | |
typedef struct oc_cred_data_t | oc_cred_data_t |
credential data info More... | |
typedef struct oc_sec_certs_data_t | oc_sec_certs_data_t |
Selected certificate data used for verification. More... | |
typedef bool(* | oc_sec_cred_filter_t) (const oc_sec_cred_t *cred, void *user_data) |
Security credential filtering function. More... | |
typedef struct oc_sec_cred_t | oc_sec_cred_t |
security credential information More... | |
typedef struct oc_sec_creds_t | oc_sec_creds_t |
credential and rowner information More... | |
typedef enum oc_sec_credtype_t | oc_sec_credtype_t |
credential type information More... | |
typedef enum oc_sec_credusage_t | oc_sec_credusage_t |
credential usage More... | |
typedef enum oc_sec_encoding_t | oc_sec_encoding_t |
Security encoding information. More... | |
typedef void(* | oc_sec_on_apply_cred_cb_t) (oc_sec_on_apply_cred_data_t data, void *user_data) |
callback invoked with a created / updated credential More... | |
typedef struct oc_sec_on_apply_cred_data_t | oc_sec_on_apply_cred_data_t |
typedef bool(* | oc_verify_sec_certs_data_fn_t) (const oc_sec_certs_data_t *data, void *user_data) |
Callback function to verify a single certificate. More... | |
Enumerations | |
enum | oc_sec_credtype_t { OC_CREDTYPE_NULL = 0 , OC_CREDTYPE_PSK = 1 , OC_CREDTYPE_CERT = 8 , OC_CREDTYPE_OSCORE = 64 , OC_CREDTYPE_OSCORE_MCAST_CLIENT = 128 , OC_CREDTYPE_OSCORE_MCAST_SERVER = 256 } |
credential type information More... | |
enum | oc_sec_credusage_t { OC_CREDUSAGE_NULL = 0 , OC_CREDUSAGE_TRUSTCA = 1 << 1 , OC_CREDUSAGE_IDENTITY_CERT = 1 << 2 , OC_CREDUSAGE_ROLE_CERT = 1 << 3 , OC_CREDUSAGE_MFG_TRUSTCA , OC_CREDUSAGE_MFG_CERT = 1 << 5 } |
credential usage More... | |
enum | oc_sec_encoding_t { OC_ENCODING_UNSUPPORTED = 0 , OC_ENCODING_BASE64 , OC_ENCODING_RAW , OC_ENCODING_PEM , OC_ENCODING_HANDLE } |
Security encoding information. More... | |
Functions | |
const char * | oc_cred_credtype_string (oc_sec_credtype_t credtype) |
credential type to string More... | |
oc_sec_credusage_t | oc_cred_parse_credusage (const oc_string_t *credusage_string) |
parse credential string to type More... | |
oc_sec_encoding_t | oc_cred_parse_encoding (const oc_string_t *encoding_string) |
parse credential encoding string to type More... | |
const char * | oc_cred_read_credusage (oc_sec_credusage_t credusage) |
read credential usage More... | |
const char * | oc_cred_read_encoding (oc_sec_encoding_t encoding) |
read credential encoding More... | |
int | oc_cred_verify_certificate_chain (const oc_sec_cred_t *cred, oc_verify_sec_certs_data_fn_t verify_cert, void *user_data) |
Verify the certificate chain associated with the credential. More... | |
int | oc_sec_apply_cred (const oc_rep_t *rep, const oc_resource_t *resource, const oc_endpoint_t *endpoint, oc_sec_on_apply_cred_cb_t on_apply_cred_cb, void *on_apply_cred_data) |
parse payload and add/update credentials More... | |
void | oc_sec_cred_clear (size_t device, oc_sec_cred_filter_t filter, void *user_data) |
remove credentials matching filter from given device More... | |
oc_sec_cred_t * | oc_sec_get_cred_by_credid (int credid, size_t device) |
get credential by credid from given device More... | |
oc_sec_creds_t * | oc_sec_get_creds (size_t device) |
get all credentials of given device More... | |
void | oc_sec_remove_cred (oc_sec_cred_t *cred, size_t device) |
remove credential from given device More... | |
bool | oc_sec_remove_cred_by_credid (int credid, size_t device) |
remove credential with credid from given device More... | |
typedef struct oc_cred_data_t oc_cred_data_t |
credential data info
typedef struct oc_sec_certs_data_t oc_sec_certs_data_t |
Selected certificate data used for verification.
typedef bool(* oc_sec_cred_filter_t) (const oc_sec_cred_t *cred, void *user_data) |
Security credential filtering function.
cred | security credential to check |
user_data | user data passed from the caller |
typedef struct oc_sec_cred_t oc_sec_cred_t |
security credential information
typedef struct oc_sec_creds_t oc_sec_creds_t |
credential and rowner information
typedef enum oc_sec_credtype_t oc_sec_credtype_t |
credential type information
typedef enum oc_sec_credusage_t oc_sec_credusage_t |
credential usage
typedef enum oc_sec_encoding_t oc_sec_encoding_t |
Security encoding information.
typedef void(* oc_sec_on_apply_cred_cb_t) (oc_sec_on_apply_cred_data_t data, void *user_data) |
callback invoked with a created / updated credential
data | data with new/updated credential data |
user_data | user data passed from the caller |
typedef bool(* oc_verify_sec_certs_data_fn_t) (const oc_sec_certs_data_t *data, void *user_data) |
Callback function to verify a single certificate.
Return true if certificate is valid, return false otherwise.
enum oc_sec_credtype_t |
enum oc_sec_credusage_t |
credential usage
enum oc_sec_encoding_t |
Security encoding information.
const char* oc_cred_credtype_string | ( | oc_sec_credtype_t | credtype | ) |
credential type to string
credtype | the credential type as type |
oc_sec_credusage_t oc_cred_parse_credusage | ( | const oc_string_t * | credusage_string | ) |
parse credential string to type
credusage_string | credential usage as string |
oc_sec_encoding_t oc_cred_parse_encoding | ( | const oc_string_t * | encoding_string | ) |
parse credential encoding string to type
encoding_string | credential encoding string |
const char* oc_cred_read_credusage | ( | oc_sec_credusage_t | credusage | ) |
read credential usage
credusage | credential usage as type |
const char* oc_cred_read_encoding | ( | oc_sec_encoding_t | encoding | ) |
read credential encoding
encoding | credential encoding as type |
int oc_cred_verify_certificate_chain | ( | const oc_sec_cred_t * | cred, |
oc_verify_sec_certs_data_fn_t | verify_cert, | ||
void * | user_data | ||
) |
Verify the certificate chain associated with the credential.
cred | credential associated with the certificate chain (cannot be NULL) |
verify_cert | function used to verify a single certificate (cannot be NULL) |
user_data | user data from the caller passed to the verify_cert callback |
int oc_sec_apply_cred | ( | const oc_rep_t * | rep, |
const oc_resource_t * | resource, | ||
const oc_endpoint_t * | endpoint, | ||
oc_sec_on_apply_cred_cb_t | on_apply_cred_cb, | ||
void * | on_apply_cred_data | ||
) |
parse payload and add/update credentials
rep | payload to parse |
resource | resource of the credentials |
endpoint | endpoint of the credentials owner |
on_apply_cred_cb | callback invoked when a new credential is added or updated |
on_apply_cred_data | user data passed to the on_apply_cred_cb function |
void oc_sec_cred_clear | ( | size_t | device, |
oc_sec_cred_filter_t | filter, | ||
void * | user_data | ||
) |
remove credentials matching filter from given device
device | index of the device |
filter | filtering function (if NULL all existing credentials match) |
user_data | user data passed from the caller |
oc_sec_cred_t* oc_sec_get_cred_by_credid | ( | int | credid, |
size_t | device | ||
) |
get credential by credid from given device
credid | credential id |
device | index of the device |
oc_sec_creds_t* oc_sec_get_creds | ( | size_t | device | ) |
get all credentials of given device
device | index of the device |
void oc_sec_remove_cred | ( | oc_sec_cred_t * | cred, |
size_t | device | ||
) |
remove credential from given device
cred | credential to remove |
device | index of the device |
bool oc_sec_remove_cred_by_credid | ( | int | credid, |
size_t | device | ||
) |
remove credential with credid from given device
credid | credential id |
device | index of the device |