1 /* *****************************************************************
3 * Copyright 2015 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 OXM_RANDOM_PIN_H_
22 #define OXM_RANDOM_PIN_H_
25 #include "securevirtualresourcetypes.h"
26 #include "ownershiptransfermanager.h"
28 #include "pinoxmcommon.h"
34 #define OXM_PBKDF2_ITERATIONS 1000
37 * Callback implementation to input the PIN code from user.
39 * @otmCtx Context of OTM, It includes current device infomation.
40 * @return OC_STACK_SUCCESS in case of success and other value otherwise.
42 OCStackResult InputPinCodeCallback(OTMContext_t* otmCtx);
45 * Callback implemenration to establish a secure channel with PSK cipher suite
47 * @param[in] selectedDeviceInfo Selected device infomation
48 * @return OC_STACK_SUCCESS in case of success and other value otherwise.
50 OCStackResult CreateSecureSessionRandomPinCallbak(OTMContext_t* otmCtx);
53 * Generate payload for select OxM request.
55 * @param[in] selectedDeviceInfo Selected device infomation
56 * @return DOXM JSON payload including the selected OxM.
57 * NOTE : Returned memory should be deallocated by caller.
59 char* CreatePinBasedSelectOxmPayload(OTMContext_t* otmCtx);
62 * Generate payload for owner transfer request.
64 * @param[in] selectedDeviceInfo Selected device infomation
65 * @return DOXM JSON payload including the owner information.
66 * NOTE : Returned memory should be deallocated by caller.
68 char* CreatePinBasedOwnerTransferPayload(OTMContext_t* otmCtx);
73 #endif //OXM_RANDOM_PIN_H_