4ff7c0365eb0e504c0046f548610c4aa00bb447f
[platform/framework/native/installer.git] / src / Step / SignatureStep.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        SignatureStep.h
19  * @brief       This is the header file for the %SignatureStep class.
20  *
21  * This header file contains the declarations of the %SignatureStep class.
22  */
23 #ifndef _SIGNATURE_STEP_H_
24 #define _SIGNATURE_STEP_H_
25
26 #include "IInstallationStep.h"
27 #include "SignatureManager.h"
28
29 /**
30  * @class               SignatureStep
31  * @brief               This class represents the class of SignatureStep.
32  * @since               1.0
33  *
34  * This class represents the class of SignatureStep.
35  *
36  */
37 class SignatureStep
38         : public IInstallationStep
39 {
40 public:
41         SignatureStep(void);
42         virtual ~SignatureStep(void);
43
44         virtual InstallerError Run(InstallationContext* pContext);
45
46 private:
47         enum
48         {
49                 STATE_SIGNER_INIT,
50                 STATE_SIGNER_CERT,
51                 STATE_CERT_CHAIN,
52                 STATE_ROOT_CERT,
53                 STATE_DONE
54         };
55
56         SignatureStep(const SignatureStep& value);
57         SignatureStep& operator =(const SignatureStep& source);
58
59         void GoNextState(void);
60         InstallerError OnStateSignerInit(void);
61         InstallerError OnStateSignerCert(void);
62         InstallerError OnStateCertChain(void);
63         InstallerError OnStateRootCert(void);
64         InstallerError OnStateDone(void);
65
66 private:
67         int __state;
68         InstallationContext* __pContext;
69         SignatureManager* __pSignatureManager;
70
71 }; // SignatureStep
72
73 #endif //_SIGNATURE_STEP_H_