2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file PrivilegeHandler.h
19 * @brief This is the header file for the PrivilegeHandler class.
21 * This header file contains the declarations of the PrivilegeHandler class.
24 #ifndef _PRIVILEGE_HANDLER_H_
25 #define _PRIVILEGE_HANDLER_H_
27 #include <FSec_AccessControlTypes.h>
29 namespace Tizen { namespace Base { namespace Collection
34 namespace Tizen { namespace Base
39 static const wchar_t EXTERNAL_PRIVILEGE_FILE_NAME[] = L"/usr/share/osp/.external-privilege.ini";
42 * @class PrivilegeHandler
43 * @brief This class represents the class of PrivilegeHandler.
46 * This class represents the class of PrivilegeHandler.
49 class PrivilegeHandler
53 static result GenerateCipherPrivilege(const Tizen::App::AppId& appId, const Tizen::Base::Collection::IList& privilegeList, Tizen::Base::String& encryptedPrivileges, Tizen::Base::String& checksum, Tizen::Base::Collection::IList& stringPrivilege);
54 static result GenerateCipherPrivilege(const Tizen::App::AppId& appId, const Tizen::Base::Collection::IList& privilegeList, int visibilityLevel, Tizen::Base::String& encryptedPrivileges, Tizen::Base::String& checksum, Tizen::Base::Collection::IList& stringPrivilege);
56 static byte* PackPrivilegeN(const Tizen::Base::Collection::IList& privilegeList);
57 static result PackPrivilegeN(const Tizen::Base::Collection::IList& privilegeList, int visibilityLevel, byte** ppBitwisePrivilege);
58 static result GetEncryptedBitwise(byte* __bitwisePrivilege, Tizen::Base::String& encryptedPrivileges);
59 static result GetChecksum(Tizen::App::AppId appId, byte* __bitwisePrivilege, Tizen::Base::String& checksum);
60 static result PickExternalPrivilege(const Tizen::Base::Collection::IList& fullPrivilegeList, Tizen::Base::Collection::IList& normalPrivilegeList, Tizen::Base::Collection::IList& externalPrivilegeList);
62 }; // PrivilegeHandler
64 #endif // _PRIVILEGE_HANDLER_H_