JGUZDV.AspNetCore.DataProtection
1.1.1
See the version list below for details.
dotnet add package JGUZDV.AspNetCore.DataProtection --version 1.1.1
NuGet\Install-Package JGUZDV.AspNetCore.DataProtection -Version 1.1.1
<PackageReference Include="JGUZDV.AspNetCore.DataProtection" Version="1.1.1" />
<PackageVersion Include="JGUZDV.AspNetCore.DataProtection" Version="1.1.1" />
<PackageReference Include="JGUZDV.AspNetCore.DataProtection" />
paket add JGUZDV.AspNetCore.DataProtection --version 1.1.1
#r "nuget: JGUZDV.AspNetCore.DataProtection, 1.1.1"
#:package JGUZDV.AspNetCore.DataProtection@1.1.1
#addin nuget:?package=JGUZDV.AspNetCore.DataProtection&version=1.1.1
#tool nuget:?package=JGUZDV.AspNetCore.DataProtection&version=1.1.1
JGUZDV.AspNetCore.DataProtection
This package allows to configure data protection via the appsettings.json file (or the AspNetCore configuration system to be more precise).
If you want to configure multiple applications running on a shared host, you might want to set those keys via the environment variables.
E.g. JGUZDV__DataProtection__UsePersistance.
It can be addded via the extension method AddJGUZDVDataProtection on either IServiceCollection or WebApplicationBuilder.
Program.cs
// Registeres the DataProtection settings in production
if (builder.Environment.IsProduction())
{
builder.AddJGUZDVDataProtection();
}
appsettings.json
{
"JGUZDV" : {
"DataProtection" : { // default section JGUZDV:DataProtection - a custom section can be passed
"ApplicationName" : "MyApp", // Name to be used by SetApplicationName and UsePathIsolation, if not set, IHostingEnvironment.ApplicationName will be used as default.
"SetApplicationName" : false, // if true, calls SetApplicationName and passes the aforementioned ApplicationName, default: false
"DisableAutomaticKeyGeneration" : false // if true automatic key generation is disabled, default: false
"UsePersistence" : true // enables persistence configuration, default: true
"Persistence" : { // must be defined if UsePersistence is true
"UseFileSystem" : false, // if true, persists to file system, default: false
"FileSystem" : { // must be defined if UseFileSystem is true
"Path" : "/my-dataprot-path/", // path for file system persistence
"UseIsolatedPath" : true // if true, combines Path with ApplicationName, e.g. /my-dataprot-path/MyApp, default: true
}
},
"UseProtection" : true // if true, protect keys, default: true
"Protection" : { // must be defined if UseProtection is true
"UseCertificate" : false, // if true, use certificate for protection
"Certificate" : { // optional, must be defined if UseCertificate is true
"Thumbprint" : "", // certificate thumbprint - must be set if file name is empty
"FileName" : "name", // certificate filename - must be set if thumbprint empty
"Password" : "password" // optional password for certificate
},
"UseDpapi" : true, // if true, use Windows DPAPI
"UseDpapiNG" : true // if true, use Windows Server DpapiNG
}
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on JGUZDV.AspNetCore.DataProtection:
| Package | Downloads |
|---|---|
|
JGUZDV.AspNetCore.Hosting
HostBuilders for our default setup. |
GitHub repositories
This package is not used by any popular GitHub repositories.