ConsealDev.Conseal 0.7.0

dotnet add package ConsealDev.Conseal --version 0.7.0
                    
NuGet\Install-Package ConsealDev.Conseal -Version 0.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ConsealDev.Conseal" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConsealDev.Conseal" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="ConsealDev.Conseal" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ConsealDev.Conseal --version 0.7.0
                    
#r "nuget: ConsealDev.Conseal, 0.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ConsealDev.Conseal@0.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ConsealDev.Conseal&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=ConsealDev.Conseal&version=0.7.0
                    
Install as a Cake Tool

Conseal for ASP.NET Core

The backend of Conseal, end-to-end encryption for web apps. It serves the sync and circle routes of Conseal's spec for ASP.NET Core, over DynamoDB, with blobs in S3. It stores and orders ciphertext it can't open: sealing, opening and merging run on the client, in Conseal for JavaScript.

It implements version 0.2.0 of the spec, openapi.yaml and circle.yaml.

Route group Mapped by Serves
Sync MapConsealSyncRoutes("sync") The collections and limits, pulling and pushing records, and the blob routes
Circle MapConsealCircleRoutes("circle") The AEK commitment, the devices and their wrapped AEKs, and the join ceremony

Installation

dotnet add package ConsealDev.Conseal

It targets .NET 10.

Configuration

The settings go in appsettings.json, under ConsealSync:

{
  "ConsealSync": {
    "CursorSigningKey": "…",
    "Collections": ["7f3a9c21", "b4e70118"]
  }
}

CursorSigningKey is a long random secret of your own, base64 of at least 32 bytes, such as openssl rand -base64 32. It signs the pull cursors. Collections are the ids from the client's collection registry, never the collection names. The app refuses to start without a key and at least one collection.

Use

Register a store, the collections and the routes:

// Sign-in is the app's own, AuthStack or any other: Conseal has no identity of its own.
builder.Services.AddAuthentication(/* ... */);
builder.Services.AddAuthorization();

builder.Services
    .AddConsealSync(builder.Configuration)       // reads the ConsealSync section
    .AddDynamoStores(o => o.TablePrefix = "myapp-")
    .WithBlobs(o =>                              // optional: blobs for the collections named
    {
        o.BucketName = "myapp-blobs";
        o.Collections.Add("7f3a9c21");
    })
    .WithHooks<MyCircleNotifications>();         // optional

var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.MapConsealSyncRoutes("sync");
app.MapConsealCircleRoutes("circle");

Every route requires an authenticated user, whose id the routes read from the sign-in: the sub claim by default. Each route group comes back from Map…, so the app adds its own conventions, such as .RequireRateLimiting("sync"): the spec's 429 is the app's to send.

AddDynamoStores keeps records and circles in two DynamoDB tables, which ConsealSyncDynamoTables.Definitions(prefix) describes for the app's infrastructure code. AddInMemoryStores() keeps them in memory, for tests.

IConsealSyncHooks has one method for each event in a user's circle: a device joined, a device was revoked, and a revoked device made contact. OnDeviceJoinedAsync is where the app tells the user that a device joined:

public sealed class MyCircleNotifications : IConsealSyncHooks
{
    public Task OnDeviceJoinedAsync(string userId, string deviceId, DeviceJoinKind kind, CancellationToken cancellationToken)
    {
        // kind is Founding, Ceremony or Recovery. A Recovery can't be told apart from someone with the user's sign-in adding a device.
        return Task.CompletedTask;
    }

    // OnDeviceRevokedAsync and OnRevokedDeviceContactAsync are required too; they can return Task.CompletedTask.
    public Task OnDeviceRevokedAsync(string userId, string deviceId, CancellationToken cancellationToken) => Task.CompletedTask;
    public Task OnRevokedDeviceContactAsync(string userId, string deviceId, CancellationToken cancellationToken) => Task.CompletedTask;
}

Docs

conseal.dev/docs/dotnet has every setting and its default, the storage and its limits, the blob routes and the bucket they need, and the hooks.


Licensed under the GNU Affero General Public License, version 3 or any later version, or the Conseal Commercial License. See LICENSE and COMMERCIAL-LICENSE.md for full terms.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0 94 11/22/2026