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.
17 * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
19 * @file VerificationStatus.h
20 * @brief OCSP/CRL status.
22 #ifndef _VALIDATION_CORE_VERIFICATION_STATUS_H_
23 #define _VALIDATION_CORE_VERIFICATION_STATUS_H_
25 namespace ValidationCore {
26 enum VerificationStatus
28 //! The certificate has not been revoked.
29 /*! Connection to OCSP responder was successful and the certificate
30 * has not been revoked.
32 VERIFICATION_STATUS_GOOD = 1,
34 //! The certificate has been revoked.
35 /*! Connection to OCSP responder was successful and the certificate
37 * RFC2560: "The "revoked" state indicates that the certificate has
38 * been revoked (either permanantly or temporarily
41 VERIFICATION_STATUS_REVOKED = 1 << 1,
43 //! The certificate status is unknown.
44 /*! Connection to OCSP responder was successful and the certificate
47 * RFC2560: "The "unknown" state indicates that the responder
48 * doesn't know about the certificate being requested."
50 VERIFICATION_STATUS_UNKNOWN = 1 << 2,
52 //! The certificate status was not figure out.
53 /*! The response from ocsp/crl server contains broken signature. */
54 VERIFICATION_STATUS_VERIFICATION_ERROR = 1 << 3,
56 //! The certificate status was not figure out.
57 /*! The certificate does not contain ocsp/crl extension. */
58 VERIFICATION_STATUS_NOT_SUPPORT = 1 << 4,
60 //! The certificate status was not figure out.
61 /*! The CertMgr could not connect to OCSP responder. */
62 VERIFICATION_STATUS_CONNECTION_FAILED = 1 << 5,
64 //! The certificate status is unknown due to internal error inside OCSP
65 VERIFICATION_STATUS_ERROR = 1 << 6
68 class VerificationStatusSet
71 VerificationStatusSet();
73 void add(VerificationStatus status);
75 bool contains(VerificationStatus status) const;
79 void operator+=(const VerificationStatusSet &second);
83 VerificationStatus convertToStatus() const;
86 unsigned int m_verdictMap;
89 /* TODO this status should be defined in wrt-engine sources */
90 enum WidgetVerificationStatus
92 // All certificate has been veficated and all certificates are good.
93 // Widget is able to be installed.
94 WIDGET_VERIFICATION_STATUS_GOOD,
95 // Some certificate has been revoked. Widget is not able to be installed.
96 WIDGET_VERIFICATION_STATUS_REVOKED,
99 } // namespace ValidationCore
101 #endif // _VALIDATION_CORE_VERIFICATION_STATUS_H_