1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 ENROLLEE_SECURITY_H_
22 #define ENROLLEE_SECURITY_H_
28 #include "OCProvisioningManager.h"
34 #define ENROLEE_SECURITY_TAG "ENROLEE_SECURITY"
36 class RemoteEnrolleeResource;
37 class OCSecureResource;
40 * This class contains the methods needed for security layer interaction.
42 * @see EnrolleeSecurity
44 class EnrolleeSecurity
47 EnrolleeSecurity(std::shared_ptr< RemoteEnrolleeResource > remoteEnrolleeResource,
48 std::string secDbPath);
49 ESResult registerCallbackHandler(EnrolleeSecStatusCb enrolleeSecStatusCb,
50 SecurityPinCb securityPinCb, SecProvisioningDbPathCb secProvisioningDbPathCb);
51 EasySetupState performOwnershipTransfer();
54 std::shared_ptr< RemoteEnrolleeResource > m_remoteEnrolleeResource;
55 EnrolleeSecStatusCb m_enrolleeSecStatusCb;
56 SecurityPinCb m_securityPinCb;
57 SecProvisioningDbPathCb m_secProvisioningDbPathCb;
58 std::shared_ptr< OC::OCSecureResource > m_unownedDevice;
60 EnrolleeSecState m_enrolleeSecState;std::shared_ptr< OC::OCSecureResource > m_securedResource;
62 std::shared_ptr< OC::OCSecureResource > findEnrollee(std::string host,
63 OC::DeviceList_t &list);
64 void ownershipTransferCb(OC::PMResultList_t *result, int hasError);
65 void convertUUIDToString(OicUuid_t uuid, std::string& uuidString);
70 #endif /* ENROLLEE_SECURITY_H_*/