OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_CERT_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_CERT_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_CERT_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_CERT_LIBRARY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Returns the index of a Certificate matching |pem_encoded| or -1 if none | 72 // Returns the index of a Certificate matching |pem_encoded| or -1 if none |
73 // found. This function may be slow depending on the number of stored | 73 // found. This function may be slow depending on the number of stored |
74 // certificates. | 74 // certificates. |
75 // TOOD(pneubeck): Either make this more efficient, asynchronous or get rid of | 75 // TOOD(pneubeck): Either make this more efficient, asynchronous or get rid of |
76 // it. | 76 // it. |
77 int GetServerCACertIndexByPEM(const std::string& pem_encoded) const; | 77 int GetServerCACertIndexByPEM(const std::string& pem_encoded) const; |
78 // Same as above but for a PKCS#11 id. | 78 // Same as above but for a PKCS#11 id. |
79 int GetUserCertIndexByPkcs11Id(const std::string& pkcs11_id) const; | 79 int GetUserCertIndexByPkcs11Id(const std::string& pkcs11_id) const; |
80 | 80 |
81 // CertLoader::Observer | 81 // CertLoader::Observer |
82 virtual void OnCertificatesLoaded(const net::CertificateList&, | 82 void OnCertificatesLoaded(const net::CertificateList&, |
83 bool initial_load) override; | 83 bool initial_load) override; |
84 | 84 |
85 private: | 85 private: |
86 CertLibrary(); | 86 CertLibrary(); |
87 virtual ~CertLibrary(); | 87 ~CertLibrary() override; |
88 | 88 |
89 net::X509Certificate* GetCertificateAt(CertType type, int index) const; | 89 net::X509Certificate* GetCertificateAt(CertType type, int index) const; |
90 const net::CertificateList& GetCertificateListForType(CertType type) const; | 90 const net::CertificateList& GetCertificateListForType(CertType type) const; |
91 | 91 |
92 ObserverList<CertLibrary::Observer> observer_list_; | 92 ObserverList<CertLibrary::Observer> observer_list_; |
93 | 93 |
94 // Sorted certificate lists | 94 // Sorted certificate lists |
95 net::CertificateList certs_; | 95 net::CertificateList certs_; |
96 net::CertificateList user_certs_; | 96 net::CertificateList user_certs_; |
97 net::CertificateList server_certs_; | 97 net::CertificateList server_certs_; |
98 net::CertificateList server_ca_certs_; | 98 net::CertificateList server_ca_certs_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(CertLibrary); | 100 DISALLOW_COPY_AND_ASSIGN(CertLibrary); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace chromeos | 103 } // namespace chromeos |
104 | 104 |
105 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_CERT_LIBRARY_H_ | 105 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_CERT_LIBRARY_H_ |
OLD | NEW |