2 // Copyright (c) 2012-2013 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 TrustZoneService.h
19 * @brief This is the header file of the TrustZone Service.
22 #ifndef _TRUST_ZONE_SERVICE_H_
23 #define _TRUST_ZONE_SERVICE_H_
25 #include <FIo_IIpcServerEventListener.h>
26 #include <FIo_IpcCommonDataTypes.h>
28 namespace Tizen { namespace Io
39 namespace Tizen { namespace Base
44 class _OSP_EXPORT_ TrustZoneService
45 : public Tizen::Io::_IIpcServerEventListener
49 TrustZoneService(void);
50 ~TrustZoneService(void);
51 result Construct(void);
55 virtual void OnIpcServerStarted(const Tizen::Io::_IpcServer& server);
56 virtual void OnIpcServerStopped(const Tizen::Io::_IpcServer& server);
57 virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
58 virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer& server, int clientId);
59 virtual void OnIpcRequestReceived(Tizen::Io::_IpcServer& server, const IPC::Message& message);
61 bool OnEncrypt(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& plainBuffer, Tizen::Io::_IpcBuffer* encryptedBuffer, result* pRes);
62 bool OnDecrypt(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& encryptedBuffer, Tizen::Io::_IpcBuffer* plainBuffer, result* pRes);
63 result Encrypt(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& plainBuffer, byte** pBuffer, int& pBufferSize);
64 result Decrypt(const Tizen::Base::ByteBuffer& appInfo, const Tizen::Base::ByteBuffer& encryptedBuffer, byte** pBuffer, int& pBufferSize);
67 int SetPadding(const byte* pData, int dataLen, byte** ppOutData, int* outLen);
69 Tizen::Io::_IpcServer* __pIpcServer;
70 }; // TrustZoneService
72 #endif // _TRUST_ZONE_SERVICE_H_