chromium/components/media_router/common/providers/cast/certificate/cast_trust_store.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/media_router/common/providers/cast/certificate/cast_trust_store.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>
#include <utility>

#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/synchronization/lock.h"
#include "base/task/thread_pool.h"
#include "components/media_router/common/providers/cast/certificate/cast_cert_reader.h"
#include "components/media_router/common/providers/cast/certificate/switches.h"
#include "net/cert/x509_util.h"
#include "third_party/boringssl/src/pki/common_cert_errors.h"
#include "third_party/boringssl/src/pki/parse_certificate.h"
#include "third_party/boringssl/src/pki/parsed_certificate.h"
#include "third_party/boringssl/src/pki/trust_store_in_memory.h"

namespace cast_certificate {
namespace {
// Returns a DER-encoded certificate from static storage.
template <size_t N>
std::shared_ptr<const bssl::ParsedCertificate>
ParseCertificateFromStaticStorage(const uint8_t (&data)[N]) {}

// Returns the cast developer certificate path command line switch if it is
// set. Otherwise, returns an empty file path.
base::FilePath GetDeveloperCertificatePathFromCommandLine() {}
}  // namespace

void CastTrustStore::AccessInstance(CastTrustStore::AccessCallback callback) {}

CastTrustStore* CastTrustStore::GetInstance(bool may_block) {}

CastTrustStore::CastTrustStore(bool may_block) {}

void CastTrustStore::AddDefaultCertificates(bool may_block) {}

// -------------------------------------------------------------------------
// Cast trust anchors.
// -------------------------------------------------------------------------

// There are two trusted roots for Cast certificate chains:
//
//   (1) CN=Cast Root CA    (kCastRootCaDer)
//   (2) CN=Eureka Root CA  (kEurekaRootCaDer)
//
// These constants are defined by the files included next:

#include "components/media_router/common/providers/cast/certificate/cast_root_ca_cert_der-inc.h"
#include "components/media_router/common/providers/cast/certificate/eureka_root_ca_der-inc.h"

void CastTrustStore::AddBuiltInCertificates() {}

void CastTrustStore::NonBlockingAddCertificateFromPath(
    base::FilePath cert_path) {}

void CastTrustStore::AddCertificateFromPath(base::FilePath cert_path) {}

void CastTrustStore::ClearCertificatesForTesting() {}

void CastTrustStore::AddAnchor(
    std::shared_ptr<const bssl::ParsedCertificate> cert) {}

}  // namespace cast_certificate