Merge "GetPackageAppInfoListN() is added with package, app filter." into tizen_2.1
[platform/framework/native/appfw.git] / src / security / inc / FSecCrypto_TrustZoneService.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file        FSecCrypto_TrustZoneService.h
20  * @brief       This is the header file for the _TrustZoneService class.
21  *
22  * This file contains the declarations of _TrustZoneService.
23  */
24
25 #ifndef _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
26 #define _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
27
28 #include <FBaseResult.h>
29 #include <FBaseObject.h>
30 #include <FBaseString.h>
31
32 namespace Tizen { namespace Io
33 {
34 class _IpcClient;
35 } }
36
37 namespace Tizen { namespace Base { namespace Runtime
38 {
39 class Mutex;
40 } } }
41
42 namespace Tizen { namespace Security { namespace Crypto
43 {
44
45 /**
46  * @class       _TrustZoneService
47  * @brief       This class is provide IPC API for TrustZone Management.
48  * @since 2.1
49  * /////
50  * The %_TrustZoneService class is used for to provide TrustZone Management's IPC API.
51  * /////
52  * For more information on the class features, see <a href="../com.osp.cppappprogramming.help/html/dev_guide/security/certificate_namespace.htm">Certificates</a>.
53  *
54  */
55 class _OSP_EXPORT_ _TrustZoneService
56 {
57
58 public:
59         /**
60          * Creates and intialize the instance of _TrustZoneService class.
61          *
62          * @since 2.1
63          * @return                      An error code.
64          * @exception           E_SUCCESS                                       The method is successful.
65          * @exception           E_OUT_OF_MEMORY                         The memory is insufficient.
66          * @exception           E_SYSTEM                                        A system error has occurred.
67          *                                                                                              - IPC operation failed.
68          */
69         static _TrustZoneService* GetInstance(void);
70
71         Tizen::Base::ByteBuffer* EncryptN(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& plainBuffer);
72         Tizen::Base::ByteBuffer* DecryptN(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& EncryptedBuffer);
73
74         static void Release(void);
75
76 private:
77         // This default constructor is intentionally declared as private to
78         // implement the Singleton semantic.
79         _TrustZoneService(void);
80
81         // This destructor is intentionally declared as private to
82         // implement the Singleton semantic.
83         ~_TrustZoneService(void);
84
85         _TrustZoneService(const _TrustZoneService& rhs);
86
87         _TrustZoneService& operator =(const _TrustZoneService& rhs);
88
89         //This construct function initialises the _TrustZoneService instance
90         static void Construct(void);
91         static void Initialize(void);
92
93 private:
94         static Tizen::Io::_IpcClient* __pIpcClient;
95         static _TrustZoneService* __pTrustZoneService;
96         static unsigned int __refCount;
97 }; // _TrustZoneService
98
99
100 }}} // Tizen::Security::TrustZoneService
101 #endif //_FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_