1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef DEVICE_FIDO_FIDO_TYPES_H_
6 #define DEVICE_FIDO_FIDO_TYPES_H_
7 
8 // The definitions below are for mojo-mappable types that need to be
9 // transferred from Blink. Types that have mojo equivalents are better placed
10 // in fido_constants.h.
11 
12 namespace device {
13 
14 enum class ProtocolVersion {
15   kCtap2,
16   kU2f,
17   kUnknown,
18 };
19 
20 enum class CredentialType { kPublicKey };
21 
22 // Authenticator attachment constraint passed on from the relying party as a
23 // parameter for AuthenticatorSelectionCriteria. |kAny| is equivalent to the
24 // (optional) attachment field not being present.
25 // https://w3c.github.io/webauthn/#attachment
26 enum class AuthenticatorAttachment {
27   kAny,
28   kPlatform,
29   kCrossPlatform,
30 };
31 
32 // User verification constraint passed on from the relying party as a parameter
33 // for AuthenticatorSelectionCriteria and for CtapGetAssertion request.
34 // https://w3c.github.io/webauthn/#enumdef-userverificationrequirement
35 enum class UserVerificationRequirement {
36   kRequired,
37   kPreferred,
38   kDiscouraged,
39 };
40 
41 // https://w3c.github.io/webauthn/#attestation-convey
42 enum class AttestationConveyancePreference : uint8_t {
43   kNone,
44   kIndirect,
45   kDirect,
46   // Non-standard value for individual attestation that we hope to end up in
47   // the standard eventually.
48   kEnterprise,
49 };
50 
51 }  // namespace device
52 
53 #endif  // DEVICE_FIDO_FIDO_TYPES_H_
54