#include "net/tools/cert_verify_tool/cert_verify_tool_util.h"
#include <iostream>
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_util.h"
#include "third_party/boringssl/src/pki/pem.h"
namespace {
const char kCertificateHeader[] = …;
void ExtractCertificatesFromData(const std::string& data_string,
const base::FilePath& file_path,
std::vector<CertInput>* certs) { … }
}
bool ReadCertificatesFromFile(const base::FilePath& file_path,
std::vector<CertInput>* certs) { … }
bool ReadChainFromFile(const base::FilePath& file_path,
CertInput* target,
std::vector<CertInput>* intermediates) { … }
bool ReadFromFile(const base::FilePath& file_path, std::string* file_data) { … }
bool WriteToFile(const base::FilePath& file_path, const std::string& data) { … }
void PrintCertError(const std::string& error, const CertInput& cert) { … }
std::string FingerPrintCryptoBuffer(const CRYPTO_BUFFER* cert_handle) { … }
std::string SubjectFromX509Certificate(const net::X509Certificate* cert) { … }
std::string SubjectFromCryptoBuffer(CRYPTO_BUFFER* cert_handle) { … }