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