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

Unified Diff: net/cert/internal/trust_store_nss.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_collection_unittest.cc ('k') | net/cert/internal/trust_store_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/trust_store_nss.h
diff --git a/net/cert/internal/trust_store_nss.h b/net/cert/internal/trust_store_nss.h
new file mode 100644
index 0000000000000000000000000000000000000000..55d6c309eb6f46d72e1a82eade1b97e42aa54e6d
--- /dev/null
+++ b/net/cert/internal/trust_store_nss.h
@@ -0,0 +1,51 @@
+// 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_NSS_H_
+#define NET_CERT_INTERNAL_TRUST_STORE_NSS_H_
+
+#include "base/memory/ref_counted.h"
+#include "net/base/net_export.h"
+#include "net/cert/internal/cert_issuer_source.h"
+#include "net/cert/internal/trust_store.h"
+
+namespace base {
+class TaskRunner;
+}
+
+namespace net {
+
+// TrustStoreNSS is an implementation of TrustStore and CertIssuerSource which
+// provides uses NSS to do trust checks and to provide certificates (both
+// intermediates and roots) from the NSS DB for path building.
+class NET_EXPORT TrustStoreNSS : public TrustStore {
+ public:
+ // Creates a TrustStoreNSS. All NSS calls will be done on |nss_task_runner|.
+ explicit TrustStoreNSS(scoped_refptr<base::TaskRunner> nss_task_runner);
+ ~TrustStoreNSS() override;
+
+ // 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:
+ scoped_refptr<base::TaskRunner> nss_task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrustStoreNSS);
+};
+
+} // namespace net
+
+#endif // NET_CERT_INTERNAL_TRUST_STORE_NSS_H_
« no previous file with comments | « net/cert/internal/trust_store_collection_unittest.cc ('k') | net/cert/internal/trust_store_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698