1 /* *****************************************************************
3 * Copyright 2016 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * *****************************************************************/
21 #ifndef OTM_MULTIPLE_OWNERSHIPTRANSFERMANAGER_H_
22 #define OTM_MULTIPLE_OWNERSHIPTRANSFERMANAGER_H_
27 #include "securevirtualresourcetypes.h"
33 /**********************************************************************
35 **********************************************************************/
38 * API to add 'doxm.oxms' to resource server.
40 * @param[in] ctx Application context would be returned in result callback
41 * @param[in] targetDeviceInfo Selected target device.
42 * @param[in] newOxm OxMs to be added (ref. oic.sec.doxmtype)
43 * @param[in] resultCallback callback provided by API user, callback will be called when
44 * POST 'oxms' request receives a response from resource server.
45 * @return OC_STACK_OK in case of success and other value otherwise.
47 OCStackResult MOTAddMOTMethod(void *ctx, OCProvisionDev_t *targetDeviceInfo,
48 const OicSecOxm_t newOxm, OCProvisionResultCB resultCallback);
51 * API to update 'doxm.oxmsel' to resource server.
53 * @param[in] ctx Application context would be returned in result callback
54 * @param[in] targetDeviceInfo Selected target device.
55 * @param[in] oxmSelValue Method of multiple ownership transfer (ref. oic.sec.doxmtype)
56 * @param[in] resultCallback callback provided by API user, callback will be called when
57 * POST 'oxmsel' request recieves a response from resource server.
58 * @return OC_STACK_OK in case of success and other value otherwise.
60 OCStackResult MOTSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
61 const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback);
64 * API to update 'doxm.mom' to resource server.
66 * @param[in] ctx Application context would be returned in result callback
67 * @param[in] targetDeviceInfo Selected target device.
68 * @param[in] momType Mode of multiple ownership transfer (ref. oic.sec.mom)
69 * @param[in] resultCallback callback provided by API user, callback will be called when
70 * POST 'mom' request recieves a response from resource server.
71 * @return OC_STACK_OK in case of success and other value otherwise.
73 OCStackResult MOTChangeMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
74 const OicSecMomType_t momType, OCProvisionResultCB resultCallback);
77 * API to provision preconfigured PIN to resource server.
79 * @param[in] ctx Application context would be returned in result callback
80 * @param[in] targetDeviceInfo Selected target device.
81 * @param[in] preconfPIN Preconfig PIN which is used while multiple owner authentication
82 * @param[in] preconfPINLen Byte length of preconfig PIN
83 * @param[in] resultCallback callback provided by API user, callback will be called when
84 * POST credential request recieves a response from resource server.
85 * @return OC_STACK_OK in case of success and other value otherwise.
87 OCStackResult MOTProvisionPreconfigPIN(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
88 const char* preconfPIN, size_t preconfPINLen, OCProvisionResultCB resultCallback);
90 /**********************************************************************
92 **********************************************************************/
95 * API to perform the multiple ownership transfer.
97 * @param[in] ctx Application context would be returned in result callback
98 * @param[in] selectedDevicelist linked list of multiple ownership transfer candidate devices.
99 * @param[in] resultCallback Result callback function to be invoked when multiple ownership transfer finished.
100 * @return OC_STACK_OK in case of success and other value otherwise.
102 OCStackResult MOTDoOwnershipTransfer(void* ctx,
103 OCProvisionDev_t *selectedDevicelist,
104 OCProvisionResultCB resultCallback);
108 * API to add preconfigured PIN to local SVR DB.
110 * @param[in] targetDeviceInfo Selected target device.
111 * @param[in] preconfPIN Preconfig PIN which is used while multiple owner authentication
112 * @param[in] preconfPINLen Byte length of preconfig PIN
113 * @return OC_STACK_OK in case of success and other value otherwise.
115 OCStackResult MOTAddPreconfigPIN(const OCProvisionDev_t *targetDeviceInfo,
116 const char* preconfPIN, size_t preconfPINLen);
121 #endif //OTM_MULTIPLE_OWNERSHIPTRANSFERMANAGER_H_