| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_CERT_INTERNAL_TRUST_STORE_NSS_H_ | 5 #ifndef NET_CERT_INTERNAL_TRUST_STORE_NSS_H_ |
| 6 #define NET_CERT_INTERNAL_TRUST_STORE_NSS_H_ | 6 #define NET_CERT_INTERNAL_TRUST_STORE_NSS_H_ |
| 7 | 7 |
| 8 #include <certt.h> | 8 #include <certt.h> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
| 12 #include "net/cert/internal/trust_store.h" | 12 #include "net/cert/internal/trust_store.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 // TrustStoreNSS is an implementation of TrustStore which uses NSS to find trust | 16 // TrustStoreNSS is an implementation of TrustStore which uses NSS to find trust |
| 17 // anchors for path building. | 17 // anchors for path building. |
| 18 // TODO(mattm): also implement CertIssuerSource to return intermediates in NSS | |
| 19 // DB? Or have a separate CertIssuerSourceNSS for that? (implementing both in | |
| 20 // the same class could be more efficient with some caching/etc. Need to be | |
| 21 // careful about caching between different pathbuilder instances though.) | |
| 22 class NET_EXPORT TrustStoreNSS : public TrustStore { | 18 class NET_EXPORT TrustStoreNSS : public TrustStore { |
| 23 public: | 19 public: |
| 24 // Creates a TrustStoreNSS which will find anchors that are trusted for | 20 // Creates a TrustStoreNSS which will find anchors that are trusted for |
| 25 // |trust_type|. | 21 // |trust_type|. |
| 26 explicit TrustStoreNSS(SECTrustType trust_type); | 22 explicit TrustStoreNSS(SECTrustType trust_type); |
| 27 ~TrustStoreNSS() override; | 23 ~TrustStoreNSS() override; |
| 28 | 24 |
| 29 // TrustStore implementation: | 25 // TrustStore implementation: |
| 30 void FindTrustAnchorsForCert(const scoped_refptr<ParsedCertificate>& cert, | 26 void FindTrustAnchorsForCert(const scoped_refptr<ParsedCertificate>& cert, |
| 31 TrustAnchors* matches) const override; | 27 TrustAnchors* matches) const override; |
| 32 | 28 |
| 33 private: | 29 private: |
| 34 SECTrustType trust_type_; | 30 SECTrustType trust_type_; |
| 35 | 31 |
| 36 DISALLOW_COPY_AND_ASSIGN(TrustStoreNSS); | 32 DISALLOW_COPY_AND_ASSIGN(TrustStoreNSS); |
| 37 }; | 33 }; |
| 38 | 34 |
| 39 } // namespace net | 35 } // namespace net |
| 40 | 36 |
| 41 #endif // NET_CERT_INTERNAL_TRUST_STORE_NSS_H_ | 37 #endif // NET_CERT_INTERNAL_TRUST_STORE_NSS_H_ |
| OLD | NEW |