Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: net/cert/nss_cert_database_chromeos.h

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: certdb: handle GetCertTrust and IsUntrusted, failed attempt to handle SetCertTrust Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/cert/nss_cert_database.cc ('k') | net/cert/nss_cert_database_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_CERT_NSS_CERT_DATABASE_CHROMEOS_
6 #define NET_CERT_NSS_CERT_DATABASE_CHROMEOS_
7
8 #include "base/callback.h"
9 #include "crypto/scoped_nss_types.h"
10 #include "net/cert/nss_cert_database.h"
11 #include "net/cert/nss_profile_filter_chromeos.h"
12
13 namespace net {
14 class CryptoModule;
15 typedef std::vector<scoped_refptr<CryptoModule> > CryptoModuleList;
16 class X509Certificate;
17 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList;
18
19 class NET_EXPORT NSSCertDatabaseChromeOS : public NSSCertDatabase {
20 public:
21 // Should be called only on IO thread.
22 // |callback| may be run sychronously.
23 static void GetForUser(
24 const std::string& username_hash,
25 const base::Callback<void(NSSCertDatabase*)>& callback);
26
27 virtual ~NSSCertDatabaseChromeOS();
28
29 // NSSCertDatabase implementation.
30 virtual void ListCerts(CertificateList* certs) OVERRIDE;
31 virtual crypto::ScopedPK11Slot GetPublicSlot() const OVERRIDE;
32 virtual crypto::ScopedPK11Slot GetPrivateSlot() const OVERRIDE;
33 virtual void ListModules(CryptoModuleList* modules, bool need_rw) const
34 OVERRIDE;
35 virtual TrustBits GetCertTrust(const X509Certificate* cert,
36 CertType type) const OVERRIDE;
37 virtual bool IsUntrusted(const X509Certificate* cert) const OVERRIDE;
38 //virtual bool SetCertTrust(const X509Certificate* cert,
39 // CertType type,
40 // TrustBits trust_bits) OVERRIDE;
41
42 // TODO(mattm): handle trust setting, deletion, etc correctly when certs exist
43 // in multiple slots.
44 // TODO(mattm): handle trust setting correctly for certs in read-only slots.
45
46 class Manager;
47 friend class Manager;
48 private:
49
50 // This class should not be constructed directly. Use GetForUser.
51 explicit NSSCertDatabaseChromeOS(crypto::ScopedPK11Slot public_slot);
52 void SetPrivateSlot(crypto::ScopedPK11Slot private_slot);
53 void OnReady(const base::Callback<void(NSSCertDatabase*)>& callback);
54
55 scoped_refptr<const X509Certificate> ResolveCert(const X509Certificate* cert,
56 bool need_rw) const;
57
58 bool ready_;
59 crypto::ScopedPK11Slot public_slot_;
60 crypto::ScopedPK11Slot private_slot_;
61 NSSProfileFilterChromeOS profile_filter_;
62
63 typedef std::vector<base::Callback<void(NSSCertDatabase*)> >
64 ReadyCallbackList;
65 ReadyCallbackList ready_callback_list_;
66
67 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabaseChromeOS);
68 };
69
70 } // namespace net
71
72 #endif // NET_CERT_NSS_CERT_DATABASE_CHROMEOS_
OLDNEW
« no previous file with comments | « net/cert/nss_cert_database.cc ('k') | net/cert/nss_cert_database_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698