chromium/content/public/browser/digital_credentials_cross_device.h

// 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.

#ifndef CONTENT_PUBLIC_BROWSER_DIGITAL_CREDENTIALS_CROSS_DEVICE_H_
#define CONTENT_PUBLIC_BROWSER_DIGITAL_CREDENTIALS_CROSS_DEVICE_H_

#include <vector>

#include "base/types/expected.h"
#include "base/types/strong_alias.h"
#include "base/values.h"
#include "content/common/content_export.h"
#include "device/fido/cable/v2_constants.h"
#include "device/fido/network_context_factory.h"
#include "url/origin.h"

namespace content::digital_credentials::cross_device {

// SystemErrors result from issues with the local computer that prevent a
// transaction from completing.
enum class SystemError {};

// ProtocolErrors result from issues communicating with a remote device where
// the remote device is at fault.
enum class ProtocolError {};

// RemoteErrors are reported by the remote device. These values are taken from
// the CTAP 2.2 spec.
enum class RemoteError {};

enum class SystemEvent {};

Error;

// Events either come from the underlying hybrid connection, or are
// SystemEvents.
Event;

// A Response is the response to a cross-device request. At this level of
// abstraction it's an opaque `base::Value` taken from the JSON reply.
Response;

// A Transaction performs a cross-device digital identity transaction by
// listening for mobile devices that have scanned a QR code and thus are
// broadcasting a BLE message. An encrypted tunnel is set up between this device
// and the mobile device and the digital identity is exchanged.
class CONTENT_EXPORT Transaction {};

}  // namespace content::digital_credentials::cross_device

#endif  // CONTENT_PUBLIC_BROWSER_DIGITAL_CREDENTIALS_CROSS_DEVICE_H_