OLD | NEW |
(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_ |
OLD | NEW |