2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef _SRC_VALIDATION_CORE_VERIFICATION_STATUS_H_
17 #define _SRC_VALIDATION_CORE_VERIFICATION_STATUS_H_
19 namespace ValidationCore {
20 enum VerificationStatus
22 //! The certificate has not been revoked.
23 /*! Connection to OCSP responder was successful and the certificate
24 * has not been revoked.
26 VERIFICATION_STATUS_GOOD = 1,
28 //! The certificate has been revoked.
29 /*! Connection to OCSP responder was successful and the certificate
31 * RFC2560: "The "revoked" state indicates that the certificate has
32 * been revoked (either permanantly or temporarily
35 VERIFICATION_STATUS_REVOKED = 1 << 1,
37 //! The certificate status is unknown.
38 /*! Connection to OCSP responder was successful and the certificate
41 * RFC2560: "The "unknown" state indicates that the responder
42 * doesn't know about the certificate being requested."
44 VERIFICATION_STATUS_UNKNOWN = 1 << 2,
46 //! The certificate status was not figure out.
47 /*! The response from ocsp/crl server contains broken signature. */
48 VERIFICATION_STATUS_VERIFICATION_ERROR = 1 << 3,
50 //! The certificate status was not figure out.
51 /*! The certificate does not contain ocsp/crl extension. */
52 VERIFICATION_STATUS_NOT_SUPPORT = 1 << 4,
54 //! The certificate status was not figure out.
55 /*! The CertMgr could not connect to OCSP responder. */
56 VERIFICATION_STATUS_CONNECTION_FAILED = 1 << 5,
58 //! The certificate status is unknown due to internal error inside OCSP
59 VERIFICATION_STATUS_ERROR = 1 << 6
62 class VerificationStatusSet
65 VerificationStatusSet() : m_verdictMap(0)
69 inline void add(VerificationStatus status)
71 m_verdictMap |= status;
74 inline bool contains(VerificationStatus status) const
76 return m_verdictMap & status;
79 inline bool isEmpty() const
81 return 0 == m_verdictMap;
84 inline void operator+=(const VerificationStatusSet &second)
86 m_verdictMap |= second.m_verdictMap;
94 VerificationStatus convertToStatus() const;
97 unsigned int m_verdictMap;
100 /* TODO this status should be defined in wrt-engine sources */
101 enum WidgetVerificationStatus
103 // All certificate has been veficated and all certificates are good.
104 // Widget is able to be installed.
105 WIDGET_VERIFICATION_STATUS_GOOD,
106 // Some certificate has been revoked. Widget is not able to be installed.
107 WIDGET_VERIFICATION_STATUS_REVOKED,
109 } // namespace ValidationCore
111 #endif // _SRC_VALIDATION_CORE_VERIFICATION_STATUS_H_