2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FSecCrypto_TrustZoneService.h
19 * @brief This is the header file for the _TrustZoneService class.
21 * This file contains the declarations of _TrustZoneService.
24 #ifndef _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
25 #define _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
27 #include <FBaseResult.h>
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
31 namespace Tizen { namespace Io
36 namespace Tizen { namespace Base { namespace Runtime
41 namespace Tizen { namespace Security { namespace Crypto
45 * @class _TrustZoneService
46 * @brief This class is provide IPC API for TrustZone Management.
49 * The %_TrustZoneService class is used for to provide TrustZone Management's IPC API.
51 * For more information on the class features, see <a href="../com.osp.cppappprogramming.help/html/dev_guide/security/certificate_namespace.htm">Certificates</a>.
54 class _OSP_EXPORT_ _TrustZoneService
59 * Creates and intialize the instance of _TrustZoneService class.
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.
68 static _TrustZoneService* GetInstance(void);
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);
73 static void Release(void);
76 // This default constructor is intentionally declared as private to
77 // implement the Singleton semantic.
78 _TrustZoneService(void);
80 // This destructor is intentionally declared as private to
81 // implement the Singleton semantic.
82 ~_TrustZoneService(void);
84 _TrustZoneService(const _TrustZoneService& rhs);
86 _TrustZoneService& operator =(const _TrustZoneService& rhs);
88 //This construct function initialises the _TrustZoneService instance
89 static void Construct(void);
90 static void Initialize(void);
93 static Tizen::Io::_IpcClient* __pIpcClient;
94 static _TrustZoneService* __pTrustZoneService;
95 static unsigned int __refCount;
96 }; // _TrustZoneService
99 }}} // Tizen::Security::TrustZoneService
100 #endif //_FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_