#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/network/key_upload_request.h"
#include "base/check.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/signing_key_pair.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "crypto/unexportable_key.h"
BPKUR;
namespace enterprise_connectors {
namespace {
constexpr int kMaxDMTokenLength = …;
BPKUR::KeyType AlgorithmToType(
crypto::SignatureVerifier::SignatureAlgorithm algorithm) { … }
bool AreParametersValid(const GURL& dm_server_url,
const std::string& dm_token,
const SigningKeyPair& key_pair) { … }
}
KeyUploadRequest::KeyUploadRequest(const GURL& dm_server_url,
const std::string& dm_token,
const std::string& request_body)
: … { … }
std::optional<const enterprise_management::DeviceManagementRequest>
KeyUploadRequest::BuildUploadPublicKeyRequest(
const SigningKeyPair& new_key_pair,
const SigningKeyPair* old_key_pair,
std::optional<std::string> nonce) { … }
std::optional<const KeyUploadRequest> KeyUploadRequest::Create(
const GURL& dm_server_url,
const std::string& dm_token,
const SigningKeyPair& key_pair) { … }
std::optional<const KeyUploadRequest> KeyUploadRequest::Create(
const GURL& dm_server_url,
const std::string& dm_token,
const SigningKeyPair& new_key_pair,
const SigningKeyPair& old_key_pair,
const std::string& nonce) { … }
}