DNV.Dapr.DataProtection 2.1.0-preview.1756358515

This is a prerelease version of DNV.Dapr.DataProtection.
There is a newer version of this package available.
See the version list below for details.
dotnet add package DNV.Dapr.DataProtection --version 2.1.0-preview.1756358515
                    
NuGet\Install-Package DNV.Dapr.DataProtection -Version 2.1.0-preview.1756358515
                    
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="DNV.Dapr.DataProtection" Version="2.1.0-preview.1756358515" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DNV.Dapr.DataProtection" Version="2.1.0-preview.1756358515" />
                    
Directory.Packages.props
<PackageReference Include="DNV.Dapr.DataProtection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DNV.Dapr.DataProtection --version 2.1.0-preview.1756358515
                    
#r "nuget: DNV.Dapr.DataProtection, 2.1.0-preview.1756358515"
                    
#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.
#:package DNV.Dapr.DataProtection@2.1.0-preview.1756358515
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DNV.Dapr.DataProtection&version=2.1.0-preview.1756358515&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DNV.Dapr.DataProtection&version=2.1.0-preview.1756358515&prerelease
                    
Install as a Cake Tool

DNV.Dapr.DataProtection

A .NET library that integrates Dapr's cryptography and state store capabilities with ASP.NET Core Data Protection system.

Overview

This library provides seamless integration between Dapr's distributed application building blocks and .NET's Data Protection APIs, enabling secure key storage and encryption in distributed environments.

Target Framework

  • .NET 8.0

Features

  • Dapr State Store Integration: Persist Data Protection keys in Dapr state stores
  • Dapr Cryptography Integration: Protect keys using Dapr's cryptography building blocks
  • XML Repository: Store and retrieve Data Protection keys as XML in Dapr state stores
  • XML Cipher: Encrypt and decrypt Data Protection keys using Dapr crypto APIs

Dependencies

  • Microsoft.AspNetCore.DataProtection
  • Dapr.Client

Key Components

DaprStateStoreXmlRepository

Implements IXmlRepository to store Data Protection keys in a Dapr state store.

DaprXmlCipher

Implements IXmlEncryptor and IXmlDecryptor to encrypt and decrypt Data Protection keys using Dapr's cryptography APIs.

Extension Methods

Provides convenient extension methods for configuring Data Protection with Dapr:

  • PersistKeysToDaprStateStore() - Configure key persistence to Dapr state store
  • ProtectKeysWithDaprCrypto() - Configure key protection using Dapr crypto

Configuration Options

DaprStateStoreOptions

  • ComponentName: Name of the Dapr state store component
  • KeyName: Key name used to store the XML repository data

DaprXmlCipherOptions

  • ComponentName: Name of the Dapr cryptography component
  • KeyName: Key name used for encryption/decryption operations

Author

Eric Liu li.eric.liu@dnv.com

Usage

Basic Setup

services.AddDataProtection()
    .PersistKeysToDaprStateStore("statestore", "dataprotection-keys")
    .ProtectKeysWithDaprCrypto("crypto", "master-key");

Advanced Configuration

services.AddDataProtection()
    .PersistKeysToDaprStateStore(o => { 
        o.ComponentName = "my-state-store"; 
        o.KeyName = "custom-key-name";
    }) 
    .ProtectKeysWithDaprCrypto(o => { 
        o.ComponentName = "my-crypto-component"; 
        o.KeyName = "encryption-key";
    });

Configuration Options

DaprStateStoreOptions

  • ComponentName: Name of the Dapr state store component
  • KeyName: Key name used to store the XML repository data

DaprXmlCipherOptions

  • ComponentName: Name of the Dapr cryptography component
  • KeyName: Key name used for encryption/decryption operations

Author

Eric Liu li.eric.liu@dnv.com

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
2.2.0 14 9/18/2025
2.1.0 122 2/8/2025
2.1.0-preview.1756698443 117 9/1/2025
2.1.0-preview.1756370241 158 8/28/2025
2.1.0-preview.1756358515 163 8/28/2025
2.1.0-preview.1756200584 180 8/26/2025
2.1.0-preview.1756199251 177 8/26/2025
2.1.0-preview.1755771145 113 8/21/2025
2.0.1 131 9/27/2024
2.0.0 148 5/13/2024 2.0.0 is deprecated because it is no longer maintained.
1.1.0 140 8/9/2024
1.0.1 125 5/13/2024