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

Side by Side Diff: net/cert/internal/trust_store_nss.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_in_memory.cc ('k') | net/cert/internal/trust_store_nss.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_NSS_H_
6 #define NET_CERT_INTERNAL_TRUST_STORE_NSS_H_
7
8 #include <certt.h>
9
10 #include "base/memory/ref_counted.h"
11 #include "net/base/net_export.h"
12 #include "net/cert/internal/trust_store.h"
13
14 namespace base {
15 class TaskRunner;
16 }
17
18 namespace net {
19
20 // TrustStoreNSS is an implementation of TrustStore which uses NSS to find trust
21 // anchors for path building.
22 // TODO(mattm): also implement CertIssuerSource to return intermediates in NSS
23 // DB? Or have a separate CertIssuerSourceNSS for that? (implementing both in
24 // the same class could be more efficient with some caching/etc. Need to be
25 // careful about caching between different pathbuilder instances though.)
26 class NET_EXPORT TrustStoreNSS : public TrustStore {
27 public:
28 // Creates a TrustStoreNSS which will find anchors that are trusted for
29 // |trust_type|. All NSS calls will be done on |nss_task_runner|.
30 TrustStoreNSS(SECTrustType trust_type,
31 scoped_refptr<base::TaskRunner> nss_task_runner);
32 ~TrustStoreNSS() override;
33
34 // TrustStore implementation:
35 void FindTrustAnchorsForCert(
36 const scoped_refptr<ParsedCertificate>& cert,
37 const TrustAnchorsCallback& callback,
38 TrustAnchors* synchronous_matches,
39 std::unique_ptr<Request>* out_req) const override;
40
41 private:
42 SECTrustType trust_type_;
43 scoped_refptr<base::TaskRunner> nss_task_runner_;
44
45 DISALLOW_COPY_AND_ASSIGN(TrustStoreNSS);
46 };
47
48 } // namespace net
49
50 #endif // NET_CERT_INTERNAL_TRUST_STORE_NSS_H_
OLDNEW
« no previous file with comments | « net/cert/internal/trust_store_in_memory.cc ('k') | net/cert/internal/trust_store_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698