16 #ifndef M2M_SECURITY_H 17 #define M2M_SECURITY_H 34 friend class M2MNsdlInterface;
56 CloseCertificateChain,
57 ReadDeviceCertificateChain
154 bool delete_resource(SecurityResource rescource, uint16_t instance_id);
166 uint16_t instance_id);
179 uint16_t instance_id);
191 const uint8_t *value,
192 const uint16_t length,
193 uint16_t instance_id);
217 uint16_t instance_id,
218 size_t *buffer_len)
const;
229 const uint8_t *&data,
230 uint16_t instance_id)
const;
241 uint16_t instance_id,
242 size_t *buffer_len)
const;
253 uint16_t instance_id)
const;
262 uint16_t instance_id)
const;
286 M2MResource* get_resource(SecurityResource resource, uint16_t instance_id = 0)
const;
290 void clear_resources();
291 void clear_resources(uint16_t instance_id);
298 friend class Test_M2MSecurity;
299 friend class Test_M2MInterfaceImpl;
300 friend class Test_M2MConnectionSecurityImpl;
301 friend class Test_M2MConnectionHandlerPimpl_linux;
302 friend class Test_M2MConnectionHandlerPimpl_mbed;
303 friend class Test_M2MConnectionSecurityPimpl;
304 friend class Test_M2MNsdlInterface;
305 friend class Test_M2MConnectionHandlerPimpl_classic;
308 #endif // M2M_SECURITY_H Definition: m2mobject.h:35
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.
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:42
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.
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. ...
Definition: m2mresource.h:38
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.