Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

1.3 KB
Raw Blame
//-----------------------------------------------------------------------
// <copyright file="BlobReference.cs" company="aliasvault">
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
// </copyright>
//-----------------------------------------------------------------------

namespace AliasVault.Shared.Models.WebApi.V2.Vault;

using System.ComponentModel.DataAnnotations;

/// <summary>
/// A reference to a content-addressed blob held in VaultBlobObjects.
/// </summary>
public class BlobReference
{
    /// <summary>Gets or sets the per-manifest salted SHA-256 hex of the plaintext.</summary>
    [RegularExpression(VaultWriteLimits.HashPattern)]
    public required string Hash { get; set; }

    /// <summary>Gets or sets the blob category (e.g. "favicon" or "attachment").</summary>
    [StringLength(VaultWriteLimits.MaxCategoryLength, MinimumLength = 1)]
    public required string Category { get; set; }

    /// <summary>
    /// Gets or sets the size of the encrypted payload in bytes. Server-populated on read so a client can size its
    /// download batches by bytes instead of by count; ignored on write (the server measures the bytes it stores).
    /// </summary>
    public int SizeBytes { get; set; }
}