remove _DeviceKeyGenerator class
[platform/framework/native/appfw.git] / src / security / inc / FSecCrypto_TrustZoneService.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FSecCrypto_TrustZoneService.h
19  * @brief       This is the header file for the _TrustZoneService class.
20  *
21  * This file contains the declarations of _TrustZoneService.
22  */
23
24 #ifndef _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
25 #define _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
26
27 #include <FBaseResult.h>
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30
31 namespace Tizen { namespace Io
32 {
33 class _IpcClient;
34 } }
35
36 namespace Tizen { namespace Base { namespace Runtime
37 {
38 class Mutex;
39 } } }
40
41 namespace Tizen { namespace Security { namespace Crypto
42 {
43
44 /**
45  * @class       _TrustZoneService
46  * @brief       This class is provide IPC API for TrustZone Management.
47  * @since 2.1
48  * /////
49  * The %_TrustZoneService class is used for to provide TrustZone Management's IPC API.
50  * /////
51  * For more information on the class features, see <a href="../com.osp.cppappprogramming.help/html/dev_guide/security/certificate_namespace.htm">Certificates</a>.
52  *
53  */
54 class _OSP_EXPORT_ _TrustZoneService
55 {
56
57 public:
58         /**
59          * Creates and intialize the instance of _TrustZoneService class.
60          *
61          * @since 2.1
62          * @return                      An error code.
63          * @exception           E_SUCCESS                                       The method is successful.
64          * @exception           E_OUT_OF_MEMORY                         The memory is insufficient.
65          * @exception           E_SYSTEM                                        A system error has occurred.
66          *                                                                                              - IPC operation failed.
67          */
68         static _TrustZoneService* GetInstance(void);
69
70         Tizen::Base::ByteBuffer* EncryptN(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& plainBuffer);
71         Tizen::Base::ByteBuffer* DecryptN(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& EncryptedBuffer);
72
73         static void Release(void);
74
75 private:
76         // This default constructor is intentionally declared as private to
77         // implement the Singleton semantic.
78         _TrustZoneService(void);
79
80         // This destructor is intentionally declared as private to
81         // implement the Singleton semantic.
82         ~_TrustZoneService(void);
83
84         _TrustZoneService(const _TrustZoneService& rhs);
85
86         _TrustZoneService& operator =(const _TrustZoneService& rhs);
87
88         //This construct function initialises the _TrustZoneService instance
89         static void Construct(void);
90         static void Initialize(void);
91
92 private:
93         static Tizen::Io::_IpcClient* __pIpcClient;
94         static _TrustZoneService* __pTrustZoneService;
95         static unsigned int __refCount;
96 }; // _TrustZoneService
97
98
99 }}} // Tizen::Security::TrustZoneService
100 #endif //_FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_