#include "net/tools/transport_security_state_generator/cert_util.h"
#include <string>
#include <string_view>
#include "base/base64.h"
#include "base/files/file_util.h"
#include "base/numerics/clamped_math.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/tools/transport_security_state_generator/spki_hash.h"
#include "third_party/boringssl/src/include/openssl/crypto.h"
SPKIHash;
namespace {
static const char kPEMBeginBlock[] = …;
static const char kPEMEndBlock[] = …;
bool ParsePEM(std::string_view pem_input,
std::string_view expected_block_type,
std::string* der_output) { … }
bool ExtractFieldFromX509Name(X509_NAME* name, int nid, std::string* field) { … }
}
bssl::UniquePtr<X509> GetX509CertificateFromPEM(std::string_view pem_data) { … }
bool ExtractSubjectNameFromCertificate(X509* certificate, std::string* name) { … }
bool CalculateSPKIHashFromCertificate(X509* certificate, SPKIHash* out_hash) { … }
bool CalculateSPKIHashFromKey(std::string_view pem_key, SPKIHash* out_hash) { … }