#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/test/cert_test_util.h"
#include <certdb.h>
#include <pk11pub.h>
#include <secmod.h>
#include <secmodt.h>
#include <string.h>
#include <memory>
#include <string_view>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "crypto/nss_key_util.h"
#include "crypto/nss_util_internal.h"
#include "crypto/scoped_nss_types.h"
#include "net/cert/cert_type.h"
#include "net/cert/x509_util_nss.h"
namespace net {
namespace {
bool IsKnownRoot(CERTCertificate* root) { … }
bool IsNssBuiltInRootSlot(PK11SlotInfo* slot) { … }
crypto::ScopedPK11Slot GetNssBuiltInRootCertsSlot() { … }
}
bool ImportSensitiveKeyFromFile(const base::FilePath& dir,
std::string_view key_filename,
PK11SlotInfo* slot) { … }
bool ImportClientCertToSlot(CERTCertificate* nss_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() { … }
}