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.
19 * @file FSecCrypto_TrustZoneService.h
20 * @brief This is the header file for the _TrustZoneService class.
22 * This file contains the declarations of _TrustZoneService.
25 #ifndef _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
26 #define _FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_
28 #include <FBaseResult.h>
29 #include <FBaseObject.h>
30 #include <FBaseString.h>
32 namespace Tizen { namespace Io
37 namespace Tizen { namespace Base { namespace Runtime
42 namespace Tizen { namespace Security { namespace Crypto
46 * @class _TrustZoneService
47 * @brief This class is provide IPC API for TrustZone Management.
50 * The %_TrustZoneService class is used for to provide TrustZone Management's IPC API.
52 * For more information on the class features, see <a href="../com.osp.cppappprogramming.help/html/dev_guide/security/certificate_namespace.htm">Certificates</a>.
55 class _OSP_EXPORT_ _TrustZoneService
60 * Creates and intialize the instance of _TrustZoneService class.
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.
69 static _TrustZoneService* GetInstance(void);
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);
74 static void Release(void);
77 // This default constructor is intentionally declared as private to
78 // implement the Singleton semantic.
79 _TrustZoneService(void);
81 // This destructor is intentionally declared as private to
82 // implement the Singleton semantic.
83 ~_TrustZoneService(void);
85 _TrustZoneService(const _TrustZoneService& rhs);
87 _TrustZoneService& operator =(const _TrustZoneService& rhs);
89 //This construct function initialises the _TrustZoneService instance
90 static void Construct(void);
91 static void Initialize(void);
94 static Tizen::Io::_IpcClient* __pIpcClient;
95 static _TrustZoneService* __pTrustZoneService;
96 static unsigned int __refCount;
97 }; // _TrustZoneService
100 }}} // Tizen::Security::TrustZoneService
101 #endif //_FSEC_CRTYPTO_INTERNAL_TRUST_ZONE_SERVICE_H_