|
Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
#include "liblwm2m.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include "object_security.h"
Classes | |
| struct | _security_instance_ |
Typedefs | |
| typedef struct _security_instance_ | security_instance_t |
Functions | |
| void | security_copy_object (lwm2m_object_t *objectDest, lwm2m_object_t *objectSrc) |
| Create a copy of the security object source into the destination, with freshly allocated internal data. More... | |
| void | security_display_object (lwm2m_object_t *objectP) |
| Print the security object to output, for debugging. More... | |
| void | clean_security_object (lwm2m_object_t *objectP) |
| Free and clean up the security object. More... | |
| lwm2m_object_t * | get_security_object (int serverId, const char *serverUri, char *bsPskId, char *psk, uint16_t pskLen, bool isBootstrap) |
| Create the security object and return a pointer to it. More... | |
| const char * | security_get_server_uri (lwm2m_object_t *objectP, uint16_t secObjInstID) |
| Get the server URI from security object. More... | |
| int32_t | security_get_mode (lwm2m_object_t *objectP, uint16_t secObjInstID) |
| Get the security mode from security object. More... | |
| const char * | security_get_public_id (lwm2m_object_t *objectP, uint16_t secObjInstID, size_t *idLen) |
| Get the public id from security object. More... | |
| const char * | security_get_secret_key (lwm2m_object_t *objectP, uint16_t secObjInstID, size_t *keyLen) |
| Get the secret key from security object. More... | |
| typedef struct _security_instance_ security_instance_t |
| void clean_security_object | ( | lwm2m_object_t * | objectP | ) |
Free and clean up the security object.
| objectP | Pointer to security object |
| lwm2m_object_t* get_security_object | ( | int | serverId, |
| const char * | serverUri, | ||
| char * | bsPskId, | ||
| char * | psk, | ||
| uint16_t | pskLen, | ||
| bool | isBootstrap | ||
| ) |
Create the security object and return a pointer to it.
| serverId | Unique server ID |
| serverUri | URI of the server |
| bsPskId | ID of the psk |
| psk | Pre shared Key |
| pskLen | Length of preshared key |
| isBootstrap | true if bootstrapping |
| void security_copy_object | ( | lwm2m_object_t * | objectDest, |
| lwm2m_object_t * | objectSrc | ||
| ) |
Create a copy of the security object source into the destination, with freshly allocated internal data.
| objectDest | Pointer to the object to write to. |
| objectSrc | Pointer to the object to copy from. |
| void security_display_object | ( | lwm2m_object_t * | objectP | ) |
Print the security object to output, for debugging.
| objectP | Pointer to security object |
| int32_t security_get_mode | ( | lwm2m_object_t * | objectP, |
| uint16_t | secObjInstID | ||
| ) |
Get the security mode from security object.
| objectP | Pointer to security object |
| secObjInstID | Security object ID |
| const char* security_get_public_id | ( | lwm2m_object_t * | objectP, |
| uint16_t | secObjInstID, | ||
| size_t * | idLen | ||
| ) |
Get the public id from security object.
| objectP | Pointer to security object | |
| secObjInstID | Security object ID | |
| [out] | idLen | Pointer to output the length of the id to. |
| const char* security_get_secret_key | ( | lwm2m_object_t * | objectP, |
| uint16_t | secObjInstID, | ||
| size_t * | keyLen | ||
| ) |
Get the secret key from security object.
| objectP | Pointer to security object | |
| secObjInstID | Security object ID | |
| [out] | keyLen | Pointer to output the length of the key to. |
| const char* security_get_server_uri | ( | lwm2m_object_t * | objectP, |
| uint16_t | secObjInstID | ||
| ) |
Get the server URI from security object.
| objectP | Pointer to security object |
| secObjInstID | Security object ID |