1 /* *****************************************************************
\r
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
\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
11 * http://www.apache.org/licenses/LICENSE-2.0
\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
19 * *****************************************************************/
\r
21 #ifndef OCPROVISIONINGMANAGER_H_
\r
22 #define OCPROVISIONINGMANAGER_H_
\r
24 #include "octypes.h"
\r
25 #include "pmtypes.h"
\r
26 #include "casecurityinterface.h"
\r
27 #include "ownershiptransfermanager.h"
\r
28 #ifdef MULTIPLE_OWNER
\r
29 #include "securevirtualresourcetypes.h"
\r
30 #endif //MULTIPLE_OWNER
\r
34 #endif // __cplusplus
\r
37 * The function is responsible for initializaton of the provisioning manager. It will load
\r
38 * provisioning database which have owned device's list and their linked status.
\r
39 * TODO: In addition, if there is a device(s) which has not up-to-date credentials, this function will
\r
40 * automatically try to update the deivce(s).
\r
42 * @param[in] dbPath file path of the sqlite3 db
\r
44 * @return OC_STACK_OK in case of success and other value otherwise.
\r
46 OCStackResult OCInitPM(const char* dbPath);
\r
49 * API to termiante the provisioning manager
\r
51 void OCTerminatePM();
\r
54 * API to cleanup PDM in case of timeout.
\r
55 * It will remove the PDM_DEVICE_INIT state devices from PDM.
\r
57 * @return OC_STACK_OK in case of success and other value otherwise.
\r
59 OCStackResult OCPDMCleanupForTimeout();
\r
62 * The function is responsible for discovery of owned/unowned device is specified endpoint/deviceID.
\r
63 * It will return the found device even though timeout is not exceeded.
\r
65 * @param[in] timeout Timeout in seconds, value till which function will listen to responses from
\r
66 * server before returning the device.
\r
67 * @param[in] deviceID deviceID of target device.
\r
68 * @param[out] ppFoundDevice OCProvisionDev_t of found device
\r
69 * @return OTM_SUCCESS in case of success and other value otherwise.
\r
71 OCStackResult OCDiscoverSingleDevice(unsigned short timeout, const OicUuid_t* deviceID,
\r
72 OCProvisionDev_t **ppFoundDevice);
\r
75 * The function is responsible for discovery of owned/unowned device is specified endpoint/MAC
\r
77 * It will return the found device even though timeout is not exceeded.
\r
79 * @param[in] timeout Timeout in seconds, value till which function will listen to responses from
\r
80 * server before returning the device.
\r
81 * @param[in] deviceID deviceID of target device.
\r
82 * @param[in] hostAddress MAC address of target device.
\r
83 * @param[in] connType ConnectivityType for discovery.
\r
84 * @param[out] ppFoundDevice OCProvisionDev_t of found device.
\r
85 * @return OTM_SUCCESS in case of success and other value otherwise.
\r
87 OCStackResult OCDiscoverSingleDeviceInUnicast(unsigned short timeout, const OicUuid_t* deviceID,
\r
88 const char* hostAddress, OCConnectivityType connType,
\r
89 OCProvisionDev_t **ppFoundDevice);
\r
92 * The function is responsible for discovery of device is current subnet. It will list
\r
93 * all the device in subnet which are not yet owned. Please call OCInit with OC_CLIENT_SERVER as
\r
96 * @param[in] timeout Timeout in seconds, value till which function will listen to responses from
\r
97 * server before returning the list of devices.
\r
98 * @param[out] ppList List of candidate devices to be provisioned
\r
99 * @return OTM_SUCCESS in case of success and other value otherwise.
\r
101 OCStackResult OCDiscoverUnownedDevices(unsigned short waittime, OCProvisionDev_t **ppList);
\r
104 * Do ownership transfer for un-owned device.
\r
106 * @param[in] ctx Application context would be returned in result callback
\r
107 * @param[in] targetDevices List of devices to perform ownership transfer.
\r
108 * @param[in] resultCallback Result callback function to be invoked when ownership transfer finished.
\r
109 * @return OC_STACK_OK in case of success and other value otherwise.
\r
111 OCStackResult OCDoOwnershipTransfer(void* ctx,
\r
112 OCProvisionDev_t *targetDevices,
\r
113 OCProvisionResultCB resultCallback);
\r
116 * API to set a allow status of OxM
\r
118 * @param[in] oxm Owership transfer method (ref. OicSecOxm_t)
\r
119 * @param[in] allowStatus allow status (true = allow, false = not allow)
\r
121 * @return OC_STACK_OK in case of success and other value otherwise.
\r
123 OCStackResult OCSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus);
\r
126 #ifdef MULTIPLE_OWNER
\r
128 * API to perfrom multiple ownership transfer for MOT enabled device.
\r
130 * @param[in] ctx Application context would be returned in result callback
\r
131 * @param[in] targetDevices List of devices to perform ownership transfer.
\r
132 * @param[in] resultCallback Result callback function to be invoked when ownership transfer finished.
\r
133 * @return OC_STACK_OK in case of success and other value otherwise.
\r
135 OCStackResult OCDoMultipleOwnershipTransfer(void* ctx,
\r
136 OCProvisionDev_t *targetDevices,
\r
137 OCProvisionResultCB resultCallback);
\r
140 * API to remove sub-owner from resource server
\r
142 * @param[in] ctx Application context would be returned in result callback
\r
143 * @param[in] targetDeviceInfo Selected target device.
\r
144 * @param[in] subOwner sub-owner UUID to be removed
\r
145 * @param[in] resultCallback callback provided by API user, callback will be invoked when
\r
146 * DELETE 'subowneruuid' request recieves a response from resource server.
\r
147 * @return OC_STACK_OK in case of success and other value otherwise.
\r
149 OCStackResult OCRemoveSubOwner(void* ctx,
\r
150 const OCProvisionDev_t *targetDeviceInfo,
\r
151 const OicUuid_t* subOwner,
\r
152 OCProvisionResultCB resultCallback);
\r
155 * API to remove all sub-owner from resource server
\r
157 * @param[in] ctx Application context would be returned in result callback
\r
158 * @param[in] targetDeviceInfo Selected target device.
\r
159 * @param[in] resultCallback callback provided by API user, callback will be invoked when
\r
160 * DELETE 'subowneruuid' request recieves a response from resource server.
\r
161 * @return OC_STACK_OK in case of success and other value otherwise.
\r
163 OCStackResult OCRemoveAllSubOwner(void* ctx,
\r
164 const OCProvisionDev_t *targetDeviceInfo,
\r
165 OCProvisionResultCB resultCallback);
\r
167 #endif //MULTIPLE_OWNER
\r
170 * API to register for particular OxM.
\r
172 * @param[in] Ownership transfer method.
\r
173 * @param[in] Implementation of callback functions for owership transfer.
\r
174 * @return OC_STACK_OK in case of success and other value otherwise.
\r
176 OCStackResult OCSetOwnerTransferCallbackData(OicSecOxm_t oxm, OTMCallbackData_t* callbackData);
\r
179 * The function is responsible for discovery of owned device is current subnet. It will list
\r
180 * all the device in subnet which are owned by calling provisioning client.
\r
182 * @param[in] timeout Timeout in seconds, value till which function will listen to responses from
\r
183 * server before returning the list of devices.
\r
184 * @param[out] ppList List of device owned by provisioning tool.
\r
185 * @return OTM_SUCCESS in case of success and other value otherwise.
\r
187 OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);
\r
189 #ifdef MULTIPLE_OWNER
\r
191 * The function is responsible for discovery of MOT enabled device is current subnet.
\r
193 * @param[in] timeout Timeout in seconds, value till which function will listen to responses from
\r
194 * server before returning the list of devices.
\r
195 * @param[out] ppList List of MOT enabled devices.
\r
196 * @return OC_STACK_OK in case of success and other value otherwise.
\r
198 OCStackResult OCDiscoverMultipleOwnerEnabledDevices(unsigned short timeout, OCProvisionDev_t **ppList);
\r
201 * The function is responsible for discovery of Multiple Owned device is current subnet.
\r
203 * @param[in] timeout Timeout in seconds, value till which function will listen to responses from
\r
204 * server before returning the list of devices.
\r
205 * @param[out] ppList List of Multiple Owned devices.
\r
206 * @return OC_STACK_OK in case of success and other value otherwise.
\r
208 OCStackResult OCDiscoverMultipleOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);
\r
209 #endif //MULTIPLE_OWNER
\r
212 * API to provision credentials between two devices and ACLs for the devices who act as a server.
\r
214 * @param[in] ctx Application context would be returned in result callback.
\r
215 * @param[in] type Type of credentials to be provisioned to the device.
\r
216 * @param[in] pDev1 Pointer to OCProvisionDev_t instance,respresenting device to be provisioned.
\r
217 * @param[in] acl ACL for device 1. If this is not required set NULL.
\r
218 * @param[in] pDev2 Pointer to OCProvisionDev_t instance,respresenting device to be provisioned.
\r
219 * @param[in] acl ACL for device 2. If this is not required set NULL.
\r
220 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
221 * provisioning request recieves a response from first resource server.
\r
222 * @return OC_STACK_OK in case of success and other value otherwise.
\r
224 OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize,
\r
225 const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl,
\r
226 const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl,
\r
227 OCProvisionResultCB resultCallback);
\r
230 * API to send ACL information to device.
\r
232 * @param[in] ctx Application context would be returned in result callback.
\r
233 * @param[in] selectedDeviceInfo Selected target device.
\r
234 * @param[in] acl ACL to provision.
\r
235 * @param[in] resultCallback callback provided by API user, callback will be called when provisioning
\r
236 request recieves a response from resource server.
\r
237 * @return OC_STACK_OK in case of success and other value otherwise.
\r
239 OCStackResult OCProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
\r
240 OCProvisionResultCB resultCallback);
\r
243 * function to save ACL which has several ACE into Acl of SVR.
\r
245 * @param acl ACL to be saved in Acl of SVR.
\r
246 * @return OC_STACK_OK in case of success and other value otherwise.
\r
248 OCStackResult OCSaveACL(const OicSecAcl_t* acl);
\r
251 * this function requests CRED information to resource.
\r
253 * @param[in] ctx Application context would be returned in result callback.
\r
254 * @param[in] selectedDeviceInfo Selected target device.
\r
255 * @param[in] resultCallback callback provided by API user, callback will be called when provisioning
\r
256 request recieves a response from resource server.
\r
257 * @return OC_STACK_OK in case of success and other value otherwise.
\r
259 OCStackResult OCGetCredResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
\r
260 OCProvisionResultCB resultCallback);
\r
263 * this function requests ACL information to resource.
\r
265 * @param[in] ctx Application context would be returned in result callback.
\r
266 * @param[in] selectedDeviceInfo Selected target device.
\r
267 * @param[in] resultCallback callback provided by API user, callback will be called when provisioning
\r
268 request recieves a response from resource server.
\r
269 * @return OC_STACK_OK in case of success and other value otherwise.
\r
271 OCStackResult OCGetACLResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
\r
272 OCProvisionResultCB resultCallback);
\r
275 * this function sends Direct-Pairing Configuration to a device.
\r
277 * @param[in] ctx Application context would be returned in result callback.
\r
278 * @param[in] selectedDeviceInfo Selected target device.
\r
279 * @param[in] pconf PCONF pointer.
\r
280 * @param[in] resultCallback callback provided by API user, callback will be called when provisioning
\r
281 request recieves a response from resource server.
\r
282 * @return OC_STACK_OK in case of success and other value otherwise.
\r
284 OCStackResult OCProvisionDirectPairing(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecPconf_t *pconf,
\r
285 OCProvisionResultCB resultCallback);
\r
288 * API to provision credential to devices.
\r
290 * @param[in] ctx Application context would be returned in result callback.
\r
291 * @param[in] type Type of credentials to be provisioned to the device.
\r
292 * @param[in] pDev1 Pointer to OCProvisionDev_t instance,respresenting resource to be provsioned.
\r
293 @param[in] pDev2 Pointer to OCProvisionDev_t instance,respresenting resource to be provsioned.
\r
294 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
295 * provisioning request recieves a response from first resource server.
\r
296 * @return OC_STACK_OK in case of success and other value otherwise.
\r
298 OCStackResult OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
\r
299 const OCProvisionDev_t *pDev1,
\r
300 const OCProvisionDev_t *pDev2,
\r
301 OCProvisionResultCB resultCallback);
\r
303 #ifdef MULTIPLE_OWNER
\r
305 * API to provision preconfigured PIN to device(NOT LIST).
\r
306 * If device does not support the Preconfigured PIN OxM,
\r
307 * OCProvisionPreconfigPin API will update the device's Doxm
\r
308 * and then try preconfigured PIN provisioning once again.
\r
310 * @param[in] ctx Application context would be returned in result callback.
\r
311 * @param[in] targetDeviceInfo Selected target device.
\r
312 * @param[in] preconfigPin string of preconfigured PIN.
\r
313 * @param[in] preconfigPinLen string length of 'preconfigPin'.
\r
314 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
315 * provisioning request recieves a response from first resource server.
\r
316 * @return OC_STACK_OK in case of success and other value otherwise.
\r
318 OCStackResult OCProvisionPreconfigPin(void *ctx,
\r
319 OCProvisionDev_t *targetDeviceInfo,
\r
320 const char *preconfigPin,
\r
321 size_t preconfigPinLen,
\r
322 OCProvisionResultCB resultCallback);
\r
325 * API to add preconfigured PIN to local SVR DB.
\r
327 * @param[in] targetDeviceInfo Selected target device.
\r
328 * @param[in] preconfigPin Preconfig PIN which is used while multiple owner authentication
\r
329 * @param[in] preconfigPinLen Byte length of preconfigPin
\r
330 * @return OC_STACK_OK in case of success and other value otherwise.
\r
332 OCStackResult OCAddPreconfigPin(const OCProvisionDev_t *targetDeviceInfo,
\r
333 const char *preconfigPin,
\r
334 size_t preconfigPinLen);
\r
337 * API to update 'doxm.mom' to resource server.
\r
339 * @param[in] targetDeviceInfo Selected target device.
\r
340 * @param[in] momType Mode of multiple ownership transfer (ref. oic.sec.mom)
\r
341 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
342 * POST 'mom' request recieves a response from resource server.
\r
343 * @return OC_STACK_OK in case of success and other value otherwise.
\r
345 OCStackResult OCChangeMOTMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
\r
346 const OicSecMomType_t momType, OCProvisionResultCB resultCallback);
\r
349 * API to update 'doxm.oxmsel' to resource server.
\r
351 * @param[in] targetDeviceInfo Selected target device.
\r
352 * @param[in] oxmSelValue Method of multiple ownership transfer (ref. oic.sec.oxm)
\r
353 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
354 * POST 'oxmsel' request recieves a response from resource server.
\r
355 * @return OC_STACK_OK in case of success and other value otherwise.
\r
357 OCStackResult OCSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
\r
358 const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback);
\r
359 #endif //MULTIPLE_OWNER
\r
362 * Function to unlink devices.
\r
363 * This function will remove the credential & relasionship between the two devices.
\r
365 * @param[in] ctx Application context would be returned in result callback
\r
366 * @param[in] pTargetDev1 fitst device information to be unlinked.
\r
367 * @param[in] pTargetDev2 second device information to be unlinked.
\r
368 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
369 * device unlink is finished.
\r
370 * @return OC_STACK_OK in case of success and other value otherwise.
\r
372 OCStackResult OCUnlinkDevices(void* ctx,
\r
373 const OCProvisionDev_t* pTargetDev1,
\r
374 const OCProvisionDev_t* pTargetDev2,
\r
375 OCProvisionResultCB resultCallback);
\r
378 * Function for device revocation
\r
379 * This function will remove credential of target device from all devices in subnet.
\r
381 * @param[in] ctx Application context would be returned in result callback
\r
382 * @param[in] waitTimeForOwnedDeviceDiscovery Maximum wait time for owned device discovery.(seconds)
\r
383 * @param[in] pTargetDev Device information to be revoked.
\r
384 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
385 * credential revocation is finished.
\r
386 * @return OC_STACK_OK in case of success and other value otherwise.
\r
387 * if OC_STACK_OK is returned, the caller of this API should wait for callback.
\r
388 * OC_STACK_CONTINUE means operation is success but no need to wait for callback.
\r
390 OCStackResult OCRemoveDevice(void* ctx,
\r
391 unsigned short waitTimeForOwnedDeviceDiscovery,
\r
392 const OCProvisionDev_t* pTargetDev,
\r
393 OCProvisionResultCB resultCallback);
\r
396 * Function to device revocation
\r
397 * This function will remove credential of target device from all devices in subnet.
\r
399 * @param[in] ctx Application context would be returned in result callback
\r
400 * @param[in] waitTimeForOwnedDeviceDiscovery Maximum wait time for owned device discovery.(seconds)
\r
401 * @param[in] pTargetDev Device information to be revoked.
\r
402 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
403 * credential revocation is finished.
\r
404 * @return OC_STACK_OK in case of success and other value otherwise.
\r
406 OCStackResult OCRemoveDeviceWithUuid(void* ctx,
\r
407 unsigned short waitTimeForOwnedDeviceDiscovery,
\r
408 const OicUuid_t* pTargetUuid,
\r
409 OCProvisionResultCB resultCallback);
\r
412 * Function to reset the target device.
\r
413 * This function will remove credential and ACL of target device from all devices in subnet.
\r
415 * @param[in] ctx Application context would be returned in result callback
\r
416 * @param[in] waitTimeForOwnedDeviceDiscovery Maximum wait time for owned device discovery.(seconds)
\r
417 * @param[in] pTargetDev Device information to be revoked.
\r
418 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
419 * credential revocation is finished.
\r
420 * @return OC_STACK_OK in case of success and other value otherwise.
\r
422 OCStackResult OCResetDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
\r
423 const OCProvisionDev_t* pTargetDev,
\r
424 OCProvisionResultCB resultCallback);
\r
427 * This function resets SVR DB to its factory setting.
\r
429 *@return OC_STACK_OK in case of successful reset and other value otherwise.
\r
431 OCStackResult OCResetSVRDB(void);
\r
434 * This function configures SVR DB as self-ownership.
\r
436 *@return OC_STACK_OK in case of successful configue and other value otherwise.
\r
438 OCStackResult OCConfigSelfOwnership(void);
\r
441 * API to get status of all the devices in current subnet. The status include endpoint information
\r
442 * and doxm information which can be extracted duing owned and unowned discovery. Along with this
\r
443 * information. The API will provide information about devices' status
\r
444 * Device can have following states
\r
445 * - ON/OFF: Device is switched on or off.
\r
447 * NOTE: Caller need to call OCDeleteDiscoveredDevices to delete memory allocated by this API for out
\r
448 * variables pOwnedDevList and pUnownedDevList.
\r
450 * @param[in] waitime Wait time for the API. The wait time will be divided by 2, and half of wait time
\r
451 * will be used for unowned discovery and remaining half for owned discovery. So the wait time should be
\r
452 * equal to or more than 2.
\r
453 * @param[out] pOwnedDevList list of owned devices.
\r
454 * @param[out] pUnownedDevList list of unowned devices.
\r
455 * @return OC_STACK_OK in case of success and other value otherwise.
\r
457 OCStackResult OCGetDevInfoFromNetwork(unsigned short waittime,
\r
458 OCProvisionDev_t** pOwnedDevList,
\r
459 OCProvisionDev_t** pUnownedDevList);
\r
461 * This method is used to get linked devices' IDs.
\r
463 * @param[in] uuidOfDevice a target device's uuid.
\r
464 * @param[out] uuidList information about the list of linked devices' uuids.
\r
465 * @param[out] numOfDevices total number of linked devices.
\r
466 * @return OC_STACK_OK in case of success and other value otherwise.
\r
468 OCStackResult OCGetLinkedStatus(const OicUuid_t* uuidOfDevice,
\r
469 OCUuidList_t** uuidList,
\r
470 size_t* numOfDevices);
\r
473 * API to delete memory allocated to linked list created by OCDiscover_XXX_Devices API.
\r
475 * @param[in] pList Pointer to OCProvisionDev_t which should be deleted.
\r
477 void OCDeleteDiscoveredDevices(OCProvisionDev_t *pList);
\r
480 * API to delete memory allocated to OicUuid_t list.
\r
482 * @param[in] pList Pointer to OicUuid_t list which should be deleted.
\r
484 void OCDeleteUuidList(OCUuidList_t* pList);
\r
487 * This function deletes ACL data.
\r
489 * @param pAcl Pointer to OicSecAcl_t structure.
\r
491 void OCDeleteACLList(OicSecAcl_t* pAcl);
\r
494 * This function deletes PDACL data.
\r
496 * @param pPdAcl Pointer to OicSecPdAcl_t structure.
\r
498 void OCDeletePdAclList(OicSecPdAcl_t* pPdAcl);
\r
500 #if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
\r
502 * function to provision Trust certificate chain to devices.
\r
504 * @param[in] ctx Application context would be returned in result callback.
\r
505 * @param[in] type Type of credentials to be provisioned to the device.
\r
506 * @param[in] credId CredId of trust certificate chain to be provisioned to the device.
\r
507 * @param[in] selectedDeviceInfo Pointer to OCProvisionDev_t instance,respresenting resource to be provsioned.
\r
508 * @param[in] resultCallback callback provided by API user, callback will be called when
\r
509 * provisioning request recieves a response from first resource server.
\r
510 * @return OC_STACK_OK in case of success and other value otherwise.
\r
512 OCStackResult OCProvisionTrustCertChain(void *ctx, OicSecCredType_t type, uint16_t credId,
\r
513 const OCProvisionDev_t *selectedDeviceInfo,
\r
514 OCProvisionResultCB resultCallback);
\r
516 * function to save Trust certificate chain into Cred of SVR.
\r
518 * @param[in] trustCertChain Trust certificate chain to be saved in Cred of SVR.
\r
519 * @param[in] chainSize Size of trust certificate chain to be saved in Cred of SVR
\r
520 * @param[in] encodingType Encoding type of trust certificate chain to be saved in Cred of SVR
\r
521 * @param[out] credId CredId of saved trust certificate chain in Cred of SVR.
\r
522 * @return OC_STACK_OK in case of success and other value otherwise.
\r
524 OCStackResult OCSaveTrustCertChain(uint8_t *trustCertChain, size_t chainSize,
\r
525 OicEncodingType_t encodingType, uint16_t *credId);
\r
527 * function to register callback, for getting notification for TrustCertChain change.
\r
529 * @param[in] TrustCertChainChangeCB notifier callback function
\r
530 * @return OC_STACK_OK in case of success and other value otherwise.
\r
532 OCStackResult OCRegisterTrustCertChainNotifier(void *cb, TrustCertChainChangeCB CB);
\r
535 * function to de-register TrustCertChain notification callback.
\r
537 void OCRemoveTrustCertChainNotifier(void);
\r
540 * Function to read Trust certificate chain from SVR.
\r
541 * Caller must free when done using the returned trust certificate
\r
542 * @param[in] credId CredId of trust certificate chain in SVR.
\r
543 * @param[out] trustCertChain Trust certificate chain.
\r
544 * @param[out] chainSize Size of trust certificate chain
\r
545 * @return OC_STACK_OK in case of success and other value otherwise.
\r
547 OCStackResult OCReadTrustCertChain(uint16_t credId, uint8_t **trustCertChain,
\r
548 size_t *chainSize);
\r
551 * Function to select appropriate security provisioning method.
\r
553 * @param[in] supportedMethods Array of supported methods
\r
554 * @param[in] numberOfMethods number of supported methods
\r
555 * @param[out] selectedMethod Selected methods
\r
556 * @param[in] ownerType type of owner device (SUPER_OWNER or SUB_OWNER)
\r
557 * @return OC_STACK_OK on success
\r
559 OCStackResult OCSelectOwnershipTransferMethod(const OicSecOxm_t *supportedMethods,
\r
560 size_t numberOfMethods, OicSecOxm_t *selectedMethod, OwnerType_t ownerType);
\r
563 * This function sets the callback to utilize peer certificate information
\r
565 OCStackResult OCSetPeerCertCallback(void *ctx, PeerCertCallback peerCertCallback);
\r
567 #endif // __WITH_DTLS__ || __WITH_TLS__
\r
572 #endif // __cplusplus
\r
574 #endif /* OCPROVISIONINGMANAGER_H_ */
\r