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

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

Issue 2272493002: Add TrustStoreNSS and TrustStoreCollection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-trust-store-interface3-nss
Patch Set: rebase Created 4 years, 3 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.h ('k') | net/cert/internal/trust_store_collection.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_COLLECTION_H_
6 #define NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "net/base/net_export.h"
10 #include "net/cert/internal/trust_store.h"
11
12 namespace base {
13 class TaskRunner;
14 }
15
16 namespace net {
17
18 // TrustStoreCollection is an implementation of TrustStore which combines the
19 // results from multiple TrustStores.
20 //
21 // The synchronous matches will be in order from the primary store, and then
22 // from the secondary stores in the order they were added to the
23 // TrustStoreCollection.
24 //
25 // Currently only one "primary" store can be added that supports async queries,
26 // any number of additional, synchronous-only stores can be used. (The
27 // assumption is that the async one would be useful for OS integration, while
28 // the sync only stores can be used for supplying additional anchors. If
29 // multiple async stores are desired, it might be worth changing the
30 // FindTrustAnchorsForCert interface so that it can return async results in
31 // multiple batches.)
32 class NET_EXPORT TrustStoreCollection : public TrustStore {
33 public:
34 TrustStoreCollection();
35 ~TrustStoreCollection() override;
36
37 // Includes results from |store| in the combined output. Both sync and async
38 // queries to |store| will be allowed. |store| must outlive the
39 // TrustStoreCollection.
40 void SetPrimaryTrustStore(TrustStore* store);
41
42 // Includes results from |store| in the combined output. |store| will only be
43 // queried synchronously. |store| must outlive the TrustStoreCollection.
44 void AddTrustStoreSynchronousOnly(TrustStore* store);
45
46 // TrustStore implementation:
47 void FindTrustAnchorsForCert(
48 const scoped_refptr<ParsedCertificate>& cert,
49 const TrustAnchorsCallback& callback,
50 TrustAnchors* synchronous_matches,
51 std::unique_ptr<Request>* out_req) const override;
52
53 private:
54 TrustStore* primary_store_ = nullptr;
55 std::vector<TrustStore*> sync_only_stores_;
56
57 DISALLOW_COPY_AND_ASSIGN(TrustStoreCollection);
58 };
59
60 } // namespace net
61
62 #endif // NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_
OLDNEW
« no previous file with comments | « net/cert/internal/trust_store.h ('k') | net/cert/internal/trust_store_collection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698