replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / oxm / oxmjustworks.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_JUST_WORKS_H_
22 #define OXM_JUST_WORKS_H_
23
24 #include "ocstack.h"
25 #include "securevirtualresourcetypes.h"
26 #include "ownershiptransfermanager.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif // __cplusplus
31
32 //
33 //Declaration of default callback functions for just works OxM.
34 //
35
36 /**
37  * In case of just works OxM, no need to implement.
38  *
39  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
40  */
41 OCStackResult LoadSecretJustWorksCallback(OTMContext_t* UNUSED_PARAM);
42
43 /**
44  * To establish a secure channel with anonymous cipher suite
45  *
46  * @param otmCtx Context of OTM, It includes current device information.
47  *
48  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
49  */
50 OCStackResult CreateSecureSessionJustWorksCallback(OTMContext_t* otmCtx);
51
52 /**
53  * Generate payload for select OxM request.
54  *
55  * @param otmCtx Context of OTM, It includes current device information.
56  * @param cborPayload is the DOXM CBOR payload including the selected OxM.
57  * @note Returned memory should be deallocated by caller.
58  * @param cborSize is the size of the cborPayload.
59  *
60  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
61  */
62 OCStackResult CreateJustWorksSelectOxmPayload(OTMContext_t *otmCtx, uint8_t **cborPayload,
63                                              size_t *cborSize);
64
65 /**
66  * Generate payload for owner transfer request.
67  *
68  * @param otmCtx Context of OTM, It includes current device information.
69  * @param cborPayload is the DOXM CBOR payload including the owner information.
70  * @note Returned memory should be deallocated by caller.
71  * @param cborSize is the size of the cborPayload.
72  *
73  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
74  */
75 OCStackResult CreateJustWorksOwnerTransferPayload(OTMContext_t *otmCtx, uint8_t **cborPayload,
76                                                   size_t *cborSize);
77
78 /**
79  * Generate payload for select OxM request for Mutual Verified Just-Works.
80  *
81  * @param otmCtx Context of OTM, It includes current device information.
82  * @param cborPayload is the DOXM CBOR payload including the selected OxM.
83  * @note Returned memory should be deallocated by caller.
84  * @param cborSize is the size of the cborPayload.
85  *
86  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
87  */
88 OCStackResult CreateMVJustWorksSelectOxmPayload(OTMContext_t *otmCtx, uint8_t **cborPayload,
89                                              size_t *cborSize);
90
91 #ifdef __cplusplus
92 }
93 #endif
94 #endif //OXM_JUST_WORKS_H_