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..fa4b09d9ca0206ab460abe3121314604c9737763 100644 |
--- a/net/test/cert_test_util.cc |
+++ b/net/test/cert_test_util.cc |
@@ -26,6 +26,25 @@ CertificateList CreateCertificateListFromFile( |
format); |
} |
+scoped_refptr<X509Certificate> CreateCertificateChainFromFile( |
+ const base::FilePath& certs_dir, |
+ const std::string& cert_file, |
+ int format) { |
+ CertificateList certs = CreateCertificateListFromFile( |
wtc
2013/11/21 02:05:02
This is an inefficient way to implement this funct
Eran M. (Google)
2013/11/21 20:06:02
Ack - it is indeed only for testing.
|
+ 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; |
+} |
+ |
+ |
wtc
2013/11/21 02:05:02
Nit: delete one blank line.
Eran M. (Google)
2013/11/21 20:06:02
Done.
|
scoped_refptr<X509Certificate> ImportCertFromFile( |
const base::FilePath& certs_dir, |
const std::string& cert_file) { |