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 NET_CERT_NSS_CERT_DATABASE_CHROMEOS_ | 5 #ifndef NET_CERT_NSS_CERT_DATABASE_CHROMEOS_ |
6 #define NET_CERT_NSS_CERT_DATABASE_CHROMEOS_ | 6 #define NET_CERT_NSS_CERT_DATABASE_CHROMEOS_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "crypto/scoped_nss_types.h" | 10 #include "crypto/scoped_nss_types.h" |
11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
12 #include "net/cert/nss_cert_database.h" | 12 #include "net/cert/nss_cert_database.h" |
13 #include "net/cert/nss_profile_filter_chromeos.h" | 13 #include "net/cert/nss_profile_filter_chromeos.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 | 16 |
17 class NET_EXPORT NSSCertDatabaseChromeOS : public NSSCertDatabase { | 17 class NET_EXPORT NSSCertDatabaseChromeOS : public NSSCertDatabase { |
18 public: | 18 public: |
19 NSSCertDatabaseChromeOS(crypto::ScopedPK11Slot public_slot, | 19 NSSCertDatabaseChromeOS(crypto::ScopedPK11Slot public_slot, |
20 crypto::ScopedPK11Slot private_slot); | 20 crypto::ScopedPK11Slot private_slot); |
21 virtual ~NSSCertDatabaseChromeOS(); | 21 virtual ~NSSCertDatabaseChromeOS(); |
22 | 22 |
23 // NSSCertDatabase implementation. | 23 // NSSCertDatabase implementation. |
24 virtual void ListCertsSync(CertificateList* certs) OVERRIDE; | 24 virtual void ListCertsSync(CertificateList* certs) OVERRIDE; |
25 virtual void ListCerts(const NSSCertDatabase::ListCertsCallback& callback) | 25 virtual void ListCerts( |
26 OVERRIDE; | 26 const NSSCertDatabase::ListCertsCallback& callback) OVERRIDE; |
27 virtual crypto::ScopedPK11Slot GetPublicSlot() const OVERRIDE; | 27 virtual crypto::ScopedPK11Slot GetPublicSlot() const OVERRIDE; |
28 virtual crypto::ScopedPK11Slot GetPrivateSlot() const OVERRIDE; | 28 virtual crypto::ScopedPK11Slot GetPrivateSlot() const OVERRIDE; |
29 virtual void ListModules(CryptoModuleList* modules, bool need_rw) const | 29 virtual void ListModules(CryptoModuleList* modules, |
30 OVERRIDE; | 30 bool need_rw) const OVERRIDE; |
31 | 31 |
32 // TODO(mattm): handle trust setting, deletion, etc correctly when certs exist | 32 // TODO(mattm): handle trust setting, deletion, etc correctly when certs exist |
33 // in multiple slots. | 33 // in multiple slots. |
34 // TODO(mattm): handle trust setting correctly for certs in read-only slots. | 34 // TODO(mattm): handle trust setting correctly for certs in read-only slots. |
35 | 35 |
36 private: | 36 private: |
37 // Certificate listing implementation used by |ListCerts| and |ListCertsSync|. | 37 // Certificate listing implementation used by |ListCerts| and |ListCertsSync|. |
38 // The certificate list normally returned by NSSCertDatabase::ListCertsImpl | 38 // The certificate list normally returned by NSSCertDatabase::ListCertsImpl |
39 // is additionally filtered by |profile_filter|. | 39 // is additionally filtered by |profile_filter|. |
40 // Static so it may safely be used on the worker thread. | 40 // Static so it may safely be used on the worker thread. |
41 static void ListCertsImpl(const NSSProfileFilterChromeOS& profile_filter, | 41 static void ListCertsImpl(const NSSProfileFilterChromeOS& profile_filter, |
42 CertificateList* certs); | 42 CertificateList* certs); |
43 | 43 |
44 crypto::ScopedPK11Slot public_slot_; | 44 crypto::ScopedPK11Slot public_slot_; |
45 crypto::ScopedPK11Slot private_slot_; | 45 crypto::ScopedPK11Slot private_slot_; |
46 NSSProfileFilterChromeOS profile_filter_; | 46 NSSProfileFilterChromeOS profile_filter_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabaseChromeOS); | 48 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabaseChromeOS); |
49 }; | 49 }; |
50 | 50 |
51 } // namespace net | 51 } // namespace net |
52 | 52 |
53 #endif // NET_CERT_NSS_CERT_DATABASE_CHROMEOS_ | 53 #endif // NET_CERT_NSS_CERT_DATABASE_CHROMEOS_ |
OLD | NEW |