NCache.OSS.AspNetCore.DataProtection 5.3.603

dotnet add package NCache.OSS.AspNetCore.DataProtection --version 5.3.603
                    
NuGet\Install-Package NCache.OSS.AspNetCore.DataProtection -Version 5.3.603
                    
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="NCache.OSS.AspNetCore.DataProtection" Version="5.3.603" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NCache.OSS.AspNetCore.DataProtection" Version="5.3.603" />
                    
Directory.Packages.props
<PackageReference Include="NCache.OSS.AspNetCore.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 NCache.OSS.AspNetCore.DataProtection --version 5.3.603
                    
#r "nuget: NCache.OSS.AspNetCore.DataProtection, 5.3.603"
                    
#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 NCache.OSS.AspNetCore.DataProtection@5.3.603
                    
#: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=NCache.OSS.AspNetCore.DataProtection&version=5.3.603
                    
Install as a Cake Addin
#tool nuget:?package=NCache.OSS.AspNetCore.DataProtection&version=5.3.603
                    
Install as a Cake Tool

NCache as Key Storage Provider for ASP.NET Core Data Protection

Introduction

ASP.NET Core Data Protection is a security system that protects sensitive information through encryption. It manages encryption keys whose storage location can vary, Like file system, Azure Storage, or a custom repository. The NCache.OSS.AspNetCore.DataProtection package lets you use NCache as that custom key storage provider, so encryption keys are stored in the cache and shared across multiple instances of a web application running in a web farm.

Prerequisites

  • NCache OSS v5.3.603 server running, with your target cache in Started state.
  • An ASP.NET Core application with Data Protection configured.

Usage

Step 1: Configure your NCache connection

Two configuration files are copied to your output directory on build: client.ncconf and config.ncconf

client.ncconf points the client at your NCache server. Set your server IP and make sure cache id matches the cache name you pass in code:

<cache id="myCache" enable-client-logs="False" log-level="error">
    <server name="YOUR_SERVER_IP"/>
</cache>

config.ncconf holds cache side settings and ships with sensible defaults. Adjust only if your cache configuration requires it.

Step 2: Register NCache as the key storage provider

In your Program.cs, chain PersistKeysToNCache onto AddDataProtection:

builder.Services.AddDataProtection()
    .PersistKeysToNCache("myCache", "DataProtectionKeys");
  • First argument (cacheName) the name of the cache where encryption keys will be stored. Must match the cache id in client.ncconf.
  • Second argument (cacheTag) an arbitrary string used internally to group and retrieve all keys together. Every server instance in your web farm must use the same value.

Keys are stored as Base64 encoded XML elements and expire automatically based on the expiration time embedded in each key by the Data Protection framework. Revocation entries are stored without expiration.

How It Works

PersistKeysToNCache registers an NCacheXmlRepository as the IXmlRepository for the Data Protection key management system. On startup, the repository connects to the specified cache. When the framework needs to store a new key, it calls StoreElement, which encodes the key XML to Base64 and inserts it into the cache under the provided tag. When the framework needs all current keys (e.g., to decrypt data), it calls GetAllElements, which retrieves every item grouped under that tag and deserializes them back to XML.

Additional Resources

Documentation

http://www.alachisoft.com/resources/docs/#ncache

Programmer's Guide

http://www.alachisoft.com/resources/docs/ncache/prog-guide/

ASP.NET Core Data Protection

https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/introduction

Key Storage Providers

https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/key-storage-providers

Technical Support

Alachisoft � provides various sources of technical support.

License

Copyright � 2005-2026 Alachisoft. All rights reserved.

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.  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. 
.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)
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
5.3.603 0 10/30/2026
5.3.6 175 7/7/2026