16 #ifndef M2M_SECURITY_H 17 #define M2M_SECURITY_H 34 friend class M2MNsdlInterface;
56 CloseCertificateChain,
57 ReadDeviceCertificateChain
146 bool delete_resource(SecurityResource rescource, uint16_t instance_id);
158 uint16_t instance_id);
171 uint16_t instance_id);
183 const uint8_t *value,
184 const uint16_t length,
185 uint16_t instance_id);
209 uint16_t instance_id,
210 size_t *buffer_len)
const;
221 const uint8_t *&data,
222 uint16_t instance_id)
const;
233 uint16_t instance_id,
234 size_t *buffer_len)
const;
245 uint16_t instance_id)
const;
254 uint16_t instance_id)
const;
278 M2MResource* get_resource(SecurityResource resource, uint16_t instance_id = 0)
const;
282 void clear_resources(uint16_t instance_id = 0);
287 friend class Test_M2MSecurity;
288 friend class Test_M2MInterfaceImpl;
289 friend class Test_M2MConnectionSecurityImpl;
290 friend class Test_M2MConnectionHandlerPimpl_linux;
291 friend class Test_M2MConnectionHandlerPimpl_mbed;
292 friend class Test_M2MConnectionSecurityPimpl;
293 friend class Test_M2MNsdlInterface;
294 friend class Test_M2MConnectionHandlerPimpl_classic;
297 #endif // M2M_SECURITY_H The base class for Client Objects.
Definition: m2mobject.h:39
Definition: m2mserver.h:31
String resource_value_string(SecurityResource resource, uint16_t instance_id) const
Returns the value of a given resource enum, in string format.
ServerType
An enum defining an interface operation that can be handled by the Security Object.
Definition: m2msecurity.h:76
uint32_t resource_value_int(SecurityResource resource, uint16_t instance_id) const
Returns the value of a given resource name, in integer format.
M2MObject. This class is the base class for the mbed Client Objects.
bool is_resource_present(SecurityResource resource, uint16_t instance_id) const
Returns whether a resource instance with a given resource enum exists or not.
SecurityResource
An enum defining all resources associated with a Security Object in the LWM2M framework.
Definition: m2msecurity.h:42
static M2MSecurity * get_instance()
Get the singleton instance of M2MSecurity.
Definition: m2mobjectinstance.h:36
bool set_resource_value(SecurityResource resource, const String &value, uint16_t instance_id)
Sets the value of a given resource enum.
Definition: m2msecurity.h:31
M2MObjectInstance * create_object_instance(ServerType server_type)
Creates a new object instance.
Definition: m2mstring.h:33
bool delete_resource(SecurityResource rescource, uint16_t instance_id)
Deletes a resource with a given resource enum. Mandatory resources cannot be deleted.
static void delete_instance()
Delete the singleton instance of M2MSecurity.
void remove_security_instances()
Remove all security object instances.
uint16_t total_resource_count(uint16_t instance_id) const
Returns the total number of resources for a security object.
int32_t get_security_instance_id(ServerType server_type) const
Returns first bootstrap or lwm2m server security object instance id.
int resource_value_buffer(SecurityResource resource, uint8_t *&data, uint16_t instance_id, size_t *buffer_len) const
Populates the data buffer and returns the size of the buffer.
ServerType server_type(uint16_t instance_id) const
Returns the type of the Security Object. It can be either Bootstrap or M2MServer. ...
The base class for Client Resources.
Definition: m2mresource.h:40
SecurityModeType
An enum defining the type of the security attribute used by the Security Object.
Definition: m2msecurity.h:64
Definition: m2minterfacefactory.h:36
M2MResource * create_resource(SecurityResource rescource, uint32_t value, uint16_t instance_id)
Creates a new resource for a given resource enum.
uint16_t instance_id() const
Returns the object's instance ID.
int resource_value_buffer_size(SecurityResource resource, uint16_t instance_id, size_t *buffer_len) const
Get a size of the buffer.