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

Unified Diff: net/test/cert_test_util.cc

Issue 67513008: Certificate Transparency: Add the high-level interface for verifying SCTs over multiple logs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merging with master Created 7 years, 1 month 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
« net/cert/multi_log_ct_verifier.cc ('K') | « net/test/cert_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/cert_test_util.cc
diff --git a/net/test/cert_test_util.cc b/net/test/cert_test_util.cc
index 5ec07749d508f5758cce834cbf4fd6d0679550c5..3ccfa65a5adfa9bf7fee5f75641184c529f8edc7 100644
--- a/net/test/cert_test_util.cc
+++ b/net/test/cert_test_util.cc
@@ -26,6 +26,24 @@ CertificateList CreateCertificateListFromFile(
format);
}
+scoped_refptr<X509Certificate> CreateCertificateChainFromFile(
+ const base::FilePath& certs_dir,
+ const std::string& cert_file,
+ int format) {
+ CertificateList certs = CreateCertificateListFromFile(
+ certs_dir, cert_file, format);
+ if (certs.empty())
+ return NULL;
+
+ X509Certificate::OSCertHandles intermediates;
+ for (size_t i = 1; i < certs.size(); ++i)
+ intermediates.push_back(certs[i]->os_cert_handle());
+
+ scoped_refptr<X509Certificate> result(X509Certificate::CreateFromHandle(
+ certs[0]->os_cert_handle(), intermediates));
+ return result;
+}
+
scoped_refptr<X509Certificate> ImportCertFromFile(
const base::FilePath& certs_dir,
const std::string& cert_file) {
« net/cert/multi_log_ct_verifier.cc ('K') | « net/test/cert_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698