21 lines
920 B
C#
21 lines
920 B
C#
namespace Jiaowu.Api.Domain.Identity;
|
|
|
|
/// <summary>Public WebAuthn credential material. Private keys never leave the authenticator.</summary>
|
|
public sealed class PasskeyCredential
|
|
{
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
public Guid UserId { get; set; }
|
|
public required string CredentialId { get; set; }
|
|
/// <summary>SHA-256 of the raw credential ID, used for a portable unique index.</summary>
|
|
public required string CredentialIdHash { get; set; }
|
|
public required byte[] PublicKey { get; set; }
|
|
public uint SignatureCounter { get; set; }
|
|
public required string FriendlyName { get; set; }
|
|
public string? Transports { get; set; }
|
|
public bool IsBackupEligible { get; set; }
|
|
public bool IsBackedUp { get; set; }
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
public DateTime? LastUsedAt { get; set; }
|
|
public ApplicationUser? User { get; set; }
|
|
}
|