SqlServerDataProtectionProvider 1.0.0

dotnet add package SqlServerDataProtectionProvider --version 1.0.0                
NuGet\Install-Package SqlServerDataProtectionProvider -Version 1.0.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="SqlServerDataProtectionProvider" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SqlServerDataProtectionProvider --version 1.0.0                
#r "nuget: SqlServerDataProtectionProvider, 1.0.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.
// 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 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. 
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
1.0.0 8,758 8/12/2018