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

Unified Diff: net/cert/nss_profile_filter_chromeos.h

Issue 112533002: Add ClientCertStoreChromeOS which only returns the certs for a given user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: net/cert/nss_profile_filter_chromeos.h
diff --git a/net/cert/nss_profile_filter_chromeos.h b/net/cert/nss_profile_filter_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..68bed8a695dbffb8927a6df596b033fefb3174c8
--- /dev/null
+++ b/net/cert/nss_profile_filter_chromeos.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_CERT_NSS_PROFILE_FILTER_CHROMEOS
+#define NET_CERT_NSS_PROFILE_FILTER_CHROMEOS
+
+#include "base/callback_forward.h"
+#include "crypto/scoped_nss_types.h"
+#include "net/base/crypto_module.h"
+#include "net/cert/x509_certificate.h"
+
+namespace content {
+class ResourceContext;
+} // namespace content
+
+namespace net {
+
+class NET_EXPORT NSSProfileFilterChromeOS {
+ public:
+ NSSProfileFilterChromeOS();
+ ~NSSProfileFilterChromeOS();
+
+ // Initialize with slot handles.
+ void Init(crypto::ScopedPK11Slot public_slot,
+ crypto::ScopedPK11Slot private_slot);
+
+ bool IsModuleAllowed(PK11SlotInfo* slot) const;
+ bool IsCertAllowed(const scoped_refptr<X509Certificate>& cert) const;
+ // Predicate that can be used with remove_if. The operator() returns
Ryan Sleevi 2013/12/11 06:52:50 nit: add linebreak
mattm 2013/12/12 00:45:22 Done.
+ // !IsCertAllowed(cert) or !IsModuleAllowed(module->os_module_handle()).
+ class Predicate {
Ryan Sleevi 2013/12/11 06:52:50 naming nit: The naming here isn't very clear, and
mattm 2013/12/12 00:45:22 Renamed and split into two.
+ public:
+ Predicate(const NSSProfileFilterChromeOS& filter);
+ bool operator()(const scoped_refptr<CryptoModule>& module) const;
+ bool operator()(const scoped_refptr<X509Certificate>& cert) const;
+ private:
Ryan Sleevi 2013/12/11 06:52:50 style nit: line break
mattm 2013/12/12 00:45:22 Done.
+ const NSSProfileFilterChromeOS& filter_;
+ };
+
+ private:
+ crypto::ScopedPK11Slot public_slot_;
+ crypto::ScopedPK11Slot private_slot_;
+
+ DISALLOW_COPY_AND_ASSIGN(NSSProfileFilterChromeOS);
+};
+
+} // namespace net
+
+#endif // NET_CERT_NSS_PROFILE_FILTER_CHROMEOS

Powered by Google App Engine
This is Rietveld 408576698