7cf06a18b006af06b1e7ec5ab5711a39ebcdca79
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / ocprovisioningmanager.h
1 /* *****************************************************************\r
2  *\r
3  * Copyright 2015 Samsung Electronics All Rights Reserved.\r
4  *\r
5  *\r
6  *\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  *     http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  *\r
19  * *****************************************************************/\r
20 \r
21 #ifndef OCPROVISIONINGMANAGER_H_\r
22 #define OCPROVISIONINGMANAGER_H_\r
23 \r
24 #include "octypes.h"\r
25 #include "pmtypes.h"\r
26 #include "ownershiptransfermanager.h"\r
27 #ifdef _ENABLE_MULTIPLE_OWNER_\r
28 #include "securevirtualresourcetypes.h"\r
29 #endif //_ENABLE_MULTIPLE_OWNER_\r
30 \r
31 #ifdef __cplusplus\r
32 extern "C" {\r
33 #endif // __cplusplus\r
34 \r
35 /**\r
36  * The function is responsible for initializaton of the provisioning manager. It will load\r
37  * provisioning database which have owned device's list and their linked status.\r
38  * TODO: In addition, if there is a device(s) which has not up-to-date credentials, this function will\r
39  * automatically try to update the deivce(s).\r
40  *\r
41  * @param[in] dbPath file path of the sqlite3 db\r
42  *\r
43  * @return OC_STACK_OK in case of success and other value otherwise.\r
44  */\r
45 OCStackResult OCInitPM(const char* dbPath);\r
46 \r
47 /**\r
48  * The function is responsible for discovery of owned/unowned device is specified endpoint/deviceID.\r
49  * It will return the found device even though timeout is not exceeded.\r
50  *\r
51  * @param[in] timeout Timeout in seconds, value till which function will listen to responses from\r
52  *                    server before returning the device.\r
53  * @param[in] deviceID         deviceID of target device.\r
54  * @param[out] ppFoundDevice     OCProvisionDev_t of found device\r
55  * @return OTM_SUCCESS in case of success and other value otherwise.\r
56  */\r
57 OCStackResult OCDiscoverSingleDevice(unsigned short timeout, const OicUuid_t* deviceID,\r
58                              OCProvisionDev_t **ppFoundDevice);\r
59 \r
60 /**\r
61  * The function is responsible for discovery of device is current subnet. It will list\r
62  * all the device in subnet which are not yet owned. Please call OCInit with OC_CLIENT_SERVER as\r
63  * OCMode.\r
64  *\r
65  * @param[in] timeout Timeout in seconds, value till which function will listen to responses from\r
66  *                    server before returning the list of devices.\r
67  * @param[out] ppList List of candidate devices to be provisioned\r
68  * @return OTM_SUCCESS in case of success and other value otherwise.\r
69  */\r
70 OCStackResult OCDiscoverUnownedDevices(unsigned short waittime, OCProvisionDev_t **ppList);\r
71 \r
72 /**\r
73  * Do ownership transfer for un-owned device.\r
74  *\r
75  * @param[in] ctx Application context would be returned in result callback\r
76  * @param[in] targetDevices List of devices to perform ownership transfer.\r
77  * @param[in] resultCallback Result callback function to be invoked when ownership transfer finished.\r
78  * @return OC_STACK_OK in case of success and other value otherwise.\r
79  */\r
80 OCStackResult OCDoOwnershipTransfer(void* ctx,\r
81                                     OCProvisionDev_t *targetDevices,\r
82                                     OCProvisionResultCB resultCallback);\r
83 \r
84 /**\r
85  * API to set a allow status of OxM\r
86  *\r
87  * @param[in] oxm Owership transfer method (ref. OicSecOxm_t)\r
88  * @param[in] allowStatus allow status (true = allow, false = not allow)\r
89  *\r
90  * @return OC_STACK_OK in case of success and other value otherwise.\r
91  */\r
92 OCStackResult OCSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus);\r
93 \r
94 #ifdef _ENABLE_MULTIPLE_OWNER_\r
95 /**\r
96  * API to perfrom multiple ownership transfer for MOT enabled device.\r
97  *\r
98  * @param[in] ctx Application context would be returned in result callback\r
99  * @param[in] targetDevices List of devices to perform ownership transfer.\r
100  * @param[in] resultCallback Result callback function to be invoked when ownership transfer finished.\r
101  * @return OC_STACK_OK in case of success and other value otherwise.\r
102  */\r
103 OCStackResult OCDoMultipleOwnershipTransfer(void* ctx,\r
104                                       OCProvisionDev_t *targetDevices,\r
105                                       OCProvisionResultCB resultCallback);\r
106 #endif //_ENABLE_MULTIPLE_OWNER_\r
107 \r
108 /**\r
109  * API to register for particular OxM.\r
110  *\r
111  * @param[in] Ownership transfer method.\r
112  * @param[in] Implementation of callback functions for owership transfer.\r
113  * @return OC_STACK_OK in case of success and other value otherwise.\r
114  */\r
115 OCStackResult OCSetOwnerTransferCallbackData(OicSecOxm_t oxm, OTMCallbackData_t* callbackData);\r
116 \r
117 /**\r
118  * The function is responsible for discovery of owned device is current subnet. It will list\r
119  * all the device in subnet which are owned by calling provisioning client.\r
120  *\r
121  * @param[in] timeout Timeout in seconds, value till which function will listen to responses from\r
122  *                    server before returning the list of devices.\r
123  * @param[out] ppList List of device owned by provisioning tool.\r
124  * @return OTM_SUCCESS in case of success and other value otherwise.\r
125  */\r
126 OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);\r
127 \r
128 #ifdef _ENABLE_MULTIPLE_OWNER_\r
129 /**\r
130  * The function is responsible for discovery of MOT enabled device is current subnet.\r
131  *\r
132  * @param[in] timeout Timeout in seconds, value till which function will listen to responses from\r
133  *                    server before returning the list of devices.\r
134  * @param[out] ppList List of MOT enabled devices.\r
135  * @return OC_STACK_OK in case of success and other value otherwise.\r
136  */\r
137 OCStackResult OCDiscoverMultipleOwnerEnabledDevices(unsigned short timeout, OCProvisionDev_t **ppList);\r
138 \r
139 /**\r
140  * The function is responsible for discovery of Multiple Owned device is current subnet.\r
141  *\r
142  * @param[in] timeout Timeout in seconds, value till which function will listen to responses from\r
143  *                    server before returning the list of devices.\r
144  * @param[out] ppList List of Multiple Owned devices.\r
145  * @return OC_STACK_OK in case of success and other value otherwise.\r
146  */\r
147 OCStackResult OCDiscoverMultipleOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);\r
148 #endif //_ENABLE_MULTIPLE_OWNER_\r
149 \r
150 /**\r
151  * API to provision credentials between two devices and ACLs for the devices who act as a server.\r
152  *\r
153  * @param[in] ctx Application context would be returned in result callback.\r
154  * @param[in] type Type of credentials to be provisioned to the device.\r
155  * @param[in] pDev1 Pointer to OCProvisionDev_t instance,respresenting device to be provisioned.\r
156  * @param[in] acl ACL for device 1. If this is not required set NULL.\r
157  * @param[in] pDev2 Pointer to OCProvisionDev_t instance,respresenting device to be provisioned.\r
158  * @param[in] acl ACL for device 2. If this is not required set NULL.\r
159  * @param[in] resultCallback callback provided by API user, callback will be called when\r
160  *            provisioning request recieves a response from first resource server.\r
161  * @return OC_STACK_OK in case of success and other value otherwise.\r
162  */\r
163 OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize,\r
164                                          const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl,\r
165                                          const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl,\r
166                                          OCProvisionResultCB resultCallback);\r
167 \r
168 /**\r
169  * API to send ACL information to device.\r
170  *\r
171  * @param[in] ctx Application context would be returned in result callback.\r
172  * @param[in] selectedDeviceInfo Selected target device.\r
173  * @param[in] acl ACL to provision.\r
174  * @param[in] resultCallback callback provided by API user, callback will be called when provisioning\r
175               request recieves a response from resource server.\r
176  * @return OC_STACK_OK in case of success and other value otherwise.\r
177  */\r
178 OCStackResult OCProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,\r
179                              OCProvisionResultCB resultCallback);\r
180 \r
181 /**\r
182  * function to save ACL which has several ACE into Acl of SVR.\r
183  *\r
184  * @param acl ACL to be saved in Acl of SVR.\r
185  * @return  OC_STACK_OK in case of success and other value otherwise.\r
186  */\r
187 OCStackResult OCSaveACL(const OicSecAcl_t* acl);\r
188 \r
189 /**\r
190  * this function requests CRED information to resource.\r
191  *\r
192  * @param[in] ctx Application context would be returned in result callback.\r
193  * @param[in] selectedDeviceInfo Selected target device.\r
194  * @param[in] resultCallback callback provided by API user, callback will be called when provisioning\r
195               request recieves a response from resource server.\r
196  * @return  OC_STACK_OK in case of success and other value otherwise.\r
197  */\r
198 OCStackResult OCGetCredResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,\r
199                              OCProvisionResultCB resultCallback);\r
200 \r
201 /**\r
202  * this function requests ACL information to resource.\r
203  *\r
204  * @param[in] ctx Application context would be returned in result callback.\r
205  * @param[in] selectedDeviceInfo Selected target device.\r
206  * @param[in] resultCallback callback provided by API user, callback will be called when provisioning\r
207               request recieves a response from resource server.\r
208  * @return  OC_STACK_OK in case of success and other value otherwise.\r
209  */\r
210 OCStackResult OCGetACLResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,\r
211                              OCProvisionResultCB resultCallback);\r
212 \r
213 /**\r
214  * this function sends Direct-Pairing Configuration to a device.\r
215  *\r
216  * @param[in] ctx Application context would be returned in result callback.\r
217  * @param[in] selectedDeviceInfo Selected target device.\r
218  * @param[in] pconf PCONF pointer.\r
219  * @param[in] resultCallback callback provided by API user, callback will be called when provisioning\r
220               request recieves a response from resource server.\r
221  * @return  OC_STACK_OK in case of success and other value otherwise.\r
222  */\r
223 OCStackResult OCProvisionDirectPairing(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecPconf_t *pconf,\r
224                              OCProvisionResultCB resultCallback);\r
225 \r
226 /**\r
227  * API to provision credential to devices.\r
228  *\r
229  * @param[in] ctx Application context would be returned in result callback.\r
230  * @param[in] type Type of credentials to be provisioned to the device.\r
231  * @param[in] pDev1 Pointer to OCProvisionDev_t instance,respresenting resource to be provsioned.\r
232    @param[in] pDev2 Pointer to OCProvisionDev_t instance,respresenting resource to be provsioned.\r
233  * @param[in] resultCallback callback provided by API user, callback will be called when\r
234  *            provisioning request recieves a response from first resource server.\r
235  * @return OC_STACK_OK in case of success and other value otherwise.\r
236  */\r
237 OCStackResult OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t keySize,\r
238                                       const OCProvisionDev_t *pDev1,\r
239                                       const OCProvisionDev_t *pDev2,\r
240                                       OCProvisionResultCB resultCallback);\r
241 \r
242 #ifdef _ENABLE_MULTIPLE_OWNER_\r
243 /**\r
244  * API to provision preconfigured PIN to device(NOT LIST).\r
245  * If device does not support the Preconfigured PIN OxM,\r
246  * OCProvisionPreconfigPin API will update the device's Doxm\r
247  * and then try preconfigured PIN provisioning once again.\r
248  *\r
249  * @param[in] ctx Application context would be returned in result callback.\r
250  * @param[in] targetDeviceInfo Selected target device.\r
251  * @param[in] preconfigPin string of preconfigured PIN.\r
252  * @param[in] preconfigPinLen string length of 'preconfigPin'.\r
253  * @param[in] resultCallback callback provided by API user, callback will be called when\r
254  *            provisioning request recieves a response from first resource server.\r
255  * @return OC_STACK_OK in case of success and other value otherwise.\r
256  */\r
257 OCStackResult OCProvisionPreconfigPin(void *ctx,\r
258                                       OCProvisionDev_t *targetDeviceInfo,\r
259                                       const char *preconfigPin,\r
260                                       size_t preconfigPinLen,\r
261                                       OCProvisionResultCB resultCallback);\r
262 \r
263 /**\r
264  * API to add preconfigured PIN to local SVR DB.\r
265  *\r
266  * @param[in] targetDeviceInfo Selected target device.\r
267  * @param[in] preconfigPin Preconfig PIN which is used while multiple owner authentication\r
268  * @param[in] preconfigPinLen Byte length of preconfigPin\r
269  * @return OC_STACK_OK in case of success and other value otherwise.\r
270  */\r
271 OCStackResult OCAddPreconfigPin(const OCProvisionDev_t *targetDeviceInfo,\r
272                                 const char *preconfigPin,\r
273                                 size_t preconfigPinLen);\r
274 \r
275 /**\r
276  * API to update 'doxm.mom' to resource server.\r
277  *\r
278  * @param[in] targetDeviceInfo Selected target device.\r
279  * @param[in] momType Mode of multiple ownership transfer (ref. oic.sec.mom)\r
280  * @param[in] resultCallback callback provided by API user, callback will be called when\r
281  *            POST 'mom' request recieves a response from resource server.\r
282  * @return OC_STACK_OK in case of success and other value otherwise.\r
283  */\r
284 OCStackResult OCChangeMOTMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo,\r
285                             const OicSecMomType_t momType, OCProvisionResultCB resultCallback);\r
286 \r
287 /**\r
288  * API to update 'doxm.oxmsel' to resource server.\r
289  *\r
290  * @param[in] targetDeviceInfo Selected target device.\r
291  * @param[in] oxmSelValue Method of multiple ownership transfer (ref. oic.sec.oxm)\r
292  * @param[in] resultCallback callback provided by API user, callback will be called when\r
293  *            POST 'oxmsel' request recieves a response from resource server.\r
294  * @return OC_STACK_OK in case of success and other value otherwise.\r
295  */\r
296 OCStackResult OCSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,\r
297                                  const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback);\r
298 #endif //_ENABLE_MULTIPLE_OWNER_\r
299 \r
300 /**\r
301  * Function to unlink devices.\r
302  * This function will remove the credential & relasionship between the two devices.\r
303  *\r
304  * @param[in] ctx Application context would be returned in result callback\r
305  * @param[in] pTargetDev1 fitst device information to be unlinked.\r
306  * @param[in] pTargetDev2 second device information to be unlinked.\r
307  * @param[in] resultCallback callback provided by API user, callback will be called when\r
308  *            device unlink is finished.\r
309  * @return OC_STACK_OK in case of success and other value otherwise.\r
310  */\r
311 OCStackResult OCUnlinkDevices(void* ctx,\r
312                               const OCProvisionDev_t* pTargetDev1,\r
313                               const OCProvisionDev_t* pTargetDev2,\r
314                               OCProvisionResultCB resultCallback);\r
315 \r
316 /**\r
317  * Function for device revocation\r
318  * This function will remove credential of target device from all devices in subnet.\r
319  *\r
320  * @param[in] ctx Application context would be returned in result callback\r
321  * @param[in] waitTimeForOwnedDeviceDiscovery Maximum wait time for owned device discovery.(seconds)\r
322  * @param[in] pTargetDev Device information to be revoked.\r
323  * @param[in] resultCallback callback provided by API user, callback will be called when\r
324  *            credential revocation is finished.\r
325  * @return OC_STACK_OK in case of success and other value otherwise.\r
326  *         if OC_STACK_OK is returned, the caller of this API should wait for callback.\r
327  *         OC_STACK_CONTINUE means operation is success but no need to wait for callback.\r
328  */\r
329 OCStackResult OCRemoveDevice(void* ctx,\r
330                              unsigned short waitTimeForOwnedDeviceDiscovery,\r
331                              const OCProvisionDev_t* pTargetDev,\r
332                              OCProvisionResultCB resultCallback);\r
333 \r
334 /*\r
335 * Function to device revocation\r
336 * This function will remove credential of target device from all devices in subnet.\r
337 *\r
338 * @param[in] ctx Application context would be returned in result callback\r
339 * @param[in] waitTimeForOwnedDeviceDiscovery Maximum wait time for owned device discovery.(seconds)\r
340 * @param[in] pTargetDev Device information to be revoked.\r
341 * @param[in] resultCallback callback provided by API user, callback will be called when\r
342 *            credential revocation is finished.\r
343  * @return  OC_STACK_OK in case of success and other value otherwise.\r
344 */\r
345 OCStackResult OCRemoveDeviceWithUuid(void* ctx,\r
346                                      unsigned short waitTimeForOwnedDeviceDiscovery,\r
347                                      const OicUuid_t* pTargetUuid,\r
348                                      OCProvisionResultCB resultCallback);\r
349 \r
350 /*\r
351  * Function to reset the target device.\r
352  * This function will remove credential and ACL of target device from all devices in subnet.\r
353  *\r
354  * @param[in] ctx Application context would be returned in result callback\r
355  * @param[in] waitTimeForOwnedDeviceDiscovery Maximum wait time for owned device discovery.(seconds)\r
356  * @param[in] pTargetDev Device information to be revoked.\r
357  * @param[in] resultCallback callback provided by API user, callback will be called when\r
358  *            credential revocation is finished.\r
359  * @return  OC_STACK_OK in case of success and other value otherwise.\r
360  */\r
361 OCStackResult OCResetDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,\r
362                             const OCProvisionDev_t* pTargetDev,\r
363                             OCProvisionResultCB resultCallback);\r
364 \r
365 /**\r
366  * API to get status of all the devices in current subnet. The status include endpoint information\r
367  * and doxm information which can be extracted duing owned and unowned discovery. Along with this\r
368  * information. The API will provide information about devices' status\r
369  * Device can have following states\r
370  *  - ON/OFF: Device is switched on or off.\r
371  *\r
372  * NOTE: Caller need to call OCDeleteDiscoveredDevices to delete memory allocated by this API for out\r
373  * variables pOwnedDevList and pUnownedDevList.\r
374  *\r
375  * @param[in] waitime Wait time for the API. The wait time will be divided by 2, and half of wait time\r
376  * will be used for unowned discovery and remaining half for owned discovery. So the wait time should be\r
377  * equal to or more than 2.\r
378  * @param[out] pOwnedDevList  list of owned devices.\r
379  * @param[out] pUnownedDevList  list of unowned devices.\r
380  * @return OC_STACK_OK in case of success and other value otherwise.\r
381  */\r
382 OCStackResult OCGetDevInfoFromNetwork(unsigned short waittime,\r
383                                        OCProvisionDev_t** pOwnedDevList,\r
384                                        OCProvisionDev_t** pUnownedDevList);\r
385 /**\r
386  * This method is used to get linked devices' IDs.\r
387  *\r
388  * @param[in] uuidOfDevice a target device's uuid.\r
389  * @param[out] uuidList information about the list of linked devices' uuids.\r
390  * @param[out] numOfDevices total number of linked devices.\r
391  * @return OC_STACK_OK in case of success and other value otherwise.\r
392  */\r
393 OCStackResult OCGetLinkedStatus(const OicUuid_t* uuidOfDevice,\r
394                                   OCUuidList_t** uuidList,\r
395                                   size_t* numOfDevices);\r
396 \r
397 /**\r
398  * API to delete memory allocated to linked list created by OCDiscover_XXX_Devices API.\r
399  *\r
400  * @param[in] pList Pointer to OCProvisionDev_t which should be deleted.\r
401  */\r
402 void OCDeleteDiscoveredDevices(OCProvisionDev_t *pList);\r
403 \r
404 /**\r
405  * API to delete memory allocated to OicUuid_t list.\r
406  *\r
407  * @param[in] pList Pointer to OicUuid_t list which should be deleted.\r
408  */\r
409 void OCDeleteUuidList(OCUuidList_t* pList);\r
410 \r
411 /**\r
412  * This function deletes ACL data.\r
413  *\r
414  * @param pAcl Pointer to OicSecAcl_t structure.\r
415  */\r
416 void OCDeleteACLList(OicSecAcl_t* pAcl);\r
417 \r
418 /**\r
419  * This function deletes PDACL data.\r
420  *\r
421  * @param pPdAcl Pointer to OicSecPdAcl_t structure.\r
422  */\r
423 void OCDeletePdAclList(OicSecPdAcl_t* pPdAcl);\r
424 \r
425 #if defined(__WITH_DTLS__) || defined(__WITH_TLS__)\r
426 /**\r
427  * this function sends CRL information to resource.\r
428  *\r
429  * @param[in] ctx Application context would be returned in result callback.\r
430  * @param[in] selectedDeviceInfo Selected target device.\r
431  * @param[in] crl CRL to provision.\r
432  * @param[in] resultCallback callback provided by API user, callback will be called when provisioning\r
433               request recieves a response from resource server.\r
434  * @return  OC_STACK_OK in case of success and other value otherwise.\r
435  */\r
436 OCStackResult OCProvisionCRL(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecCrl_t *crl,\r
437                              OCProvisionResultCB resultCallback);\r
438 \r
439 /**\r
440  * function to provision Trust certificate chain to devices.\r
441  *\r
442  * @param[in] ctx Application context would be returned in result callback.\r
443  * @param[in] type Type of credentials to be provisioned to the device.\r
444  * @param[in] credId CredId of trust certificate chain to be provisioned to the device.\r
445  * @param[in] selectedDeviceInfo Pointer to OCProvisionDev_t instance,respresenting resource to be provsioned.\r
446  * @param[in] resultCallback callback provided by API user, callback will be called when\r
447  *            provisioning request recieves a response from first resource server.\r
448  * @return  OC_STACK_OK in case of success and other value otherwise.\r
449  */\r
450 OCStackResult OCProvisionTrustCertChain(void *ctx, OicSecCredType_t type, uint16_t credId,\r
451                                       const OCProvisionDev_t *selectedDeviceInfo,\r
452                                       OCProvisionResultCB resultCallback);\r
453 /**\r
454  * function to save Trust certificate chain into Cred of SVR.\r
455  *\r
456  * @param[in] trustCertChain Trust certificate chain to be saved in Cred of SVR.\r
457  * @param[in] chainSize Size of trust certificate chain to be saved in Cred of SVR\r
458  * @param[in] encodingType Encoding type of trust certificate chain to be saved in Cred of SVR\r
459  * @param[out] credId CredId of saved trust certificate chain in Cred of SVR.\r
460  * @return  OC_STACK_OK in case of success and other value otherwise.\r
461  */\r
462 OCStackResult OCSaveTrustCertChain(uint8_t *trustCertChain, size_t chainSize,\r
463                                         OicEncodingType_t encodingType, uint16_t *credId);\r
464 /**\r
465  * function to register callback, for getting notification for TrustCertChain change.\r
466  *\r
467  * @param[in] TrustCertChainChangeCB notifier callback function\r
468  * @return OC_STACK_OK in case of success and other value otherwise.\r
469  */\r
470 OCStackResult OCRegisterTrustCertChainNotifier(void *cb, TrustCertChainChangeCB CB);\r
471 \r
472 /**\r
473  * function to de-register TrustCertChain notification callback.\r
474  */\r
475 void OCRemoveTrustCertChainNotifier(void);\r
476 \r
477 /*\r
478  * Function to read Trust certificate chain from SVR.\r
479  * Caller must free when done using the returned trust certificate\r
480  * @param[in] credId CredId of trust certificate chain in SVR.\r
481  * @param[out] trustCertChain Trust certificate chain.\r
482  * @param[out] chainSize Size of trust certificate chain\r
483  * @return  OC_STACK_OK in case of success and other value otherwise.\r
484  */\r
485 OCStackResult OCReadTrustCertChain(uint16_t credId, uint8_t **trustCertChain,\r
486                                      size_t *chainSize);\r
487 \r
488 #endif // __WITH_DTLS__ || __WITH_TLS__\r
489 \r
490 \r
491 #ifdef __cplusplus\r
492 }\r
493 #endif // __cplusplus\r
494 \r
495 #endif /* OCPROVISIONINGMANAGER_H_ */\r