#include "components/policy/test_support/policy_storage.h"
#include "base/numerics/byte_conversions.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "crypto/sha2.h"
namespace policy {
namespace {
const char kPolicyKeySeparator[] = …;
std::string GetPolicyKey(const std::string& policy_type,
const std::string& entity_id) { … }
}
PolicyStorage::PolicyStorage()
: … { … }
PolicyStorage::PolicyStorage(PolicyStorage&& policy_storage) = default;
PolicyStorage& PolicyStorage::operator=(PolicyStorage&& policy_storage) =
default;
PolicyStorage::~PolicyStorage() = default;
std::string PolicyStorage::GetPolicyPayload(
const std::string& policy_type,
const std::string& entity_id) const { … }
std::vector<std::string> PolicyStorage::GetEntityIdsForType(
const std::string& policy_type) { … }
void PolicyStorage::SetPolicyPayload(const std::string& policy_type,
const std::string& policy_payload) { … }
void PolicyStorage::SetPolicyPayload(const std::string& policy_type,
const std::string& entity_id,
const std::string& policy_payload) { … }
std::string PolicyStorage::GetExternalPolicyPayload(
const std::string& policy_type,
const std::string& entity_id) { … }
void PolicyStorage::SetExternalPolicyPayload(
const std::string& policy_type,
const std::string& entity_id,
const std::string& policy_payload) { … }
void PolicyStorage::SetPsmEntry(const std::string& brand_serial_id,
const PolicyStorage::PsmEntry& psm_entry) { … }
const PolicyStorage::PsmEntry* PolicyStorage::GetPsmEntry(
const std::string& brand_serial_id) const { … }
void PolicyStorage::SetInitialEnrollmentState(
const std::string& brand_serial_id,
const PolicyStorage::InitialEnrollmentState& initial_enrollment_state) { … }
const PolicyStorage::InitialEnrollmentState*
PolicyStorage::GetInitialEnrollmentState(
const std::string& brand_serial_id) const { … }
std::vector<std::string> PolicyStorage::GetMatchingSerialHashes(
uint64_t modulus,
uint64_t remainder) const { … }
}