// 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_AUTHENTICATOR_GET_INFO_RESPONSE_H_ #define DEVICE_FIDO_AUTHENTICATOR_GET_INFO_RESPONSE_H_ #include #include #include #include "base/component_export.h" #include "base/containers/flat_set.h" #include "device/fido/authenticator_supported_options.h" #include "device/fido/fido_constants.h" #include "device/fido/fido_transport_protocol.h" #include "device/fido/fido_types.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace device { // Authenticator response for AuthenticatorGetInfo request that encapsulates // versions, options, AAGUID(Authenticator Attestation GUID), other // authenticator device information. // https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#authenticatorGetInfo struct COMPONENT_EXPORT(DEVICE_FIDO) AuthenticatorGetInfoResponse { public: AuthenticatorGetInfoResponse(base::flat_set versions, base::flat_set in_ctap2_version, base::span aaguid); AuthenticatorGetInfoResponse(AuthenticatorGetInfoResponse&& that); AuthenticatorGetInfoResponse& operator=(AuthenticatorGetInfoResponse&& other); AuthenticatorGetInfoResponse(const AuthenticatorGetInfoResponse&) = delete; AuthenticatorGetInfoResponse& operator=(const AuthenticatorGetInfoResponse&) = delete; ~AuthenticatorGetInfoResponse(); static std::vector EncodeToCBOR( const AuthenticatorGetInfoResponse& response); // Returns true if there is a Ctap2Version in |ctap2_versions| greater or // equal to |ctap2_version|. bool SupportsAtLeast(Ctap2Version ctap2_version) const; base::flat_set versions; base::flat_set ctap2_versions; std::array aaguid; absl::optional max_msg_size; absl::optional max_credential_count_in_list; absl::optional max_credential_id_length; absl::optional> pin_protocols; absl::optional> extensions; absl::optional> algorithms; absl::optional max_serialized_large_blob_array; absl::optional remaining_discoverable_credentials; absl::optional force_pin_change; absl::optional min_pin_length; absl::optional> transports; // max_cred_blob_length is the maximum size credBlob that the authenticator // supports per credential, or nullopt if credBlob is not supported. If // present, this value will be >= 32. absl::optional max_cred_blob_length; AuthenticatorSupportedOptions options; }; } // namespace device #endif // DEVICE_FIDO_AUTHENTICATOR_GET_INFO_RESPONSE_H_