Add support for AUTHENTICATION_FAILED code in getData function.
[platform/core/security/key-manager.git] / src / manager / common / certificate-store.h
1 /* Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
2  *
3  *  Licensed under the Apache License, Version 2.0 (the "License");
4  *  you may not use this file except in compliance with the License.
5  *  You may obtain a copy of the License at
6  *
7  *      http://www.apache.org/licenses/LICENSE-2.0
8  *
9  *  Unless required by applicable law or agreed to in writing, software
10  *  distributed under the License is distributed on an "AS IS" BASIS,
11  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  *  See the License for the specific language governing permissions and
13  *  limitations under the License
14  *
15  *
16  * @file        certificate-stack.h
17  * @author      Barlomiej Grzelewski (b.grzelewski@samsung.com)
18  * @version     1.0
19  * @brief       Certificate Stack Implmentation.
20  */
21 #include <certificate-impl.h>
22 #include <symbol-visibility.h>
23
24 extern "C" {
25 struct x509_store_st;
26 typedef struct x509_store_st X509_STORE;
27 }
28
29 namespace CKM {
30
31 class COMMON_API CertificateStore {
32 public:
33     CertificateStore();
34     CertificateStore(const CertificateStore &) = delete;
35     CertificateStore(CertificateStore &&) = delete;
36     CertificateStore& operator=(CertificateStore &&) = delete;
37     CertificateStore& operator=(const CertificateStore &) = delete;
38     virtual ~CertificateStore();
39
40     int verifyCertificate(
41         const CertificateImpl &cert,
42         const CertificateImplVector &untrustedVector,
43         const CertificateImplVector &trustedVector,
44         bool useTrustedSystemCertificates,
45         bool stateCCMode,
46         CertificateImplVector &chainVector);
47
48 private:
49     int addSystemCertificateDirs();
50     int addSystemCertificateFiles();
51     int addCustomTrustedCertificates(const CertificateImplVector &trustedVector);
52
53     X509_STORE* m_store;
54 };
55
56 } // namespace CKM
57