ApricotFramework.DataProtection.AspNetCore 0.1.0

Prefix Reserved
dotnet add package ApricotFramework.DataProtection.AspNetCore --version 0.1.0
                    
NuGet\Install-Package ApricotFramework.DataProtection.AspNetCore -Version 0.1.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="ApricotFramework.DataProtection.AspNetCore" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApricotFramework.DataProtection.AspNetCore" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ApricotFramework.DataProtection.AspNetCore" />
                    
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 ApricotFramework.DataProtection.AspNetCore --version 0.1.0
                    
#r "nuget: ApricotFramework.DataProtection.AspNetCore, 0.1.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 ApricotFramework.DataProtection.AspNetCore@0.1.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=ApricotFramework.DataProtection.AspNetCore&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ApricotFramework.DataProtection.AspNetCore&version=0.1.0
                    
Install as a Cake Tool

ApricotFramework.DataProtection

NuGet NuGet NuGet CI License

Relational storage for the ASP.NET Core Data Protection key ring, using plain ADO.NET: one table, four statements, no Entity Framework and no database driver. Keys survive a restart and are shared across instances, so a load-balanced app can read its own cookies.

ApricotFramework.DataProtection is the zero-dependency core.

Install

dotnet add package ApricotFramework.DataProtection
dotnet add package ApricotFramework.DataProtection.AspNetCore

Usage

using ApricotFramework.DataProtection.AspNetCore.Extensions;

builder.Services.AddDataProtectionCore(builder.Configuration)
    .PersistKeysToRelationalStore(_ => new MySqlConnection(connectionString))
    .ProtectKeysWithCertificate(certificate);
{
  "DataProtection": {
    "Application": "/app",
    "Storage": {
      "Relational": { "Dialect": "MySql", "TableName": "DataProtectionKeys" }
    }
  }
}

The column names are fixed and match the official Entity Framework Core provider's entity, so one table can be read by either implementation. Only the table and schema are configurable.

The caveat that matters

Specifying any explicit key storage location makes the framework deregister its default at-rest key encryption, so key material is written unprotected unless you say otherwise. That is true of every storage provider, not just this one. Watch for this at startup:

warn: No XML encryptor configured. Key {...} may be persisted to storage in unencrypted form.

Chain ProtectKeysWithCertificate, ProtectKeysWithAzureKeyVault or another ProtectKeysWith* to fix it. This library never configures one for you — but since it is what caused the situation, it will not let the question go unanswered: a store registered without an encryptor fails at startup. Where that is genuinely intended, say so:

    .AllowUnprotectedKeys();   // storage encrypts on your behalf, or it is development

Docs

https://projectapricot.dev

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 (1)

Showing the top 1 NuGet packages that depend on ApricotFramework.DataProtection.AspNetCore:

Package Downloads
ApricotFramework.DataProtection.DataOps

Persists the ASP.NET Core Data Protection key ring to a data source declared for ApricotFramework.DataOps, taking the connection from its registry and the SQL dialect from the data source's provider. Depends only on the DataOps contracts, so it brings no execution engine and no database driver.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 140 8/21/2026