chromium/components/component_updater/installer_policies/trust_token_key_commitments_component_installer_policy.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/component_updater/installer_policies/trust_token_key_commitments_component_installer_policy.h"

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "base/version.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/component_updater/component_updater_switches.h"

ComponentUpdateService;

namespace {

// The SHA256 of the SubjectPublicKeyInfo used to sign the extension.
// The extension id is: kiabhabjdbkjdpjbpigfodbdjmbglcoo
const uint8_t kTrustTokenKeyCommitmentsPublicKeySHA256[32] =;

const char kTrustTokenKeyCommitmentsManifestName[] =;

// Attempts to load key commitments as raw JSON from their storage file,
// returning the loaded commitments on success and nullopt on failure.
std::optional<std::string> LoadKeyCommitmentsFromDisk(
    const base::FilePath& path) {}

}  // namespace

namespace component_updater {

TrustTokenKeyCommitmentsComponentInstallerPolicy::
    TrustTokenKeyCommitmentsComponentInstallerPolicy(
        base::RepeatingCallback<void(const std::string&)> on_commitments_ready)
    :{}

TrustTokenKeyCommitmentsComponentInstallerPolicy::
    ~TrustTokenKeyCommitmentsComponentInstallerPolicy() = default;

bool TrustTokenKeyCommitmentsComponentInstallerPolicy::
    SupportsGroupPolicyEnabledComponentUpdates() const {}

bool TrustTokenKeyCommitmentsComponentInstallerPolicy::
    RequiresNetworkEncryption() const {}

update_client::CrxInstaller::Result
TrustTokenKeyCommitmentsComponentInstallerPolicy::OnCustomInstall(
    const base::Value::Dict& manifest,
    const base::FilePath& install_dir) {}

void TrustTokenKeyCommitmentsComponentInstallerPolicy::OnCustomUninstall() {}

base::FilePath
TrustTokenKeyCommitmentsComponentInstallerPolicy::GetInstalledPath(
    const base::FilePath& base) {}

void TrustTokenKeyCommitmentsComponentInstallerPolicy::ComponentReady(
    const base::Version& version,
    const base::FilePath& install_dir,
    base::Value::Dict manifest) {}

// Called during startup and installation before ComponentReady().
bool TrustTokenKeyCommitmentsComponentInstallerPolicy::VerifyInstallation(
    const base::Value::Dict& manifest,
    const base::FilePath& install_dir) const {}

base::FilePath
TrustTokenKeyCommitmentsComponentInstallerPolicy::GetRelativeInstallDir()
    const {}

void TrustTokenKeyCommitmentsComponentInstallerPolicy::GetHash(
    std::vector<uint8_t>* hash) const {}

std::string TrustTokenKeyCommitmentsComponentInstallerPolicy::GetName() const {}

update_client::InstallerAttributes
TrustTokenKeyCommitmentsComponentInstallerPolicy::GetInstallerAttributes()
    const {}

// static
void TrustTokenKeyCommitmentsComponentInstallerPolicy::GetPublicKeyHash(
    std::vector<uint8_t>* hash) {}

// static
void TrustTokenKeyCommitmentsComponentInstallerPolicy::
    LoadTrustTokensFromString(
        base::OnceCallback<std::optional<std::string>()> load_keys_from_disk,
        base::OnceCallback<void(const std::string&)> on_commitments_ready) {}

}  // namespace component_updater