blob: 634a53a0269f2149816fc22dba73c4855c06d5c7 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "base/component_export.h"
#include "base/containers/flat_set.h"
#include "base/optional.h"
#include "base/strings/string_piece.h"
namespace device {
// This enum represents the transport protocols over which Fido WebAuthN API is
// currently supported.
// This enum is used for UMA histograms and the values should not be
// reassigned. New transports added should be reflected in the
// WebAuthenticationFidoTransport enum.
enum class FidoTransportProtocol : uint8_t {
kUsbHumanInterfaceDevice = 0,
kNearFieldCommunication = 1,
kBluetoothLowEnergy = 2,
kCloudAssistedBluetoothLowEnergy = 3,
kInternal = 4,
kMaxValue = kInternal,
// String representation of above FidoTransportProtocol enum.
extern const char kUsbHumanInterfaceDevice[];
extern const char kNearFieldCommunication[];
extern const char kBluetoothLowEnergy[];
extern const char kCloudAssistedBluetoothLowEnergy[];
extern const char kInternal[];
base::flat_set<FidoTransportProtocol> GetAllTransportProtocols();
base::Optional<FidoTransportProtocol> ConvertToFidoTransportProtocol(
base::StringPiece protocol);
std::string ToString(FidoTransportProtocol protocol);
} // namespace device