1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef NET_BASE_CERT_TEST_UTIL_H_ 6 #define NET_BASE_CERT_TEST_UTIL_H_ 7 #pragma once 8 9 #include <string> 10 11 #include "base/memory/ref_counted.h" 12 13 class FilePath; 14 15 namespace net { 16 17 class X509Certificate; 18 19 // Returns a FilePath object representing the src/net/data/ssl/certificates 20 // directory in the source tree. 21 FilePath GetTestCertsDirectory(); 22 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); 29 30 } // namespace net 31 32 #endif // NET_BASE_CERT_TEST_UTIL_H_ 33