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

Unified Diff: net/base/tls_client_login_cache.h

Issue 6804032: Add TLS-SRP (RFC 5054) support Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: remove "httpsv" scheme, minor NSS/OpenSSL changes Created 9 years, 8 months 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
« no previous file with comments | « net/base/ssl_info.cc ('k') | net/base/tls_client_login_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/tls_client_login_cache.h
diff --git a/net/base/tls_client_login_cache.h b/net/base/tls_client_login_cache.h
new file mode 100644
index 0000000000000000000000000000000000000000..35491954d7073a045cc1ff249d775acfded26523
--- /dev/null
+++ b/net/base/tls_client_login_cache.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2011 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_BASE_TLS_CLIENT_LOGIN_CACHE_H_
+#define NET_BASE_TLS_CLIENT_LOGIN_CACHE_H_
+#pragma once
+
+#include <string>
+#include <map>
+
+#include "base/ref_counted.h"
+#include "net/base/auth.h"
+
+namespace net {
+
+// The TLSClientLoginCache class is a simple cache structure to store TLS
+// client login credentials. Provides lookup, insertion, and deletion of
+// entries. The parameter for doing lookups, insertions, and deletions is
+// the server's host and port.
+//
+// TODO(wtc): This class is based on FtpAuthCache. We can extract the common
+// code to a template class.
+class TLSClientLoginCache {
+ public:
+ TLSClientLoginCache();
+ ~TLSClientLoginCache();
+
+ // Checks for cached login credentials for TLS server at |server|.
+ // Returns true if a preference is found, and sets |*tls_auth_data|
+ // to the desired client login credentials.
+ // If cached login credentials are not found, returns false.
+ bool Lookup(const std::string& server,
+ scoped_refptr<AuthData>* tls_auth_data);
+
+ // Add client login credentials for |server| to the cache. If there are
+ // already login credentials for |server|, they will be overwritten.
+ void Add(const std::string& server, AuthData* tls_auth_data);
+
+ // Remove the client certificate for |server| from the cache, if one exists.
+ void Remove(const std::string& server);
+
+ private:
+ typedef std::string AuthCacheKey;
+ typedef scoped_refptr<AuthData> AuthCacheValue;
+ typedef std::map<AuthCacheKey, AuthCacheValue> AuthCacheMap;
+
+ // internal representation of cache, an STL map.
+ AuthCacheMap cache_;
+};
+
+} // namespace net
+
+#endif // NET_BASE_TLS_CLIENT_LOGIN_CACHE_H_
« no previous file with comments | « net/base/ssl_info.cc ('k') | net/base/tls_client_login_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698