Revert back cbor related patches.
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / oxm / oxmrandompin.h
1 /* *****************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
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
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  * *****************************************************************/
20
21 #ifndef OXM_RANDOM_PIN_H_
22 #define OXM_RANDOM_PIN_H_
23
24 #include "ocstack.h"
25 #include "securevirtualresourcetypes.h"
26 #include "ownershiptransfermanager.h"
27 #include "pmtypes.h"
28 #include "pinoxmcommon.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif // __cplusplus
33
34 /**
35  * Callback implementation to input the PIN code from user.
36  *
37  * @otmCtx  Context of OTM, It includes current device infomation.
38  * @return OC_STACK_SUCCESS in case of success and other value otherwise.
39  */
40 OCStackResult InputPinCodeCallback(OTMContext_t* otmCtx);
41
42 /**
43  * Callback implemenration to establish a secure channel with PSK cipher suite
44  *
45  * @param[in] selectedDeviceInfo Selected device infomation
46  * @return OC_STACK_SUCCESS in case of success and other value otherwise.
47  */
48 OCStackResult CreateSecureSessionRandomPinCallback(OTMContext_t *otmCtx);
49
50 /**
51  * Generate payload for select OxM request.
52  *
53  * @param[in] selectedDeviceInfo Selected device infomation
54  * @return DOXM JSON payload including the selected OxM.
55  *         NOTE : Returned memory should be deallocated by caller.
56  */
57 char* CreatePinBasedSelectOxmPayload(OTMContext_t* otmCtx);
58
59 /**
60  * Generate payload for owner transfer request.
61  *
62  * @param[in] selectedDeviceInfo Selected device infomation
63  * @return DOXM JSON payload including the owner information.
64  *         NOTE : Returned memory should be deallocated by caller.
65  */
66 char* CreatePinBasedOwnerTransferPayload(OTMContext_t* otmCtx);
67
68 #ifdef __cplusplus
69 }
70 #endif
71 #endif //OXM_RANDOM_PIN_H_