6078fbabe51ab688282eb888525e8152d028c029
[platform/framework/native/installer.git] / src / XmlHandler / SignatureHandler.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  * @file SignatureHandler.h
19  * @brief       This is the header file for the %SignatureHandler class.
20  *
21  * This header file contains the declarations of the %SignatureHandler class.
22  */
23 #ifndef _SIGNATURE_HANDLER_H_
24 #define _SIGNATURE_HANDLER_H_
25
26 #include "XmlHandler.h"
27 #include "InstallationContext.h"
28
29 /**
30  * @class               SignatureHandler
31  * @brief               This class represents the class of SignatureHandler.
32  * @since               1.0
33  *
34  * This class represents the class of SignatureHandler.
35  *
36  */
37 class SignatureHandler
38         : public XmlHandler
39 {
40 public:
41         SignatureHandler(void);
42         virtual ~SignatureHandler(void);
43
44         bool Construct(InstallationContext *pConext);
45         bool Parse(const char *pFilepath);
46
47         Tizen::Base::Collection::ArrayList* GetAuthorCertChain(void);
48         Tizen::Base::Collection::ArrayList* GetDistributorCertChain(void);
49
50 private:
51         SignatureHandler(const SignatureHandler& value);
52         SignatureHandler& operator =(const SignatureHandler& source);
53
54         virtual bool OnStartElement(const char *pName);
55         virtual bool OnEndElement(const char *pName);
56         virtual bool OnCharacters(const char *pCharacters);
57
58         bool OnSignatureElement(void);
59         bool OnCertificateValue(const char *pCharacters);
60
61
62 private:
63         InstallationContext* __pContext;
64         Tizen::Base::Collection::ArrayList* __pAuthorCertChain;
65         Tizen::Base::Collection::ArrayList* __pDistributorCertChain;
66         bool __isAuthorSignature;
67         bool __isDistributorSignature;
68
69
70 }; // SignatureHandler
71
72 #endif // _SIGNATURE_HANDLER_H_