//-----------------------------------------------------------------------
//
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
//
//-----------------------------------------------------------------------
namespace AliasServerDb;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
///
/// UserEncryptionKey object. This object is used for storing user public keys for encryption.
///
public class UserEncryptionKey
{
///
/// Gets or sets the ID.
///
[Key]
public Guid Id { get; set; }
///
/// Gets or sets user ID foreign key.
///
[StringLength(255)]
public string UserId { get; set; } = null!;
///
/// Gets or sets foreign key to the AliasVaultUser object.
///
[ForeignKey("UserId")]
public virtual AliasVaultUser User { get; set; } = null!;
///
/// Gets or sets the public key.
///
[StringLength(2000)]
public string PublicKey { get; set; } = null!;
///
/// Gets or sets a value indicating whether this public key is the primary key to use by default.
///
public bool IsPrimary { get; set; }
///
/// Gets or sets created timestamp.
///
public DateTime CreatedAt { get; set; }
///
/// Gets or sets updated timestamp.
///
public DateTime UpdatedAt { get; set; }
///
/// Gets or sets the collection of Emails that are using this encryption key.
///
public virtual ICollection Emails { get; set; } = [];
}