OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_BASE_SSL_CLIENT_AUTH_CACHE_H_ | 5 #ifndef NET_BASE_SSL_CLIENT_AUTH_CACHE_H_ |
6 #define NET_BASE_SSL_CLIENT_AUTH_CACHE_H_ | 6 #define NET_BASE_SSL_CLIENT_AUTH_CACHE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <map> | 10 #include <map> |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Add a client certificate for |server| to the cache. If there is already | 38 // Add a client certificate for |server| to the cache. If there is already |
39 // a client certificate for |server|, it will be overwritten. A NULL | 39 // a client certificate for |server|, it will be overwritten. A NULL |
40 // |client_cert| indicates a preference that no client certificate should | 40 // |client_cert| indicates a preference that no client certificate should |
41 // be sent to |server|. | 41 // be sent to |server|. |
42 void Add(const std::string& server, X509Certificate* client_cert); | 42 void Add(const std::string& server, X509Certificate* client_cert); |
43 | 43 |
44 // Remove the client certificate for |server| from the cache, if one exists. | 44 // Remove the client certificate for |server| from the cache, if one exists. |
45 void Remove(const std::string& server); | 45 void Remove(const std::string& server); |
46 | 46 |
| 47 // Removes all cache entries. |
| 48 void Clear(); |
| 49 |
47 private: | 50 private: |
48 typedef std::string AuthCacheKey; | 51 typedef std::string AuthCacheKey; |
49 typedef scoped_refptr<X509Certificate> AuthCacheValue; | 52 typedef scoped_refptr<X509Certificate> AuthCacheValue; |
50 typedef std::map<AuthCacheKey, AuthCacheValue> AuthCacheMap; | 53 typedef std::map<AuthCacheKey, AuthCacheValue> AuthCacheMap; |
51 | 54 |
52 // internal representation of cache, an STL map. | 55 // internal representation of cache, an STL map. |
53 AuthCacheMap cache_; | 56 AuthCacheMap cache_; |
54 }; | 57 }; |
55 | 58 |
56 } // namespace net | 59 } // namespace net |
57 | 60 |
58 #endif // NET_BASE_SSL_CLIENT_AUTH_CACHE_H_ | 61 #endif // NET_BASE_SSL_CLIENT_AUTH_CACHE_H_ |
OLD | NEW |