[Release] wrt-installer_0.1.114
[framework/web/wrt-installer.git] / src / jobs / widget_install / task_certify.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /**
17  * @file    task_certify.h
18  * @author  Pawel Sikorski (p.sikorski@samgsung.com)
19  * @version
20  * @brief
21  */
22 #ifndef INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFY_H
23 #define INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFY_H
24
25 //SYSTEM INCLUDES
26 #include <string>
27 #include <libxml/c14n.h>
28 #include <vcore/SignatureFinder.h>
29
30 //WRT INCLUDES
31 #include <dpl/task.h>
32
33 class InstallerContext;
34
35 namespace ValidationCore {
36 class SignatureData;
37 }
38
39 namespace Jobs {
40 namespace WidgetInstall {
41 class TaskCertify :
42     public DPL::TaskDecl<TaskCertify>
43 {
44   public:
45     TaskCertify(InstallerContext &inCont);
46
47   private:
48     //data
49     InstallerContext& m_contextData;
50
51     //steps
52     void stepSignature();
53     void stepVerifyUpdate();
54
55     void StartStep();
56     void EndStep();
57
58     void processDistributorSignature(const ValidationCore::SignatureData &data);
59     void processAuthorSignature(const ValidationCore::SignatureData &data);
60     void getSignatureFiles(std::string path,
61             ValidationCore::SignatureFileInfoSet& file);
62
63     bool isTizenWebApp() const;
64 };
65 } //namespace WidgetInstall
66 } //namespace Jobs
67
68 #endif // INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFY_H