replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / oxm / oxmpreconfpin.h
1 //******************************************************************
2 //
3 // Copyright 2016 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_PRECONF_PIN_H_
22 #define OXM_PRECONF_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 load preconfig PIN.
36  *
37  * @param otmCtx Context of OTM, It includes current device information.
38  *
39  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
40  */
41 OCStackResult LoadPreconfigPinCodeCallback(OTMContext_t *otmCtx);
42
43 /**
44  * Callback implementation to establish a secure channel with PSK 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 CreateSecureSessionPreconfigPinCallback(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 cborPaylaod 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 CreatePreconfigPinBasedSelectOxmPayload(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 cborPaylaod 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 CreatePreconfigPinBasedOwnerTransferPayload(OTMContext_t *otmCtx, uint8_t **cborPayload,
76                                                    size_t *cborSize);
77
78 #ifdef __cplusplus
79 }
80 #endif
81 #endif //OXM_PRECONF_PIN_H_
82