#ifndef DEVICE_FIDO_AUTHENTICATOR_GET_ASSERTION_RESPONSE_H_
#define DEVICE_FIDO_AUTHENTICATOR_GET_ASSERTION_RESPONSE_H_
#include <stdint.h>
#include <array>
#include <optional>
#include <vector>
#include "base/component_export.h"
#include "device/fido/authenticator_data.h"
#include "device/fido/fido_constants.h"
#include "device/fido/fido_transport_protocol.h"
#include "device/fido/large_blob.h"
#include "device/fido/public_key_credential_descriptor.h"
#include "device/fido/public_key_credential_user_entity.h"
#if BUILDFLAG(ARKWEB_FIDO)
#include "device/fido/authenticator_credential_response_extra_common.h"
#endif
namespace device {
class COMPONENT_EXPORT(DEVICE_FIDO) AuthenticatorGetAssertionResponse {
public:
AuthenticatorGetAssertionResponse(const AuthenticatorGetAssertionResponse&) =
delete;
AuthenticatorGetAssertionResponse& operator=(
const AuthenticatorGetAssertionResponse&) = delete;
static std::optional<AuthenticatorGetAssertionResponse>
CreateFromU2fSignResponse(
base::span<const uint8_t, kRpIdHashLength> relying_party_id_hash,
base::span<const uint8_t> u2f_data,
base::span<const uint8_t> key_handle,
std::optional<FidoTransportProtocol> transport_used);
AuthenticatorGetAssertionResponse(
AuthenticatorData authenticator_data,
std::vector<uint8_t> signature,
std::optional<FidoTransportProtocol> transport_used);
AuthenticatorGetAssertionResponse(AuthenticatorGetAssertionResponse&& that);
AuthenticatorGetAssertionResponse& operator=(
AuthenticatorGetAssertionResponse&& other);
~AuthenticatorGetAssertionResponse();
AuthenticatorData authenticator_data;
std::optional<PublicKeyCredentialDescriptor> credential;
std::vector<uint8_t> signature;
std::optional<PublicKeyCredentialUserEntity> user_entity;
std::optional<uint8_t> num_credentials;
std::optional<std::vector<uint8_t>> hmac_secret;
bool hmac_secret_not_evaluated = false;
std::optional<std::array<uint8_t, kLargeBlobKeyLength>> large_blob_key;
bool user_selected = false;
std::optional<std::vector<uint8_t>> large_blob;
bool large_blob_written = false;
std::optional<std::vector<uint8_t>> updated_encrypted_passkey;
std::optional<LargeBlob> large_blob_extension;
std::optional<FidoTransportProtocol> transport_used;
#if BUILDFLAG(ARKWEB_FIDO)
std::optional<AuthenticatorGetAssertionResponseExtra> response_extra;
#endif
};
}
#endif