Dela via


IDataProtectionProvider.CreateProtector(String) Method

Definition

Creates an IDataProtector given a purpose.

public:
 Microsoft::AspNetCore::DataProtection::IDataProtector ^ CreateProtector(System::String ^ purpose);
public Microsoft.AspNetCore.DataProtection.IDataProtector CreateProtector (string purpose);
abstract member CreateProtector : string -> Microsoft.AspNetCore.DataProtection.IDataProtector
Public Function CreateProtector (purpose As String) As IDataProtector

Parameters

purpose
String

The purpose to be assigned to the newly-created IDataProtector.

Returns

An IDataProtector tied to the provided purpose.

Remarks

The purpose parameter must be unique for the intended use case; two different IDataProtector instances created with two different purpose values will not be able to decipher each other's payloads. The purpose parameter value is not intended to be kept secret.

Applies to