replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / oxm / oxmmanufacturercert.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_MANUFACTURER_CERTIFICATE_H_
22 #define _OXM_MANUFACTURER_CERTIFICATE_H_
23
24 #include "ocstack.h"
25 #include "securevirtualresourcetypes.h"
26 #include "ownershiptransfermanager.h"
27 #include "pmtypes.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif // __cplusplus
32
33 /**
34  * Callback implementation to prepare manufacturer certificate based OT.
35  *
36  * @param otmCtx Context of OTM, It includes current device information.
37  *
38  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
39  */
40 OCStackResult PrepareMCertificateCallback(OTMContext_t *otmCtx);
41
42 /**
43  * Callback implementation to establish a secure channel with RSA cipher suite.
44  *
45  * @param otmCtx Context of OTM, It includes current device information.
46  *
47  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
48  */
49 OCStackResult CreateSecureSessionMCertificateCallback(OTMContext_t *otmCtx);
50
51 /**
52  * Generate payload for select OxM request.
53  *
54  * @param otmCtx Context of OTM, It includes current device information.
55  * @param cborPayload is the DOXM CBOR payload including the selected OxM.
56  * @note Returned memory should be deallocated by caller.
57  * @param cborSize is the size of the cborPayload.
58  *
59  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
60  */
61 OCStackResult CreateMCertificateBasedSelectOxmPayload(OTMContext_t *otmCtx, uint8_t **cborPayload,
62                                              size_t *cborSize);
63
64 /**
65  * Generate payload for select OxM request for confirmed manufactrer certificate method.
66  *
67  * @param otmCtx Context of OTM, It includes current device information.
68  * @param cborPayload is the DOXM CBOR payload including the selected OxM.
69  * @note Returned memory should be deallocated by caller.
70  * @param cborSize is the size of the cborPayload.
71  *
72  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
73  */
74 OCStackResult CreateConMCertificateBasedSelectOxmPayload(OTMContext_t *otmCtx, uint8_t **cborPayload,
75                                              size_t *cborSize);
76
77 /**
78  * Generate payload for owner transfer request.
79  *
80  * @param otmCtx Context of OTM, It includes current device information.
81  * @param cborPaylaod is the DOXM CBOR payload including the owner information.
82  * @note Returned memory should be deallocated by caller.
83  * @param cborSize is the size of the cborPayload.
84  *
85  * @return ::OC_STACK_SUCCESS in case of success and other value otherwise.
86  */
87 OCStackResult CreateMCertificateBasedOwnerTransferPayload(OTMContext_t *otmCtx, uint8_t **cborPayload,
88                                                  size_t *cborSize);
89
90 #ifdef __cplusplus
91 }
92 #endif
93 #endif //_OXM_MANUFACTURER_CERTIFICATE_H_
94