authenticator_selection_criteria.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2018 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. #ifndef DEVICE_FIDO_AUTHENTICATOR_SELECTION_CRITERIA_H_
  5. #define DEVICE_FIDO_AUTHENTICATOR_SELECTION_CRITERIA_H_
  6. #include "base/component_export.h"
  7. #include "device/fido/fido_constants.h"
  8. #include "device/fido/fido_types.h"
  9. namespace device {
  10. // Represents authenticator properties the relying party can specify to restrict
  11. // the type of authenticator used in creating credentials.
  12. //
  13. // https://w3c.github.io/webauthn/#authenticatorSelection
  14. class COMPONENT_EXPORT(DEVICE_FIDO) AuthenticatorSelectionCriteria {
  15. public:
  16. AuthenticatorSelectionCriteria();
  17. AuthenticatorSelectionCriteria(
  18. AuthenticatorAttachment authenticator_attachment,
  19. ResidentKeyRequirement resident_key,
  20. UserVerificationRequirement user_verification_requirement);
  21. AuthenticatorSelectionCriteria(const AuthenticatorSelectionCriteria& other);
  22. AuthenticatorSelectionCriteria(AuthenticatorSelectionCriteria&& other);
  23. AuthenticatorSelectionCriteria& operator=(
  24. const AuthenticatorSelectionCriteria& other);
  25. AuthenticatorSelectionCriteria& operator=(
  26. AuthenticatorSelectionCriteria&& other);
  27. bool operator==(const AuthenticatorSelectionCriteria& other) const;
  28. ~AuthenticatorSelectionCriteria();
  29. AuthenticatorAttachment authenticator_attachment =
  30. AuthenticatorAttachment::kAny;
  31. ResidentKeyRequirement resident_key = ResidentKeyRequirement::kDiscouraged;
  32. UserVerificationRequirement user_verification_requirement =
  33. UserVerificationRequirement::kPreferred;
  34. };
  35. } // namespace device
  36. #endif // DEVICE_FIDO_AUTHENTICATOR_SELECTION_CRITERIA_H_