| 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_COLLECTION_H_ | 5 #ifndef NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ |
| 6 #define NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ | 6 #define NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
| 10 #include "net/cert/internal/trust_store.h" | 10 #include "net/cert/internal/trust_store.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 // TrustStoreCollection is an implementation of TrustStore which combines the | 14 // TrustStoreCollection is an implementation of TrustStore which combines the |
| 15 // results from multiple TrustStores. | 15 // results from multiple TrustStores. |
| 16 // | 16 // |
| 17 // The order of the matches will correspond to a concatenation of matches in | 17 // The order of the matches will correspond to a concatenation of matches in |
| 18 // the order the stores were added. | 18 // the order the stores were added. |
| 19 class NET_EXPORT TrustStoreCollection : public TrustStore { | 19 class NET_EXPORT TrustStoreCollection : public TrustStore { |
| 20 public: | 20 public: |
| 21 TrustStoreCollection(); | 21 TrustStoreCollection(); |
| 22 ~TrustStoreCollection() override; | 22 ~TrustStoreCollection() override; |
| 23 | 23 |
| 24 // Includes results from |store| in the combined output. |store| must | 24 // Includes results from |store| in the combined output. |store| must |
| 25 // outlive the TrustStoreCollection. | 25 // outlive the TrustStoreCollection. |
| 26 void AddTrustStore(TrustStore* store); | 26 void AddTrustStore(TrustStore* store); |
| 27 | 27 |
| 28 // TrustStore implementation: | 28 // TrustStore implementation: |
| 29 void FindTrustAnchorsForCert(const scoped_refptr<ParsedCertificate>& cert, | 29 void SyncGetIssuersOf(const ParsedCertificate* cert, |
| 30 TrustAnchors* matches) const override; | 30 ParsedCertificateList* issuers) override; |
| 31 void GetTrust(const scoped_refptr<ParsedCertificate>& cert, |
| 32 CertificateTrust* trust) const override; |
| 31 | 33 |
| 32 private: | 34 private: |
| 33 std::vector<TrustStore*> stores_; | 35 std::vector<TrustStore*> stores_; |
| 34 | 36 |
| 35 DISALLOW_COPY_AND_ASSIGN(TrustStoreCollection); | 37 DISALLOW_COPY_AND_ASSIGN(TrustStoreCollection); |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 } // namespace net | 40 } // namespace net |
| 39 | 41 |
| 40 #endif // NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ | 42 #endif // NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ |
| OLD | NEW |