630b4787e8464570659c2893e6e3b5c977e90b1f
[platform/core/security/cert-svc.git] / src / vcore / CertStoreType.h
1 /*
2  * Copyright (c) 2016 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 #include <cert-svc/ccert.h>
30
31 namespace ValidationCore {
32 namespace CertStoreId {
33 typedef unsigned int Type;
34
35 // RootCA certificates for developer mode.
36 const Type TIZEN_DEVELOPER = CERTSVC_VISIBILITY_DEVELOPER;
37 // RootCA certificates for author signatures.
38 const Type TIZEN_TEST = 1 << 1;
39 const Type TIZEN_VERIFY = 1 << 2;
40 const Type TIZEN_STORE = 1 << 3;
41 const Type TIZEN_REVOKED = 1 << 4;
42 // RootCA's visibility level : public
43 const Type VIS_PUBLIC = CERTSVC_VISIBILITY_PUBLIC;
44 // RootCA's visibility level : partner
45 const Type VIS_PARTNER = CERTSVC_VISIBILITY_PARTNER;
46 // RootCA's visibility level : platform
47 const Type VIS_PLATFORM = CERTSVC_VISIBILITY_PLATFORM;
48
49 class Set {
50 public:
51         Set();
52         virtual ~Set();
53
54         void add(Type second);
55         bool contains(Type second) const;
56         bool isContainsVis() const;
57         bool isEmpty() const;
58
59         std::string typeToString() const;
60
61 private:
62         Type m_certificateStorage;
63 };
64
65 } // namespace CertStoreId
66 } // namespace ValidationCore
67
68 #endif //  _VALIDATION_CORE_CERTSTORETYPE_H_