//-----------------------------------------------------------------------
//
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
//
//-----------------------------------------------------------------------
namespace AliasClientDb;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using AliasClientDb.Abstracts;
///
/// The Passkey class that stores WebAuthn/FIDO2 passkey information.
///
public class Passkey : SyncableEntity
{
///
/// Gets or sets the ID.
///
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
///
/// Gets or sets the item version for payload schema.
///
[Required]
public int ItemVersion { get; set; }
///
/// Gets or sets the relying party identifier.
///
[Required]
[MaxLength(255)]
public string RpId { get; set; } = string.Empty;
///
/// Gets or sets the credential ID.
///
[Required]
public byte[] CredentialId { get; set; } = Array.Empty();
///
/// Gets or sets the signature counter.
///
[Required]
public int SignCount { get; set; }
///
/// Gets or sets a value indicating whether the passkey is backup eligible.
///
[Required]
public bool IsBackupEligible { get; set; }
///
/// Gets or sets a value indicating whether the passkey is in backup state.
///
[Required]
public bool IsBackupState { get; set; }
///
/// Gets or sets the display name for the passkey.
///
[MaxLength(255)]
public string DisplayName { get; set; } = string.Empty;
///
/// Gets or sets the additional data as JSON blob.
///
public byte[]? AdditionalData { get; set; }
}