Azure.Extensions.AspNetCore.DataProtection.Keys 1.2.3

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Azure.Extensions.AspNetCore.DataProtection.Keys --version 1.2.3
NuGet\Install-Package Azure.Extensions.AspNetCore.DataProtection.Keys -Version 1.2.3
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="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.2.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Azure.Extensions.AspNetCore.DataProtection.Keys --version 1.2.3
#r "nuget: Azure.Extensions.AspNetCore.DataProtection.Keys, 1.2.3"
#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 Azure.Extensions.AspNetCore.DataProtection.Keys as a Cake Addin
#addin nuget:?package=Azure.Extensions.AspNetCore.DataProtection.Keys&version=1.2.3

// Install Azure.Extensions.AspNetCore.DataProtection.Keys as a Cake Tool
#tool nuget:?package=Azure.Extensions.AspNetCore.DataProtection.Keys&version=1.2.3

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 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.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (26)

Showing the top 5 NuGet packages that depend on Azure.Extensions.AspNetCore.DataProtection.Keys:

Package Downloads
CyberEye.Constant.Lib

Package chứa các constant và enum

Jeebs.Apps

Jeebs.Apps library

Skoruba.IdentityServer4.Shared.Configuration The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Shared common layer for the administration of the IdentityServer4 and Asp.Net Core Identity

Skoruba.Duende.IdentityServer.Shared.Configuration The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Shared common layer for the administration of the Duende IdentityServer and Asp.Net Core Identity

SSS.AspNetCore.Extensions

Use to develop the common components, libraries, etc. that will be embedded into projects with configuration to use

GitHub repositories (11)

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 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,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
Version Downloads Last updated
1.2.3 35,013 2/13/2024
1.2.2 2,190,610 3/14/2023
1.2.1 45,133 3/7/2023
1.2.0 189,014 2/7/2023
1.1.0 3,506,856 9/2/2021
1.0.3 811,683 5/14/2021
1.0.2 1,280,884 9/4/2020
1.0.1 64,629 8/10/2020
1.0.0 46,152 6/5/2020
1.0.0-preview.2 454 5/5/2020