forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfido_transport_protocol.h
45 lines (36 loc) · 1.49 KB
/
fido_transport_protocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// 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.
#ifndef DEVICE_FIDO_FIDO_TRANSPORT_PROTOCOL_H_
#define DEVICE_FIDO_FIDO_TRANSPORT_PROTOCOL_H_
#include "base/component_export.h"
#include "base/strings/string_piece.h"
#include "third_party/abseil-cpp/absl/types/optional.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,
kAndroidAccessory = 5,
kMaxValue = kAndroidAccessory,
};
// 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[];
COMPONENT_EXPORT(DEVICE_FIDO)
absl::optional<FidoTransportProtocol> ConvertToFidoTransportProtocol(
base::StringPiece protocol);
COMPONENT_EXPORT(DEVICE_FIDO)
base::StringPiece ToString(FidoTransportProtocol protocol);
} // namespace device
#endif // DEVICE_FIDO_FIDO_TRANSPORT_PROTOCOL_H_