sync with tizen_2.0
[platform/framework/native/appfw.git] / src / security / inc / FSecCert_CertServiceStub.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        FSecCert_CertServiceStub.h
20  * @brief       This is the header file for the _CertServiceStub class.
21  *
22  * This file contains the declarations of _CertServiceStub.
23  */
24
25 #ifndef _FSEC_CERT_INTERNAL_CERT_SERVICE_STUB_H_
26 #define _FSEC_CERT_INTERNAL_CERT_SERVICE_STUB_H_
27
28 #include <FBaseByteBuffer.h>
29 #include <FBaseResult.h>
30 #include <FBaseObject.h>
31 #include <FBaseString.h>
32
33 #include "FIo_IIpcServerEventListener.h"
34 #include "FIo_IpcCommonParamTraits.h"
35 #include "FSecCert_CertTypes.h"
36
37 namespace Tizen { namespace Io
38 {
39 class _IpcServer;
40 } }
41
42 namespace Tizen { namespace Security { namespace Cert
43 {
44
45 class _OSP_EXPORT_ _CertServiceStub
46         : public Tizen::Io::_IIpcServerEventListener
47         , public Tizen::Base::Object
48 {
49 public:
50         _CertServiceStub(void);
51
52         virtual ~_CertServiceStub(void);
53
54 public:
55         // __IIPcServerEventListener interfaces
56         virtual result Construct(void);
57
58         virtual void OnIpcServerStarted(const Tizen::Io::_IpcServer& server);
59
60         virtual void OnIpcServerStopped(const Tizen::Io::_IpcServer& server);
61
62         virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
63
64         virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer& server, int clientId);
65
66         virtual void OnIpcRequestReceived(Tizen::Io::_IpcServer& server, const IPC::Message& message);
67
68         //CertService handler method
69
70         bool OnGetName(result* pRet);
71
72         bool OnCloseCertificateStore(int certificateStoreCtx, result* pRet);
73
74         bool OnOpenCertificateStoreByType(int type, int* pCount, int* pRootHandle, result* pRet);
75
76         bool OnGetCertificateCount(int certificateStoreCtx, int* pRootHandle, result* pRet);
77
78         bool OnGetNextCertificate(int certificateStoreCtx, int length, Tizen::Io::_IpcBuffer* pCertBufferIpc, result* pRet);
79
80         bool OnUpdateRootCa(int type, Tizen::Io::_IpcBuffer certOldBufferIpc, Tizen::Io::_IpcBuffer certNewBufferIpc, result* pRet);
81
82         bool OnRemoveRootCa(int type, Tizen::Io::_IpcBuffer certBufferIpc, int bufLen, result* pRet);
83
84         bool OnUninstallUserRootCertificateByCertId(int certId, result* pRet);
85
86         bool OnInsertCaCertificate(int type, int format, Tizen::Io::_IpcBuffer certBuffer, long certLen, result* pRet);
87
88         bool OnInsertUserCaCertificate(int format, Tizen::Io::_IpcBuffer certBuffer, int certLen, result* pRet);
89
90         bool OnInstallUserRootCertificate(Tizen::Io::_IpcBuffer filePath, result* pRet);
91
92         bool OnInsertUserCertChainPrivateKey(Tizen::Io::_IpcBuffer certChainBufferIpc, int certSize, Tizen::Io::_IpcBuffer privateKeyBufferIpc, int userPriKeyLen, result* pRet);
93
94         bool OnInsertCertificateChainWithPrivateKey(Tizen::Io::_IpcBuffer certChainPrivateKeyBufferIpc, int certChainPrivateKeyLength, result* pRet);
95
96         bool OnInstallPkcs12Content(Tizen::Io::_IpcBuffer pkcs12FilePath, Tizen::Io::_IpcBuffer pkcs12ImportPassword, result* pRet);
97
98         bool OnDeleteUserCertChainByCertId(int certID, result* pRet);
99
100         bool OnDeleteUserCertificateByCertId(int certID, result* pRet);
101
102         bool OnGetUserCertChainByIssuerAndSubjectNameN(Tizen::Io::_IpcBuffer issuerBufferIpc, int issuerNameLen, Tizen::Io::_IpcBuffer subjectBufferIpc, int subNameLen, _CertificateListInfo* pCertList, result* pRet);
103
104         bool OnGetUserCertificateByCertIdN(int certId, int encodingType, _CertInfo* pUserCertificateList, result* pRet);
105
106         bool OnGetUserCertFieldInfoByCertId(int certId, _CertFieldInfos* pCertFieldInfos, result* pRet);
107
108 private:
109         _CertServiceStub(const _CertServiceStub& rhs);
110
111         _CertServiceStub& operator =(const _CertServiceStub& rhs);
112
113 private:
114         Tizen::Io::_IpcServer* __pIpcServer;
115 }; // _CertServiceStub
116
117 } } } // Tizen::Security::Cert
118
119 #endif // _FSEC_CERT_INTERNAL_CERT_SERVICE_STUB_H_