#include "remoting/base/certificate_helpers.h"
#include <string>
#include "base/logging.h"
#include "build/build_config.h"
#include "crypto/crypto_buildflags.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/client_cert_store.h"
#if BUILDFLAG(USE_NSS_CERTS)
#include "net/ssl/client_cert_store_nss.h"
#elif BUILDFLAG(IS_WIN)
#include "net/ssl/client_cert_store_win.h"
#elif BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_IOS)
#include "net/ssl/client_cert_store_mac.h"
#endif
namespace remoting {
namespace {
constexpr char kCertIssuerWildCard[] = …;
bool WorseThan(const std::string& issuer,
const base::Time& now,
const net::X509Certificate& c1,
const net::X509Certificate& c2) { … }
#if BUILDFLAG(IS_WIN)
crypto::ScopedHCERTSTORE OpenLocalMachineCertStore() {
return crypto::ScopedHCERTSTORE(::CertOpenStore(
CERT_STORE_PROV_SYSTEM, 0, NULL,
CERT_SYSTEM_STORE_LOCAL_MACHINE | CERT_STORE_READONLY_FLAG, L"MY"));
}
#endif
}
std::string GetPreferredIssuerFieldValue(const net::X509Certificate& cert) { … }
bool IsCertificateValid(const std::string& issuer,
const base::Time& now,
const net::X509Certificate& cert) { … }
std::unique_ptr<net::ClientCertIdentity> GetBestMatchFromCertificateList(
const std::string& issuer,
const base::Time& now,
net::ClientCertIdentityList& client_certs) { … }
std::unique_ptr<net::ClientCertStore> CreateClientCertStoreInstance() { … }
}