DataProtectionProvider Class

Definition

Contains factory methods for creating an IDataProtectionProvider where keys are stored at a particular location on the file system.

C#
public static class DataProtectionProvider
Inheritance
DataProtectionProvider

Remarks

Use these methods when not using dependency injection to provide the service to the application.

Methods

Create(DirectoryInfo, Action<IDataProtectionBuilder>, X509Certificate2)

Creates an DataProtectionProvider given a location at which to store keys, an optional configuration callback and a X509Certificate2 used to encrypt the keys.

Create(DirectoryInfo, Action<IDataProtectionBuilder>)

Creates an DataProtectionProvider given a location at which to store keys and an optional configuration callback.

Create(DirectoryInfo, X509Certificate2)

Creates an DataProtectionProvider given a location at which to store keys and a X509Certificate2 used to encrypt the keys.

Create(DirectoryInfo)

Creates an DataProtectionProvider given a location at which to store keys.

Create(String, X509Certificate2)

Creates a DataProtectionProvider that store keys in a location based on the platform and operating system and uses the given X509Certificate2 to encrypt the keys.

Create(String)

Creates a DataProtectionProvider that store keys in a location based on the platform and operating system.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0