#include "net/tools/transport_security_state_generator/input_file_parsers.h"
#include <set>
#include <sstream>
#include <string_view>
#include <vector>
#include "base/containers/contains.h"
#include "base/containers/fixed_flat_set.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "base/values.h"
#include "net/tools/transport_security_state_generator/cert_util.h"
#include "net/tools/transport_security_state_generator/pinset.h"
#include "net/tools/transport_security_state_generator/pinsets.h"
#include "net/tools/transport_security_state_generator/spki_hash.h"
#include "third_party/boringssl/src/include/openssl/x509v3.h"
namespace net::transport_security_state {
namespace {
bool IsImportantWordInCertificateName(std::string_view name) { … }
std::string FilterName(std::string_view name) { … }
bool MatchCertificateName(std::string_view name, std::string_view pin_name) { … }
bool IsValidName(std::string_view candidate) { … }
static const char kStartOfCert[] = …;
static const char kStartOfPublicKey[] = …;
static const char kEndOfCert[] = …;
static const char kEndOfPublicKey[] = …;
static const char kStartOfSHA256[] = …;
enum class CertificateParserState { … };
static constexpr char kNameJSONKey[] = …;
static constexpr char kIncludeSubdomainsJSONKey[] = …;
static constexpr char kModeJSONKey[] = …;
static constexpr char kPinsJSONKey[] = …;
static constexpr char kTimestampName[] = …;
static constexpr char kPolicyJSONKey[] = …;
}
bool ParseCertificatesFile(std::string_view certs_input,
Pinsets* pinsets,
base::Time* timestamp) { … }
bool ParseJSON(std::string_view hsts_json,
std::string_view pins_json,
TransportSecurityStateEntries* entries,
Pinsets* pinsets) { … }
}