IoTivity-Lite
|
Collection of functions to onboard and provision clients and servers. More...
#include "oc_acl.h"
#include "oc_api.h"
#include "oc_cred.h"
#include "oc_pki.h"
#include "oc_role.h"
#include "oc_uuid.h"
Macros | |
#define | DISCOVERY_CB_PERIOD (60) |
The amount of time the stack will wait for a response from a discovery request. More... | |
Typedefs | |
typedef void(* | oc_obt_acl_cb_t) (oc_sec_acl_t *acl, void *data) |
Callback containing the Access Control List (ACL) owned by a remote device. More... | |
typedef void(* | oc_obt_creds_cb_t) (struct oc_sec_creds_t *creds, void *data) |
Callback containing the credentials owned by a remote device. More... | |
typedef void(* | oc_obt_device_status_cb_t) (const oc_uuid_t *uuid, int status, void *data) |
Callback invoked to report the status resulting from many of the onboarding tools actions on a device. More... | |
typedef void(* | oc_obt_discovery_cb_t) (const oc_uuid_t *uuid, const oc_endpoint_t *eps, void *data) |
Callback invoked in response to device discovery. More... | |
typedef void(* | oc_obt_status_cb_t) (int status, void *data) |
Callback invoked to report the status resulting from many of the onboarding tools actions. More... | |
Functions | |
void | oc_obt_ace_add_permission (oc_sec_ace_t *ace, oc_ace_permissions_t permission) |
Set the access permissions the ACE will grant. More... | |
oc_ace_res_t * | oc_obt_ace_new_resource (oc_sec_ace_t *ace) |
Add an ACE resource (oc_ace_res_t ) to the ACE. More... | |
void | oc_obt_ace_resource_set_href (oc_ace_res_t *resource, const char *href) |
Set the href on the ACE resource. More... | |
void | oc_obt_ace_resource_set_wc (oc_ace_res_t *resource, oc_ace_wildcard_t wc) |
Set the wildcard type on the ACE resource. More... | |
oc_role_t * | oc_obt_add_roleid (oc_role_t *roles, const char *role, const char *authority) |
Build a linked list of roles to provision a role certificate. More... | |
int | oc_obt_delete_ace_by_aceid (const oc_uuid_t *uuid, int aceid, oc_obt_status_cb_t cb, void *data) |
Remove an Access Control Entry (ACE) from a remote device's Access Control List (ACL) More... | |
int | oc_obt_delete_cred_by_credid (const oc_uuid_t *uuid, int credid, oc_obt_status_cb_t cb, void *data) |
Delete a credential identified by its credid off a remote device. More... | |
int | oc_obt_delete_own_cred_by_credid (int credid) |
Delete a one of the onboarding tools credentials by credid. More... | |
int | oc_obt_device_hard_reset (const oc_uuid_t *uuid, oc_obt_device_status_cb_t cb, void *data) |
RESET the remote device back to the ready for ownership transfer method (RFOTM) state. More... | |
int | oc_obt_discover_all_resources (const oc_uuid_t *uuid, oc_discovery_all_handler_t handler, void *data) |
Discover all resources on the device identified by its uuid. More... | |
int | oc_obt_discover_owned_devices (oc_obt_discovery_cb_t cb, void *data) |
Discover all devices owned by the onboarding tool. More... | |
int | oc_obt_discover_owned_devices_realm_local_ipv6 (oc_obt_discovery_cb_t cb, void *data) |
Discover all devices owned by the onboarding tool using the realm-local address scope. More... | |
int | oc_obt_discover_owned_devices_site_local_ipv6 (oc_obt_discovery_cb_t cb, void *data) |
Discover all devices owned by the onboarding tool using the site-local address scope. More... | |
int | oc_obt_discover_unowned_devices (oc_obt_discovery_cb_t cb, void *data) |
Discover all unowned devices. More... | |
int | oc_obt_discover_unowned_devices_realm_local_ipv6 (oc_obt_discovery_cb_t cb, void *data) |
Discover all unowned devices using the realm-local address scope. More... | |
int | oc_obt_discover_unowned_devices_site_local_ipv6 (oc_obt_discovery_cb_t cb, void *data) |
Discover all unowned devices using the site-local address scope. More... | |
void | oc_obt_free_ace (oc_sec_ace_t *ace) |
Free the memory associated with the ACE object. More... | |
void | oc_obt_free_acl (oc_sec_acl_t *acl) |
Free an Access Control List (ACL) More... | |
void | oc_obt_free_creds (oc_sec_creds_t *creds) |
Free a list of credentials. More... | |
void | oc_obt_free_roleid (oc_role_t *roles) |
Free the oc_role_t list. More... | |
int | oc_obt_init (void) |
Initialize the IoTivity stack so it can be used as an onboarding tool (OBT) More... | |
oc_sec_ace_t * | oc_obt_new_ace_for_connection (oc_ace_connection_type_t conn) |
Create a new Access Control Entry (ACE) with connection type as the subject. More... | |
oc_sec_ace_t * | oc_obt_new_ace_for_role (const char *role, const char *authority) |
Create a new Access Control Entry (ACE) with a role as the subject. More... | |
oc_sec_ace_t * | oc_obt_new_ace_for_subject (const oc_uuid_t *uuid) |
Create a new Access Control Entry (ACE) with device UUID as subject. More... | |
int | oc_obt_perform_cert_otm (const oc_uuid_t *uuid, oc_obt_device_status_cb_t cb, void *data) |
Perform ownership transfer method (OTM) using Manufacturer Certificate. More... | |
int | oc_obt_perform_just_works_otm (const oc_uuid_t *uuid, oc_obt_device_status_cb_t cb, void *data) |
Perform ownership transfer method (OTM) on the device using Just-Works. More... | |
int | oc_obt_perform_random_pin_otm (const oc_uuid_t *uuid, const unsigned char *pin, size_t pin_len, oc_obt_device_status_cb_t cb, void *data) |
Perform ownership transfer method (OTM) using Random PIN based OTM. More... | |
int | oc_obt_provision_ace (const oc_uuid_t *subject, oc_sec_ace_t *ace, oc_obt_device_status_cb_t cb, void *data) |
Provision an ACE to a device. More... | |
int | oc_obt_provision_auth_wildcard_ace (const oc_uuid_t *subject, oc_obt_device_status_cb_t cb, void *data) |
Provision auth-crypt ACE for the wildcard "*" resource with RW permissions. More... | |
int | oc_obt_provision_identity_certificate (const oc_uuid_t *uuid, oc_obt_status_cb_t cb, void *data) |
Provision identity certificates. More... | |
int | oc_obt_provision_pairwise_credentials (const oc_uuid_t *uuid1, const oc_uuid_t *uuid2, oc_obt_status_cb_t cb, void *data) |
Provision pairwise 128-bit pre-shared key (PSK) credentials to a Client and Server so they may establish a secure (D)TLS session. More... | |
int | oc_obt_provision_role_certificate (oc_role_t *roles, const oc_uuid_t *uuid, oc_obt_status_cb_t cb, void *data) |
Provision a role certificate to a Client application. More... | |
int | oc_obt_provision_role_wildcard_ace (const oc_uuid_t *subject, const char *role, const char *authority, oc_obt_device_status_cb_t cb, void *data) |
Provision a role ACE for the wildcard "*" resource with RW permissions. More... | |
int | oc_obt_provision_trust_anchor (const char *certificate, size_t certificate_size, const char *subject, const oc_uuid_t *uuid, oc_obt_status_cb_t cb, void *data) |
Provision a trust anchor for an cloud enabled server. More... | |
int | oc_obt_request_random_pin (const oc_uuid_t *uuid, oc_obt_device_status_cb_t cb, void *data) |
Ask device being onboarded to produce a random PIN for PIN ownership transfer method (OTM). More... | |
int | oc_obt_retrieve_acl (const oc_uuid_t *uuid, oc_obt_acl_cb_t cb, void *data) |
Retrieve an Access Control List (ACL) from a remote device. More... | |
int | oc_obt_retrieve_cloud_conf_device (const oc_uuid_t *uuid, const char *url, oc_response_handler_t cb, void *user_data) |
sets the data (POST) for the oic.r.coapcloudconf resource More... | |
int | oc_obt_retrieve_creds (const oc_uuid_t *subject, oc_obt_creds_cb_t cb, void *data) |
Retrieve a list of credentials from a remote device owned by the onboarding tool. More... | |
oc_sec_creds_t * | oc_obt_retrieve_own_creds (void) |
Retrieve a list of the onboarding tools own credentials. More... | |
void | oc_obt_set_sd_info (const char *name, bool priv) |
sets the secure domain info More... | |
void | oc_obt_shutdown (void) |
Free all resources associated with the onboarding tool. More... | |
int | oc_obt_update_cloud_conf_device (const oc_uuid_t *uuid, const char *url, const char *at, const char *apn, const char *cis, const char *sid, oc_response_handler_t cb, void *user_data) |
sets the data (POST) for the oic.r.coapcloudconf resource More... | |
Collection of functions to onboard and provision clients and servers.
This collection of functions is intended to be used by an onboarding tool (OBT)
#define DISCOVERY_CB_PERIOD (60) |
The amount of time the stack will wait for a response from a discovery request.
typedef void(* oc_obt_acl_cb_t) (oc_sec_acl_t *acl, void *data) |
Callback containing the Access Control List (ACL) owned by a remote device.
This callback is invoked in response to the oc_obt_retrieve_acl() function. If there was a failure obtaining the ACL, the acl
parameter will be NULL.
[in] | acl | A struct containing ACL installed on a remote device |
[in] | data | context pointer |
typedef void(* oc_obt_creds_cb_t) (struct oc_sec_creds_t *creds, void *data) |
Callback containing the credentials owned by a remote device.
This callback is invoked in response to the oc_obt_retrieve_creds() function. If there was a failure obtaining the credentials the creds
parameter will be NULL.
[in] | creds | A struct containing a linked list of oc_sec_cred_t credentials owned by a remote device |
[in] | data | context pointer |
typedef void(* oc_obt_device_status_cb_t) (const oc_uuid_t *uuid, int status, void *data) |
Callback invoked to report the status resulting from many of the onboarding tools actions on a device.
[in] | uuid | of the device status is being reported on |
[in] | status | number indicating success or failure of action that invoked this callback. Typically status >= 0 indicates success |
[in] | data | context pointer |
typedef void(* oc_obt_discovery_cb_t) (const oc_uuid_t *uuid, const oc_endpoint_t *eps, void *data) |
Callback invoked in response to device discovery.
Example:
[in] | uuid | the uuid of the discovered device |
[in] | eps | list of endpoints that can be used to connect with the discovered device |
[in] | data | context pointer |
typedef void(* oc_obt_status_cb_t) (int status, void *data) |
Callback invoked to report the status resulting from many of the onboarding tools actions.
[in] | status | number indicating success or failure of action that invoked this callback. Typically status >= 0 indicates success |
[in] | data | context pointer |
void oc_obt_ace_add_permission | ( | oc_sec_ace_t * | ace, |
oc_ace_permissions_t | permission | ||
) |
Set the access permissions the ACE will grant.
The function oc_obt_ace_add_permission can be called multiple times to add additional permissions.
calling:
will set the same permissions as calling:
The possible values for the oc_ace_permissions_t bitmask are:
[in,out] | ace | the ACE the permissions are being added to |
[in] | permission | the permissions granted to the ace |
oc_ace_res_t* oc_obt_ace_new_resource | ( | oc_sec_ace_t * | ace | ) |
Add an ACE resource (oc_ace_res_t
) to the ACE.
[in,out] | ace | the ACE that the ACE resource will be added to |
void oc_obt_ace_resource_set_href | ( | oc_ace_res_t * | resource, |
const char * | href | ||
) |
Set the href on the ACE resource.
[in,out] | resource | the ACE resource that the href URL will be added to |
[in] | href | the URL being added to the ACE resource |
void oc_obt_ace_resource_set_wc | ( | oc_ace_res_t * | resource, |
oc_ace_wildcard_t | wc | ||
) |
Set the wildcard type on the ACE resource.
Provisioning of Device Configuration Resources (DCRs) are not affected by the wildcard ACE. Only Non-Configuration Resources (NCRs) are affected by the wildcard resource.
The following resources are DCRs
The possible values for oc_ace_wildcard_t are:
[in,out] | resource | the ACE resource to set the wildcard value on |
[in] | wc | the wildcard value |
oc_role_t* oc_obt_add_roleid | ( | oc_role_t * | roles, |
const char * | role, | ||
const char * | authority | ||
) |
Build a linked list of roles to provision a role certificate.
This function will add a single role (role name and authroity) to a list of rules. If the provided list of roles is empty, it will create a new list with the added role.
Example:
[in] | roles | head of the oc_role_t linked list. NULL if the list has not yet been created |
[in] | role | the role for the role id |
[in] | authority | the role authority for the role id. The role authority is optional if no authority is provided pass in NULL |
int oc_obt_delete_ace_by_aceid | ( | const oc_uuid_t * | uuid, |
int | aceid, | ||
oc_obt_status_cb_t | cb, | ||
void * | data | ||
) |
Remove an Access Control Entry (ACE) from a remote device's Access Control List (ACL)
[in] | uuid | the uuid of the remote device |
[in] | aceid | the id of the Access Control Entry |
[in] | cb | callback invoked to indicate the success or failure of the ACE delete request |
[in] | data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failure int oc_obt_delete_cred_by_credid | ( | const oc_uuid_t * | uuid, |
int | credid, | ||
oc_obt_status_cb_t | cb, | ||
void * | data | ||
) |
Delete a credential identified by its credid off a remote device.
[in] | uuid | the uuid of the device the credential is being deleted from |
[in] | credid | the credid of the credential being deleted |
[in] | cb | callback invoked to indicate the success or failure of the oc_obt_delete_cred_by_credid call |
[in] | data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failure int oc_obt_delete_own_cred_by_credid | ( | int | credid | ) |
Delete a one of the onboarding tools credentials by credid.
[in] | credid | number identifying the credential to delete |
0
on success-1
on failure int oc_obt_device_hard_reset | ( | const oc_uuid_t * | uuid, |
oc_obt_device_status_cb_t | cb, | ||
void * | data | ||
) |
RESET the remote device back to the ready for ownership transfer method (RFOTM) state.
Example:
[in] | uuid | the device being reset |
[in] | cb | callback invoked to indicate the success or failure of the hard reset action |
[in] | data | context pointer that is passed to the oc_obt_device_status_cb_t. The pointer must remain valid till the end of the oc_obt_device_status_cb_t function |
0
on success-1
on failure int oc_obt_discover_all_resources | ( | const oc_uuid_t * | uuid, |
oc_discovery_all_handler_t | handler, | ||
void * | data | ||
) |
Discover all resources on the device identified by its uuid.
[in] | uuid | the uuid of the device the resources are being discovered on |
[in] | handler | the oc_discovery_all_handler_t invoked in responce to this discovery request |
[in] | data | context pointer that is passed to the oc_discovery_all_handler_t callback function. The pointer must remain valid till the more parameter of the oc_discovery_all_handler_t invoked in response to this discover request is false. |
0
on success-1
on failure int oc_obt_discover_owned_devices | ( | oc_obt_discovery_cb_t | cb, |
void * | data | ||
) |
Discover all devices owned by the onboarding tool.
The discovery request will make a muli-cast request to the IPv6 link-local multicast address scope and over IPv4.
Multicast discovery over IPv4 will only happen if the stack is built with the OC_IPV4 build flag.
Read RFC4291 and RFC7346 for more information about IPv6 Reference Scopes.
[in] | cb | the oc_obt_discovery_cb_t that will be called for each discovered device |
[in] | data | context pointer that is passed to the oc_obt_discovery_cb_t the pointer must be a valid pointer till after oc_main_init() call completes. The context pointer must be valid for DISCOVERY_CB_PERIOD seconds after oc_obt_discover_unowned_devices returns. |
0
on success-1
on failure int oc_obt_discover_owned_devices_realm_local_ipv6 | ( | oc_obt_discovery_cb_t | cb, |
void * | data | ||
) |
Discover all devices owned by the onboarding tool using the realm-local address scope.
The discovery request will make a muli-cast request to the IPv6 realm-local multicast address scope. The address scope is the domain in which the multicast discovery packet should be propagated.
Read RFC4291 and RFC7346 for more information about IPv6 Reference Scopes.
[in] | cb | the oc_obt_discovery_cb_t that will be called for each discovered device |
[in] | data | context pointer that is passed to the oc_obt_discovery_cb_t the pointer must be a valid pointer till after oc_main_init() call completes. The context pointer must be valid for DISCOVERY_CB_PERIOD seconds after oc_obt_discover_unowned_devices returns. |
0
on success-1
on failure int oc_obt_discover_owned_devices_site_local_ipv6 | ( | oc_obt_discovery_cb_t | cb, |
void * | data | ||
) |
Discover all devices owned by the onboarding tool using the site-local address scope.
The discovery request will make a muli-cast request to the IPv6 site-local multicast address scope. The address scope is the domain in which the multicast discovery packet should be propagated.
Read RFC4291 and RFC7346 for more information about IPv6 Reference Scopes.
[in] | cb | the oc_obt_discovery_cb_t that will be called for each discovered device |
[in] | data | context pointer that is passed to the oc_obt_discovery_cb_t the pointer must be a valid pointer till after oc_main_init() call completes. The context pointer must be valid for DISCOVERY_CB_PERIOD seconds after oc_obt_discover_unowned_devices returns. |
0
on success-1
on failure int oc_obt_discover_unowned_devices | ( | oc_obt_discovery_cb_t | cb, |
void * | data | ||
) |
Discover all unowned devices.
The discovery request will make a muli-cast request to the IPv6 link-local multicast address scope and over IPv4.
Multicast discovery over IPv4 will only happen if the stack is built with the OC_IPV4 build flag.
Read RFC4291 and RFC7346 for more information about IPv6 Reference Scopes.
[in] | cb | the oc_obt_discovery_cb_t that will be called for each discovered device |
[in] | data | context pointer that is passed to the oc_obt_discovery_cb_t the pointer must be a valid pointer till after oc_main_init() call completes. The context pointer must be valid for DISCOVERY_CB_PERIOD seconds after the oc_obt_discover_unowned_devices function returns. |
0
on success-1
on failure int oc_obt_discover_unowned_devices_realm_local_ipv6 | ( | oc_obt_discovery_cb_t | cb, |
void * | data | ||
) |
Discover all unowned devices using the realm-local address scope.
The discovery request will make a muli-cast request to the IPv6 realm-local multicast address scope. The address scope is the domain in which the multicast discovery packet should be propagated.
Read RFC4291 and RFC7346 for more information about IPv6 Reference Scopes.
[in] | cb | the oc_obt_discovery_cb_t that will be called for each discovered device |
[in] | data | context pointer that is passed to the oc_obt_discovery_cb_t the pointer must be a valid pointer till after oc_main_init() call completes. The context pointer must be valid for DISCOVERY_CB_PERIOD seconds after oc_obt_discover_unowned_devices returns. |
0
on success-1
on failure int oc_obt_discover_unowned_devices_site_local_ipv6 | ( | oc_obt_discovery_cb_t | cb, |
void * | data | ||
) |
Discover all unowned devices using the site-local address scope.
The discovery request will make a muli-cast request to the IPv6 site-local multicast address scope. The address scope is the domain in which the multicast discovery packet should be propagated.
Read RFC4291 and RFC7346 for more information about IPv6 Reference Scopes.
[in] | cb | the oc_obt_discovery_cb_t that will be called for each discovered device |
[in] | data | context pointer that is passed to the oc_obt_discovery_cb_t the pointer must be a valid pointer till after oc_main_init() call completes. The context pointer must be valid for DISCOVERY_CB_PERIOD seconds after oc_obt_discover_unowned_devices returns. |
0
on success-1
on failure void oc_obt_free_ace | ( | oc_sec_ace_t * | ace | ) |
Free the memory associated with the ACE object.
ace | the ACE that will be freed |
void oc_obt_free_acl | ( | oc_sec_acl_t * | acl | ) |
Free an Access Control List (ACL)
This will free all Access Control Entries (ACE) in the ACL as well as the ACL itself
acl | pointer to the head of an ACL |
void oc_obt_free_creds | ( | oc_sec_creds_t * | creds | ) |
Free a list of credentials.
creds | the list of credentials to free |
void oc_obt_free_roleid | ( | oc_role_t * | roles | ) |
Free the oc_role_t list.
roles | the head of the oc_role_t list |
int oc_obt_init | ( | void | ) |
Initialize the IoTivity stack so it can be used as an onboarding tool (OBT)
Call once at startup for OBT initialization
Persistent storage must be initialized before calling oc_obt_init()
example:
0
on success-1
on failure oc_sec_ace_t* oc_obt_new_ace_for_connection | ( | oc_ace_connection_type_t | conn | ) |
Create a new Access Control Entry (ACE) with connection type as the subject.
[in] | conn | the connection type for the ACE |
oc_sec_ace_t* oc_obt_new_ace_for_role | ( | const char * | role, |
const char * | authority | ||
) |
Create a new Access Control Entry (ACE) with a role as the subject.
[in] | role | the role associated with the ACE |
[in] | authority | the role authority for the ACE. The role authority is optional if no authority is provided pass in NULL |
oc_sec_ace_t* oc_obt_new_ace_for_subject | ( | const oc_uuid_t * | uuid | ) |
Create a new Access Control Entry (ACE) with device UUID as subject.
[in] | uuid | the uuid of the device |
int oc_obt_perform_cert_otm | ( | const oc_uuid_t * | uuid, |
oc_obt_device_status_cb_t | cb, | ||
void * | data | ||
) |
Perform ownership transfer method (OTM) using Manufacturer Certificate.
The manufacturer certificate-based OTM uses a certificate embedded into the device by the manufacturer to perform the OTM.
[in] | uuid | the device to certificate based OTM is being done on |
[in] | cb | callback invoked to indicate the success or failure of the Manufacturer Certificate Based OTM |
[in] | data | context pointer that is passed to the oc_obt_device_status_cb_t. The pointer must remain valid till the end of the oc_obt_device_status_cb_t function |
0
on success-1
on failure int oc_obt_perform_just_works_otm | ( | const oc_uuid_t * | uuid, |
oc_obt_device_status_cb_t | cb, | ||
void * | data | ||
) |
Perform ownership transfer method (OTM) on the device using Just-Works.
Just-Works OTM creates a symmetric key credential that is a pre-shared key used to establish a secure connection.
OTM using this method is subject to a man-in-the-middle attacker. This method assumes onboarding happens in a relatively safe environment absent of an attack device.
Example:
[in] | uuid | the uuid of the device the OTM is being run on. The uuid is typically obtained in response to an oc_obt_discover_unowned_devices* call. |
[in] | cb | callback invoked to indicate the success or failure of the OTM |
[in] | data | context pointer that is passed to the oc_obt_device_status_cb_t. The pointer must remain valid till the end of the oc_obt_device_status_cb_t function. |
0
on success-1
on failure int oc_obt_perform_random_pin_otm | ( | const oc_uuid_t * | uuid, |
const unsigned char * | pin, | ||
size_t | pin_len, | ||
oc_obt_device_status_cb_t | cb, | ||
void * | data | ||
) |
Perform ownership transfer method (OTM) using Random PIN based OTM.
Since the Random PIN establishes physical proximity between the new device and the onboarding tool (OBT) it helps prevent man-in-the-middle attacks.
Example:
[in] | uuid | the device the Random PIN based OTM is being done on |
[in] | pin | the PIN obtained from the remote device in response to the oc_obt_request_random_pin |
[in] | pin_len | the length of the PIN |
[in] | cb | callback invoked to indicate the success or failure of the Random PIN OTM operation |
[in] | data | context pointer that is passed to the oc_obt_device_status_cb_t. The pointer must remain valid till the end of the oc_obt_device_status_cb_t function |
0
on success-1
on failureint oc_obt_provision_ace | ( | const oc_uuid_t * | subject, |
oc_sec_ace_t * | ace, | ||
oc_obt_device_status_cb_t | cb, | ||
void * | data | ||
) |
Provision an ACE to a device.
Example:
[in] | subject | the uuid of the device being provisioned |
[in] | ace | the ACE being added to the subject |
[in] | cb | callback invoked to indicate the success or failure of the provisioning |
[in] | data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failure int oc_obt_provision_auth_wildcard_ace | ( | const oc_uuid_t * | subject, |
oc_obt_device_status_cb_t | cb, | ||
void * | data | ||
) |
Provision auth-crypt ACE for the wildcard "*" resource with RW permissions.
This is a helper function to quickly provision an ACE for wildcard access over secure connections.
[in] | subject | the uuid or the device being provisioned |
[in] | cb | callback invoked to indicate the success or failure of the provisioning |
[in] | data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failureint oc_obt_provision_identity_certificate | ( | const oc_uuid_t * | uuid, |
oc_obt_status_cb_t | cb, | ||
void * | data | ||
) |
Provision identity certificates.
To provision identity certificates the IoTivity stack must be built with OC_PKI defined.
Example:
[in] | uuid | the uuid of the device to provision |
[in] | cb | callback invoked to indicate the success or failure of the provisioning |
[in] | data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failure int oc_obt_provision_pairwise_credentials | ( | const oc_uuid_t * | uuid1, |
const oc_uuid_t * | uuid2, | ||
oc_obt_status_cb_t | cb, | ||
void * | data | ||
) |
Provision pairwise 128-bit pre-shared key (PSK) credentials to a Client and Server so they may establish a secure (D)TLS session.
Example:
[in] | uuid1 | uuid of the first device to pair |
[in] | uuid2 | uuid of the second device to pair |
[in] | cb | callback invoked to indicate the success or failure of the pairwise credentials provisioning |
[in] | data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failure int oc_obt_provision_role_certificate | ( | oc_role_t * | roles, |
const oc_uuid_t * | uuid, | ||
oc_obt_status_cb_t | cb, | ||
void * | data | ||
) |
Provision a role certificate to a Client application.
Example:
roles | the role(s) to provision |
uuid | the uuid of the device to provision |
cb | callback invoked to indicate the success or failure of the provisioning |
data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failureint oc_obt_provision_role_wildcard_ace | ( | const oc_uuid_t * | subject, |
const char * | role, | ||
const char * | authority, | ||
oc_obt_device_status_cb_t | cb, | ||
void * | data | ||
) |
Provision a role ACE for the wildcard "*" resource with RW permissions.
This is a helper function to quickly provision a role ACE for wildcard access.
[in] | subject | the uuid or the device being provisioned |
[in] | role | the role for the ACE |
[in] | authority | the role authority for the ACE. The role authority is optional if no authority is provided pass in NULL |
[in] | cb | callback invoked to indicate the success or failure of the provisioning |
[in] | data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failureint oc_obt_provision_trust_anchor | ( | const char * | certificate, |
size_t | certificate_size, | ||
const char * | subject, | ||
const oc_uuid_t * | uuid, | ||
oc_obt_status_cb_t | cb, | ||
void * | data | ||
) |
Provision a trust anchor for an cloud enabled server.
certificate | the certificate data |
certificate_size | the certificate data size |
subject | id (the uuid of the cloud) |
uuid | the uuid of the device to provision |
cb | callback invoked to indicate the success or failure of the provisioning |
data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failureint oc_obt_request_random_pin | ( | const oc_uuid_t * | uuid, |
oc_obt_device_status_cb_t | cb, | ||
void * | data | ||
) |
Ask device being onboarded to produce a random PIN for PIN ownership transfer method (OTM).
This will cause the oc_random_pin_cb_t to be invoked on the remote device. The remote device is expected to generate and communicate a random PIN using an Out-of-Band communication channel. For example display the pin on a screen that the user can read. The Out-of-band communication is an implementation detail that is left up to the developer.
The Random PIN establishes physical proximity between the new device and the onboarding tool (OBT).
[in] | uuid | the uuid of the device the oc_random_pin_cb_t is being run on. The uuid is typically obtained in response to an oc_obt_discover_unowned_devices* call |
[in] | cb | callback invoked to indicate the success or failure of the random PIN request |
[in] | data | context pointer that is passed to the oc_obt_device_status_cb_t. The pointer must remain valid till the end of the oc_obt_device_status_cb_t function |
0
on success-1
on failureint oc_obt_retrieve_acl | ( | const oc_uuid_t * | uuid, |
oc_obt_acl_cb_t | cb, | ||
void * | data | ||
) |
Retrieve an Access Control List (ACL) from a remote device.
[in] | uuid | the uuid of the remote device |
[in] | cb | callback that will deliver the requested ACL |
[in] | data | context pointer that is passed to the oc_obt_acl_cb_t. The pointer must remain valid till after the oc_obt_acl_cb_t has completed. |
0
on success-1
on failure int oc_obt_retrieve_cloud_conf_device | ( | const oc_uuid_t * | uuid, |
const char * | url, | ||
oc_response_handler_t | cb, | ||
void * | user_data | ||
) |
sets the data (POST) for the oic.r.coapcloudconf resource
[in] | uuid | the uuid of the remote device |
[in] | url | of the resource |
[in] | cb | callback invoked to indicate the success or failure of the request |
[in] | user_data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failure int oc_obt_retrieve_creds | ( | const oc_uuid_t * | subject, |
oc_obt_creds_cb_t | cb, | ||
void * | data | ||
) |
Retrieve a list of credentials from a remote device owned by the onboarding tool.
[in] | subject | uuid of the device the credentials will be fetched from |
[in] | cb | callback that will contain the list of credentials from the remote device |
[in] | data | context pointer that is passed to the oc_obt_creds_cb_t. The pointer must remain valid till after the oc_obt_creds_cb_t has completed. |
0
on success-1
on failure oc_sec_creds_t* oc_obt_retrieve_own_creds | ( | void | ) |
Retrieve a list of the onboarding tools own credentials.
The credentials returned by oc_obt_retrieve_own_creds() point to an internal data structures that store the security context of the OBT. DO NOT free them. Use oc_obt_delete_own_cred_by_credid() to remove credentials from the OBT.
void oc_obt_set_sd_info | ( | const char * | name, |
bool | priv | ||
) |
sets the secure domain info
[in] | name | the name of the secure domain |
[in] | priv | privacy indicator |
void oc_obt_shutdown | ( | void | ) |
Free all resources associated with the onboarding tool.
Called when the OBT terminates.
int oc_obt_update_cloud_conf_device | ( | const oc_uuid_t * | uuid, |
const char * | url, | ||
const char * | at, | ||
const char * | apn, | ||
const char * | cis, | ||
const char * | sid, | ||
oc_response_handler_t | cb, | ||
void * | user_data | ||
) |
sets the data (POST) for the oic.r.coapcloudconf resource
[in] | uuid | the uuid of the remote device |
[in] | url | of the resource |
[in] | at | Access Token |
[in] | apn | Auth Provider Name |
[in] | cis | OCF Cloud interface URL |
[in] | sid | OCF Cloud UUID |
[in] | cb | callback invoked to indicate the success or failure of the request |
[in] | user_data | context pointer that is passed to the oc_obt_status_cb_t. The pointer must remain valid till the end of the oc_obt_status_cb_t function |
0
on success-1
on failure