Refactor SignatureValidator and reduce interface headers
[platform/core/security/cert-svc.git] / vcore / src / vcore / CertStoreType.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  * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
18  * @file        CertStoreType.h
19  * @version     1.0
20  * @brief       Identification of certificate domain. Certificate domains
21  *              were defined in WAC 1.0 documentation. This is a part
22  *              should be implemented in wrt-installer.
23  */
24 #ifndef _VALIDATION_CORE_CERTSTORETYPE_H_
25 #define _VALIDATION_CORE_CERTSTORETYPE_H_
26
27 #include <string>
28
29 namespace ValidationCore {
30 namespace CertStoreId {
31 typedef unsigned int Type;
32
33 // RootCA certificates for developer mode.
34 const Type TIZEN_DEVELOPER = 1;
35 // RootCA certificates for author signatures.
36 const Type TIZEN_TEST = 1 << 1;
37 const Type TIZEN_VERIFY = 1 << 2;
38 const Type TIZEN_STORE = 1 << 3;
39 // RootCA's visibility level : public
40 const Type VIS_PUBLIC = 1 << 6;
41 // RootCA's visibility level : partner
42 const Type VIS_PARTNER = 1 << 7;
43 // RootCA's visibility level : partner-operator
44 const Type VIS_PARTNER_OPERATOR = 1 << 8;
45 // RootCA's visibility level : partner-manufacturer
46 const Type VIS_PARTNER_MANUFACTURER = 1 << 9;
47 // RootCA's visibility level : platform
48 const Type VIS_PLATFORM = 1 << 10;
49
50 class Set {
51 public:
52     Set();
53     virtual ~Set();
54
55     void add(Type second);
56     bool contains(Type second) const;
57     bool isContainsVis() const;
58     bool isEmpty() const;
59
60     std::string typeToString() const;
61
62 private:
63     Type m_certificateStorage;
64 };
65
66 } // namespace CertStoreId
67 } // namespace ValidationCore
68
69 #endif //  _VALIDATION_CORE_CERTSTORETYPE_H_