summaryrefslogtreecommitdiff
path: root/src/XmlHandler/PrivilegeHandler.h
blob: 2fd10664599a8f5500f05d30da60629acbed021b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/**
 * @file	PrivilegeHandler.h
 * @brief	This is the header file for the PrivilegeHandler class.
 *
 * This header file contains the declarations of the PrivilegeHandler class.
 */

#ifndef _PRIVILEGE_HANDLER_H_
#define _PRIVILEGE_HANDLER_H_

#include <FSec_AccessControlTypes.h>

namespace Tizen { namespace Base { namespace Collection
{
class IList;
}}}

namespace Tizen { namespace Base
{
class String;
}}

static const wchar_t EXTERNAL_PRIVILEGE_DB_NAME[] = L"/opt/dbspace/.privilegelist.db";

/**
 * @class		PrivilegeHandler
 * @brief		This class represents the class of PrivilegeHandler.
 * @since 2.1
 *
 * This class represents the class of PrivilegeHandler.
 *
 */
class PrivilegeHandler
{

public:
		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);

private:
		static byte* PackPrivilegeN(const Tizen::Base::Collection::IList& privilegeList);
		static result PackPrivilegeN(const Tizen::Base::Collection::IList& privilegeList, int visibilityLevel, byte** ppBitwisePrivilege);
		static result GetEncryptedBitwise(byte* __bitwisePrivilege, Tizen::Base::String& encryptedPrivileges);
		static result GetChecksum(Tizen::App::AppId appId, byte* __bitwisePrivilege, Tizen::Base::String& checksum);
		static result PickExternalPrivilege(const Tizen::Base::Collection::IList& fullPrivilegeList, int visibilityLevel, Tizen::Base::Collection::IList& normalPrivilegeList, Tizen::Base::Collection::IList& externalPrivilegeList);
		static int GetPrivilegeLevel(const Tizen::Base::String& privilegeLevel);

}; // PrivilegeHandler

#endif // _PRIVILEGE_HANDLER_H_