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

Side by Side Diff: net/cert/internal/trust_store_in_memory.h

Issue 2252933002: Make TrustStore into an interface, move impl to TrustStoreInMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update cast_cert_validator_unittest.cc Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « net/cert/internal/trust_store.cc ('k') | net/cert/internal/trust_store_in_memory.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 2016 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_INTERNAL_TRUST_STORE_IN_MEMORY_H_
6 #define NET_CERT_INTERNAL_TRUST_STORE_IN_MEMORY_H_
7
8 #include <unordered_map>
9
10 #include "base/memory/ref_counted.h"
11 #include "base/strings/string_piece.h"
12 #include "net/base/net_export.h"
13 #include "net/cert/internal/trust_store.h"
14
15 namespace net {
16
17 namespace der {
18 class Input;
19 }
20
21 // A very simple implementation of a TrustStore, which contains a set of
22 // trust anchors.
23 class NET_EXPORT TrustStoreInMemory : public TrustStore {
24 public:
25 TrustStoreInMemory();
26 ~TrustStoreInMemory() override;
27
28 // Empties the trust store, resetting it to original state.
29 void Clear();
30
31 void AddTrustAnchor(scoped_refptr<TrustAnchor> anchor);
32
33 // Returns the trust anchors that match |name| in |*matches|, if any.
34 void FindTrustAnchorsByNormalizedName(const der::Input& normalized_name,
35 TrustAnchors* matches) const override;
36
37 private:
38 // Multimap from normalized subject -> TrustAnchor.
39 std::unordered_multimap<base::StringPiece,
40 scoped_refptr<TrustAnchor>,
41 base::StringPieceHash>
42 anchors_;
43
44 DISALLOW_COPY_AND_ASSIGN(TrustStoreInMemory);
45 };
46
47 } // namespace net
48
49 #endif // NET_CERT_INTERNAL_TRUST_STORE_IN_MEMORY_H_
OLDNEW
« no previous file with comments | « net/cert/internal/trust_store.cc ('k') | net/cert/internal/trust_store_in_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698