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 "base/memory/ref_counted.h" |
| 9 #include "net/base/net_export.h" |
| 10 #include "net/cert/internal/cert_issuer_source.h" |
| 11 #include "net/cert/internal/trust_store.h" |
| 12 |
| 13 namespace base { |
| 14 class TaskRunner; |
| 15 } |
| 16 |
| 17 namespace net { |
| 18 |
| 19 // TrustStoreNSS is an implementation of TrustStore and CertIssuerSource which |
| 20 // provides uses NSS to do trust checks and to provide certificates (both |
| 21 // intermediates and roots) from the NSS DB for path building. |
| 22 class NET_EXPORT TrustStoreNSS : public TrustStore { |
| 23 public: |
| 24 // Creates a TrustStoreNSS. All NSS calls will be done on |nss_task_runner|. |
| 25 explicit TrustStoreNSS(scoped_refptr<base::TaskRunner> nss_task_runner); |
| 26 ~TrustStoreNSS() override; |
| 27 |
| 28 // TrustStore implementation: |
| 29 void IsTrustedCertificate( |
| 30 scoped_refptr<ParsedCertificate> cert, |
| 31 const TrustCallback& callback, |
| 32 bool* out_trusted, |
| 33 std::unique_ptr<TrustStore::Request>* out_req) const override; |
| 34 |
| 35 // CertIssuerSource implementation: |
| 36 void SyncGetIssuersOf(const ParsedCertificate* cert, |
| 37 ParsedCertificateList* issuers) override; |
| 38 void AsyncGetIssuersOf( |
| 39 scoped_refptr<ParsedCertificate> cert, |
| 40 const IssuerCallback& callback, |
| 41 std::unique_ptr<CertIssuerSource::Request>* out_req) override; |
| 42 |
| 43 private: |
| 44 scoped_refptr<base::TaskRunner> nss_task_runner_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(TrustStoreNSS); |
| 47 }; |
| 48 |
| 49 } // namespace net |
| 50 |
| 51 #endif // NET_CERT_INTERNAL_TRUST_STORE_NSS_H_ |
OLD | NEW |