DataProtectionBuilderExtensions.ProtectKeysWithDpapiNG Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ProtectKeysWithDpapiNG(IDataProtectionBuilder, String, DpapiNGProtectionDescriptorFlags) |
Configures keys to be encrypted with Windows CNG DPAPI before being persisted to storage. |
ProtectKeysWithDpapiNG(IDataProtectionBuilder) |
Configures keys to be encrypted with Windows CNG DPAPI before being persisted to storage. The keys will be decryptable by the current Windows user account. |
ProtectKeysWithDpapiNG(IDataProtectionBuilder, String, DpapiNGProtectionDescriptorFlags)
Configures keys to be encrypted with Windows CNG DPAPI before being persisted to storage.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ ProtectKeysWithDpapiNG(Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ builder, System::String ^ protectionDescriptorRule, Microsoft::AspNetCore::DataProtection::XmlEncryption::DpapiNGProtectionDescriptorFlags flags);
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder ProtectKeysWithDpapiNG (this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, string protectionDescriptorRule, Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags flags);
static member ProtectKeysWithDpapiNG : Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder * string * Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags -> Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder
<Extension()>
Public Function ProtectKeysWithDpapiNG (builder As IDataProtectionBuilder, protectionDescriptorRule As String, flags As DpapiNGProtectionDescriptorFlags) As IDataProtectionBuilder
Parameters
- builder
- IDataProtectionBuilder
- protectionDescriptorRule
- String
The descriptor rule string with which to protect the key material.
Flags that should be passed to the call to 'NCryptCreateProtectionDescriptor'. The default value of this parameter is None.
Returns
A reference to the IDataProtectionBuilder after this operation has completed.
Remarks
See https://msdn.microsoft.com/en-us/library/windows/desktop/hh769091(v=vs.85).aspx and https://msdn.microsoft.com/en-us/library/windows/desktop/hh706800(v=vs.85).aspx for more information on valid values for the the protectionDescriptorRule
and flags
arguments. This API is only supported on Windows 8 / Windows Server 2012 and higher.
Applies to
ProtectKeysWithDpapiNG(IDataProtectionBuilder)
Configures keys to be encrypted with Windows CNG DPAPI before being persisted to storage. The keys will be decryptable by the current Windows user account.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ ProtectKeysWithDpapiNG(Microsoft::AspNetCore::DataProtection::IDataProtectionBuilder ^ builder);
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder ProtectKeysWithDpapiNG (this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder);
static member ProtectKeysWithDpapiNG : Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder -> Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder
<Extension()>
Public Function ProtectKeysWithDpapiNG (builder As IDataProtectionBuilder) As IDataProtectionBuilder
Parameters
- builder
- IDataProtectionBuilder
Returns
A reference to the IDataProtectionBuilder after this operation has completed.
Remarks
See https://msdn.microsoft.com/en-us/library/windows/desktop/hh706794(v=vs.85).aspx for more information on DPAPI-NG. This API is only supported on Windows 8 / Windows Server 2012 and higher.