ApricotFramework.DataProtection
0.1.0
Prefix Reserved
dotnet add package ApricotFramework.DataProtection --version 0.1.0
NuGet\Install-Package ApricotFramework.DataProtection -Version 0.1.0
<PackageReference Include="ApricotFramework.DataProtection" Version="0.1.0" />
<PackageVersion Include="ApricotFramework.DataProtection" Version="0.1.0" />
<PackageReference Include="ApricotFramework.DataProtection" />
paket add ApricotFramework.DataProtection --version 0.1.0
#r "nuget: ApricotFramework.DataProtection, 0.1.0"
#:package ApricotFramework.DataProtection@0.1.0
#addin nuget:?package=ApricotFramework.DataProtection&version=0.1.0
#tool nuget:?package=ApricotFramework.DataProtection&version=0.1.0
ApricotFramework.DataProtection
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
| Product | Versions 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. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ApricotFramework.DataProtection:
| Package | Downloads |
|---|---|
|
ApricotFramework.DataProtection.AspNetCore
ASP.NET Core integration for ApricotFramework.DataProtection: an IDeletableXmlRepository over the key store, PersistKeysTo extensions on IDataProtectionBuilder, and the application discriminator bound from configuration. Leaves at-rest key encryption and key lifetime to the host, so every framework extension point still composes. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 143 | 8/21/2026 |