namespace Bit.Core.Utilities.Fido2
{
#nullable enable
///
/// Parameters for asserting a credential.
///
/// This class is an extended version of the WebAuthn struct:
/// https://www.w3.org/TR/webauthn-2/#dictdef-publickeycredentialrequestoptions
///
public class Fido2ClientAssertCredentialParams
{
///
/// A value which is true if and only if the caller’s environment settings object is same-origin with its ancestors.
/// It is false if caller is cross-origin.
///
public bool SameOriginWithAncestors { get; set; }
///
/// The challenge that the selected authenticator signs, along with other data, when producing an authentication
/// assertion.
///
public required byte[] Challenge { get; set; }
///
/// The relying party identifier claimed by the caller. If omitted, its value will be the CredentialsContainer
/// object's relevant settings object's origin's effective domain.
///
public string RpId { get; set; }
///
/// The Relying Party's origin (e.g., "https://example.com").
///
public string Origin { get; set; }
///
/// A list of PublicKeyCredentialDescriptor objects representing public key credentials acceptable to the caller,
/// in descending order of the caller’s preference (the first item in the list is the most preferred credential,
/// and so on down the list).
///
public PublicKeyCredentialDescriptor[] AllowCredentials { get; set; } = [];
///
/// The Relying Party's requirements regarding user verification for the get() operation.
///
public string UserVerification { get; set; } = "preferred";
///
/// This time, in milliseconds, that the caller is willing to wait for the call to complete.
/// This is treated as a hint, and MAY be overridden by the client.
///
///
/// This is not currently supported.
///
public int? Timeout { get; set; }
}
}