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] targetDeviceInfo Selected target device.
41 * @param[in] newOxm OxMs to be added (ref. oic.sec.oxm)
42 * @param[in] resultCallback callback provided by API user, callback will be called when
43 * POST 'oxms' request recieves a response from resource server.
44 * @return OC_STACK_OK in case of success and other value otherwise.
46 OCStackResult MOTAddMOTMethod(void *ctx, OCProvisionDev_t *targetDeviceInfo,
47 const OicSecOxm_t newOxm, OCProvisionResultCB resultCallback);
50 * API to update 'doxm.oxmsel' to resource server.
52 * @param[in] targetDeviceInfo Selected target device.
53 * @param[in] oxmSelValue Method of multiple ownership transfer (ref. oic.sec.oxm)
54 * @param[in] resultCallback callback provided by API user, callback will be called when
55 * POST 'oxmsel' request recieves a response from resource server.
56 * @return OC_STACK_OK in case of success and other value otherwise.
58 OCStackResult MOTSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
59 const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback);
62 * API to update 'doxm.mom' to resource server.
64 * @param[in] targetDeviceInfo Selected target device.
65 * @param[in] momType Mode of multiple ownership transfer (ref. oic.sec.mom)
66 * @param[in] resultCallback callback provided by API user, callback will be called when
67 * POST 'mom' request recieves a response from resource server.
68 * @return OC_STACK_OK in case of success and other value otherwise.
70 OCStackResult MOTChangeMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
71 const OicSecMomType_t momType, OCProvisionResultCB resultCallback);
74 * API to provision preconfigured PIN to resource server.
76 * @param[in] targetDeviceInfo Selected target device.
77 * @param[in] preconfPIN Preconfig PIN which is used while multiple owner authentication
78 * @param[in] preconfPINLen Byte length of preconfig PIN
79 * @param[in] resultCallback callback provided by API user, callback will be called when
80 * POST credential request recieves a response from resource server.
81 * @return OC_STACK_OK in case of success and other value otherwise.
83 OCStackResult MOTProvisionPreconfigPIN(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
84 const char* preconfPIN, size_t preconfPINLen, OCProvisionResultCB resultCallback);
86 /**********************************************************************
88 **********************************************************************/
91 * API to perform the multiple ownership transfer.
93 * @param[in] ctx Application context would be returned in result callback
94 * @param[in] selectedDeviceList linked list of multiple ownership transfer candidate devices.
95 * @param[in] resultCB Result callback function to be invoked when multiple ownership transfer finished.
96 * @return OC_STACK_OK in case of success and other value otherwise.
98 OCStackResult MOTDoOwnershipTransfer(void* ctx,
99 OCProvisionDev_t *selectedDevicelist,
100 OCProvisionResultCB resultCallback);
104 * API to add preconfigured PIN to local SVR DB.
106 * @param[in] targetDeviceInfo Selected target device.
107 * @param[in] preconfPIN Preconfig PIN which is used while multiple owner authentication
108 * @param[in] preconfPINLen Byte length of preconfig PIN
109 * @return OC_STACK_OK in case of success and other value otherwise.
111 OCStackResult MOTAddPreconfigPIN(const OCProvisionDev_t *targetDeviceInfo,
112 const char* preconfPIN, size_t preconfPINLen);
117 #endif //OTM_MULTIPLE_OWNERSHIPTRANSFERMANAGER_H_