SqlServerDataProtectionProvider 1.0.0
dotnet add package SqlServerDataProtectionProvider --version 1.0.0
NuGet\Install-Package SqlServerDataProtectionProvider -Version 1.0.0
<PackageReference Include="SqlServerDataProtectionProvider" Version="1.0.0" />
paket add SqlServerDataProtectionProvider --version 1.0.0
#r "nuget: SqlServerDataProtectionProvider, 1.0.0"
// Install SqlServerDataProtectionProvider as a Cake Addin #addin nuget:?package=SqlServerDataProtectionProvider&version=1.0.0 // Install SqlServerDataProtectionProvider as a Cake Tool #tool nuget:?package=SqlServerDataProtectionProvider&version=1.0.0
SqlServerDataProtectionProvider
A .Net Core Data Protection provider to persist keys to Sql Server
The primary public use of this library will be via the PersistKeysToSqlServer() IDataProtectionBuilder extension method.
Usage: In your database context, implement IDataProtectionContext and add a DbSet<DataProtectionKey> property.
public class ApplicationDbContext : IDataProtectionContext
{
public DbSet<DataProtectionKey> DataProtectionKeys { get; set; }
...
}
In Startup.cs's ConfigureServices method, add a service to provide the IDataProtectionContext:
services.AddTransient<IDataProtectionContext, ApplicationDbContext>();
Also in your startup's ConfigureServices method, when configuring DataProtection, you can now use PersistToSqlServer to persist your keys to a Sql Server database. You will need to provide the
Example:
services.AddDataProtection()
.PersistKeysToSqlServer(() => services.BuildServiceProvider().GetRequiredService<IDataProtectionContext>())
.ProtectKeysWithCertificate(dataProtectionCert)
.SetApplicationName("<AppName>")
.SetDefaultKeyLifetime(TimeSpan.FromDays(10))
.UseCryptographicAlgorithms(encryptionSettings);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.1
- Microsoft.AspNetCore.DataProtection (>= 2.1.0)
- Microsoft.EntityFrameworkCore (>= 2.1.0)
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 |
---|---|---|
1.0.0 | 8,758 | 8/12/2018 |