#include "components/reporting/encryption/encryption_module.h"
#include <string>
#include <string_view>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "base/types/expected.h"
#include "components/reporting/encryption/encryption_module_interface.h"
#include "components/reporting/proto/synced/record.pb.h"
#include "components/reporting/util/status.h"
#include "components/reporting/util/statusor.h"
namespace reporting {
namespace {
void AddToRecord(std::string_view record,
Encryptor::Handle* handle,
base::OnceCallback<void(StatusOr<EncryptedRecord>)> cb) { … }
}
EncryptionModule::EncryptionModule(base::TimeDelta renew_encryption_key_period)
: … { … }
EncryptionModule::~EncryptionModule() = default;
void EncryptionModule::EncryptRecordImpl(
std::string_view record,
base::OnceCallback<void(StatusOr<EncryptedRecord>)> cb) const { … }
void EncryptionModule::UpdateAsymmetricKeyImpl(
std::string_view new_public_key,
PublicKeyId new_public_key_id,
base::OnceCallback<void(Status)> response_cb) { … }
scoped_refptr<EncryptionModuleInterface> EncryptionModule::Create(
base::TimeDelta renew_encryption_key_period) { … }
}