#ifndef NET_TEST_CERT_TEST_UTIL_H_
#define NET_TEST_CERT_TEST_UTIL_H_
#include <string>
#include <string_view>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "crypto/crypto_buildflags.h"
#include "net/base/hash_value.h"
#include "net/cert/x509_certificate.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(USE_NSS_CERTS)
#include "net/cert/scoped_nss_types.h"
PK11SlotInfo;
#include "net/cert/scoped_nss_types.h"
#endif
namespace base {
class FilePath;
}
namespace net {
class EVRootCAMetadata;
#if BUILDFLAG(USE_NSS_CERTS)
bool ImportSensitiveKeyFromFile(const base::FilePath& dir,
std::string_view key_filename,
PK11SlotInfo* slot);
bool ImportClientCertToSlot(CERTCertificate* cert, PK11SlotInfo* slot);
ScopedCERTCertificate ImportClientCertToSlot(
const scoped_refptr<X509Certificate>& cert,
PK11SlotInfo* slot);
scoped_refptr<X509Certificate> ImportClientCertAndKeyFromFile(
const base::FilePath& dir,
std::string_view cert_filename,
std::string_view key_filename,
PK11SlotInfo* slot,
ScopedCERTCertificate* nss_cert);
scoped_refptr<X509Certificate> ImportClientCertAndKeyFromFile(
const base::FilePath& dir,
std::string_view cert_filename,
std::string_view key_filename,
PK11SlotInfo* slot);
ScopedCERTCertificate ImportCERTCertificateFromFile(
const base::FilePath& certs_dir,
std::string_view cert_file);
ScopedCERTCertificateList CreateCERTCertificateListFromFile(
const base::FilePath& certs_dir,
std::string_view cert_file,
int format);
ScopedCERTCertificate GetAnNssBuiltinSslTrustedRoot();
#endif
CertificateList CreateCertificateListFromFile(const base::FilePath& certs_dir,
std::string_view cert_file,
int format);
::testing::AssertionResult LoadCertificateFiles(
const std::vector<std::string>& cert_filenames,
CertificateList* certs);
scoped_refptr<X509Certificate> CreateCertificateChainFromFile(
const base::FilePath& certs_dir,
std::string_view cert_file,
int format);
scoped_refptr<X509Certificate> ImportCertFromFile(
const base::FilePath& cert_path);
scoped_refptr<X509Certificate> ImportCertFromFile(
const base::FilePath& certs_dir,
std::string_view cert_file);
class ScopedTestEVPolicy { … };
}
#endif