OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_BASE_CERT_TEST_UTIL_H_ | 5 #ifndef NET_BASE_CERT_TEST_UTIL_H_ |
6 #define NET_BASE_CERT_TEST_UTIL_H_ | 6 #define NET_BASE_CERT_TEST_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include <string> |
| 10 |
| 11 #include "base/ref_counted.h" |
10 | 12 |
11 class FilePath; | 13 class FilePath; |
12 | 14 |
13 namespace net { | 15 namespace net { |
14 | 16 |
15 class X509Certificate; | 17 class X509Certificate; |
16 | 18 |
17 #if defined(USE_NSS) || defined(OS_MACOSX) || defined(USE_OPENSSL) | 19 // Returns a FilePath object representing the src/net/data/ssl/certificates |
18 // Loads and trusts a root CA certificate (stored in a file) temporarily. | 20 // directory in the source tree. |
19 // TODO(wtc): Implement this function on Windows (http://crbug.com/8470). | 21 FilePath GetTestCertsDirectory(); |
20 X509Certificate* LoadTemporaryRootCert(const FilePath& filename); | 22 |
21 #endif | 23 // Imports a certificate file in the src/net/data/ssl/certificates directory. |
| 24 // certs_dir represents the test certificates directory. cert_file is the |
| 25 // name of the certificate file. If cert_file contains multiple certificates, |
| 26 // the first certificate found will be returned. |
| 27 scoped_refptr<X509Certificate> ImportCertFromFile(const FilePath& certs_dir, |
| 28 const std::string& cert_file); |
22 | 29 |
23 } // namespace net | 30 } // namespace net |
24 | 31 |
25 #endif // NET_BASE_CERT_TEST_UTIL_H_ | 32 #endif // NET_BASE_CERT_TEST_UTIL_H_ |
OLD | NEW |