| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TOOLS_CERT_VERIFY_TOOL_CERT_VERIFY_TOOL_UTIL_H_ | 5 #ifndef NET_TOOLS_CERT_VERIFY_TOOL_CERT_VERIFY_TOOL_UTIL_H_ |
| 6 #define NET_TOOLS_CERT_VERIFY_TOOL_CERT_VERIFY_TOOL_UTIL_H_ | 6 #define NET_TOOLS_CERT_VERIFY_TOOL_CERT_VERIFY_TOOL_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 std::string source_details; | 26 std::string source_details; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // Parses |file_path| as a single DER cert or a PEM certificate list. | 29 // Parses |file_path| as a single DER cert or a PEM certificate list. |
| 30 bool ReadCertificatesFromFile(const base::FilePath& file_path, | 30 bool ReadCertificatesFromFile(const base::FilePath& file_path, |
| 31 std::vector<CertInput>* certs); | 31 std::vector<CertInput>* certs); |
| 32 | 32 |
| 33 // Parses |file_path| as a DER cert or PEM chain. If more than one cert is | 33 // Parses |file_path| as a DER cert or PEM chain. If more than one cert is |
| 34 // present, the first will be used as the target certificate and the rest will | 34 // present, the first will be used as the target certificate and the rest will |
| 35 // be used as intermediates. | 35 // be used as intermediates. |
| 36 void ReadChainFromFile(const base::FilePath& file_path, | 36 bool ReadChainFromFile(const base::FilePath& file_path, |
| 37 CertInput* target, | 37 CertInput* target, |
| 38 std::vector<CertInput>* intermediates); | 38 std::vector<CertInput>* intermediates); |
| 39 | 39 |
| 40 // Writes a file and prints an error message if it failed. | 40 // Writes a file and prints an error message if it failed. |
| 41 bool WriteToFile(const base::FilePath& file_path, const std::string& data); | 41 bool WriteToFile(const base::FilePath& file_path, const std::string& data); |
| 42 | 42 |
| 43 // Prints an error about the input |cert|. This will include the file the cert | 43 // Prints an error about the input |cert|. This will include the file the cert |
| 44 // was read from, as well as which block in the file if it was a PEM file. | 44 // was read from, as well as which block in the file if it was a PEM file. |
| 45 void PrintCertError(const std::string& error, const CertInput& cert); | 45 void PrintCertError(const std::string& error, const CertInput& cert); |
| 46 | 46 |
| 47 #endif // NET_TOOLS_CERT_VERIFY_TOOL_CERT_VERIFY_TOOL_UTIL_H_ | 47 #endif // NET_TOOLS_CERT_VERIFY_TOOL_CERT_VERIFY_TOOL_UTIL_H_ |
| OLD | NEW |