Azure.Extensions.AspNetCore.DataProtection.Keys
1.1.0
Prefix Reserved
Install-Package Azure.Extensions.AspNetCore.DataProtection.Keys -Version 1.1.0
dotnet add package Azure.Extensions.AspNetCore.DataProtection.Keys --version 1.1.0
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.1.0" />
paket add Azure.Extensions.AspNetCore.DataProtection.Keys --version 1.1.0
#r "nuget: Azure.Extensions.AspNetCore.DataProtection.Keys, 1.1.0"
// Install Azure.Extensions.AspNetCore.DataProtection.Keys as a Cake Addin
#addin nuget:?package=Azure.Extensions.AspNetCore.DataProtection.Keys&version=1.1.0
// Install Azure.Extensions.AspNetCore.DataProtection.Keys as a Cake Tool
#tool nuget:?package=Azure.Extensions.AspNetCore.DataProtection.Keys&version=1.1.0
Azure Key Vault Key Encryptor for Microsoft.AspNetCore.DataProtection
The Azure.Extensions.AspNetCore.DataProtection.Keys
package allows protecting keys at rest using Azure Key Vault Key Encryption/Wrapping feature.
Getting started
Install the package
Install the package with NuGet:
dotnet add package Azure.Extensions.AspNetCore.DataProtection.Keys
Prerequisites
You need an Azure subscription, Key Vault and a Key to use this package.
To create a new Key Vault, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI:
az keyvault create --name MyVault --resource-group MyResourceGroup --location westus
az keyvault key create --name MyKey --vault-name MyVault
# give write access to a service principal (application)
az keyvault set-policy -n MyVault --object-id <application_id> --key-permissions get unwrapKey wrapKey
Key concepts
Thread safety
We guarantee that all client instance methods are thread-safe and independent of each other (guideline). This ensures that the recommendation of reusing client instances is always safe, even across threads.
Additional concepts
Client options | Accessing the response | Long-running operations | Handling failures | Diagnostics | Mocking | Client lifetime
Examples
To protect keys using Azure Key Vault Key, configure the system with ProtectKeysWithAzureKeyVault
when configuring the services:
public void ConfigureServices(IServiceCollection services)
{
services
.AddDataProtection()
.ProtectKeysWithAzureKeyVault(new Uri("<Key-ID>"), new DefaultAzureCredential());
}
The Azure Identity library provides easy Azure Active Directory support for authentication.
Next steps
Read more about DataProtection in ASP.NET Core.
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.microsoft.com.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETStandard 2.0
- Azure.Core (>= 1.19.0)
- Azure.Security.KeyVault.Keys (>= 4.2.0)
- Microsoft.AspNetCore.DataProtection (>= 2.1.0)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on Azure.Extensions.AspNetCore.DataProtection.Keys:
Package | Downloads |
---|---|
Skoruba.IdentityServer4.Shared.Configuration
Shared common layer for the administration of the IdentityServer4 and Asp.Net Core Identity |
|
Jeebs.Apps
Jeebs.Apps library |
|
Skoruba.Duende.IdentityServer.Shared.Configuration
Shared common layer for the administration of the Duende IdentityServer and Asp.Net Core Identity |
|
Rixian.Extensions.AspNetCore.DataProtection
Data Protection extensions for Asp.Net Core. |
|
Aguacongas.TheIdServer
OpenID/Connect , OAuth and WS-Federation server base on IdentityServer4. |
GitHub repositories (7)
Showing the top 5 popular GitHub repositories that depend on Azure.Extensions.AspNetCore.DataProtection.Keys:
Repository | Stars |
---|---|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
nopSolutions/nopCommerce
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
|
|
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 2.1, 2.2, 3.1, 5.0, 6.0 and 7.0 projects you can use. Readme contains explanations on all projects.
|
|
skoruba/IdentityServer4.Admin
The administration for the IdentityServer4 and Asp.Net Core Identity
|
|
enkodellc/blazorboilerplate
Blazor Boilerplate / Starter Template with MudBlazor
|