Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1373)

Unified Diff: net/cert/internal/trust_store_collection.h

Issue 2126803004: WIP: NSS trust store integration for path builder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-command-line-path-builder-add_certpathbuilder
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/internal/trust_store.cc ('k') | net/cert/internal/trust_store_collection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/trust_store_collection.h
diff --git a/net/cert/internal/trust_store_collection.h b/net/cert/internal/trust_store_collection.h
new file mode 100644
index 0000000000000000000000000000000000000000..c9b4a5075fb39fd2226e41793dddeefe72acb358
--- /dev/null
+++ b/net/cert/internal/trust_store_collection.h
@@ -0,0 +1,56 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_
+#define NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_
+
+#include <vector>
+
+#include "base/memory/ref_counted.h"
+#include "net/base/net_export.h"
+#include "net/cert/internal/cert_issuer_source_collection.h"
+#include "net/cert/internal/trust_store.h"
+
+namespace net {
+
+// Returns results from a collection of other TrustStores.
+//
+// If any of the trust stores returns a trusted value for a cert, it will be
+// passed on to the caller immediately without waiting for the other trust
+// stores in the collection to return a result.
+class NET_EXPORT TrustStoreCollection : public TrustStore {
+ public:
+ TrustStoreCollection();
+ ~TrustStoreCollection() override;
+
+ // Adds |store| to the list of TrustStores. The |store| must be valid for the
+ // lifetime of the TrustStoreCollection.
+ void AddStore(TrustStore* store);
+
+ // TrustStore implementation:
+ void IsTrustedCertificate(
+ scoped_refptr<ParsedCertificate> cert,
+ const TrustCallback& callback,
+ bool* out_trusted,
+ std::unique_ptr<TrustStore::Request>* out_req) const override;
+
+ // CertIssuerSource implementation:
+ void SyncGetIssuersOf(const ParsedCertificate* cert,
+ ParsedCertificateList* issuers) override;
+ void AsyncGetIssuersOf(
+ scoped_refptr<ParsedCertificate> cert,
+ const IssuerCallback& callback,
+ std::unique_ptr<CertIssuerSource::Request>* out_req) override;
+
+ private:
+ std::vector<TrustStore*> stores_;
+
+ CertIssuerSourceCollection cert_sources_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrustStoreCollection);
+};
+
+} // namespace net
+
+#endif // NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_
« no previous file with comments | « net/cert/internal/trust_store.cc ('k') | net/cert/internal/trust_store_collection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698