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_COLLECTION_H_ |
| 6 #define NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "net/base/net_export.h" |
| 12 #include "net/cert/internal/cert_issuer_source_collection.h" |
| 13 #include "net/cert/internal/trust_store.h" |
| 14 |
| 15 namespace net { |
| 16 |
| 17 // Returns results from a collection of other TrustStores. |
| 18 // |
| 19 // If any of the trust stores returns a trusted value for a cert, it will be |
| 20 // passed on to the caller immediately without waiting for the other trust |
| 21 // stores in the collection to return a result. |
| 22 class NET_EXPORT TrustStoreCollection : public TrustStore { |
| 23 public: |
| 24 TrustStoreCollection(); |
| 25 ~TrustStoreCollection() override; |
| 26 |
| 27 // Adds |store| to the list of TrustStores. The |store| must be valid for the |
| 28 // lifetime of the TrustStoreCollection. |
| 29 void AddStore(TrustStore* store); |
| 30 |
| 31 // TrustStore implementation: |
| 32 void IsTrustedCertificate( |
| 33 scoped_refptr<ParsedCertificate> cert, |
| 34 const TrustCallback& callback, |
| 35 bool* out_trusted, |
| 36 std::unique_ptr<TrustStore::Request>* out_req) const override; |
| 37 |
| 38 // CertIssuerSource implementation: |
| 39 void SyncGetIssuersOf(const ParsedCertificate* cert, |
| 40 ParsedCertificateList* issuers) override; |
| 41 void AsyncGetIssuersOf( |
| 42 scoped_refptr<ParsedCertificate> cert, |
| 43 const IssuerCallback& callback, |
| 44 std::unique_ptr<CertIssuerSource::Request>* out_req) override; |
| 45 |
| 46 private: |
| 47 std::vector<TrustStore*> stores_; |
| 48 |
| 49 CertIssuerSourceCollection cert_sources_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(TrustStoreCollection); |
| 52 }; |
| 53 |
| 54 } // namespace net |
| 55 |
| 56 #endif // NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ |
OLD | NEW |