DataProtector(String, String, String[]) Конструктор
Определение
Создает новый экземпляр класса DataProtector, используя предоставленное имя приложения, первичную цель и определенные цели.Creates a new instance of the DataProtector class by using the provided application name, primary purpose, and specific purposes.
protected:
DataProtector(System::String ^ applicationName, System::String ^ primaryPurpose, cli::array <System::String ^> ^ specificPurposes);
protected DataProtector (string applicationName, string primaryPurpose, string[] specificPurposes);
new System.Security.Cryptography.DataProtector : string * string * string[] -> System.Security.Cryptography.DataProtector
Protected Sub New (applicationName As String, primaryPurpose As String, specificPurposes As String())
Параметры
- applicationName
- String
Имя приложения.The name of the application.
- primaryPurpose
- String
Основное назначение для защищенных данных.The primary purpose for the protected data.
- specificPurposes
- String[]
Определенное назначение для защищенных данных.The specific purposes for the protected data.
Исключения
applicationName
является пустой строкой или null
.applicationName
is an empty string or null
.
-или--or-
primaryPurpose
является пустой строкой или null
.primaryPurpose
is an empty string or null
.
-или--or-
Параметр specificPurposes
содержит пустую строку или имеет значение null
.specificPurposes
contains an empty string or null
.
Комментарии
Этот конструктор задает ApplicationName свойства, PrimaryPurpose и SpecificPurposes .This constructor sets the ApplicationName, PrimaryPurpose, and SpecificPurposes properties. Сочетание этих трех свойств должно однозначно определять защищаемые данные.The combination of these three properties must uniquely identify the data you are protecting. Если данные не идентифицируются однозначно, вы можете непреднамеренно прочитать неверные данные, иначе другие данные могут быть заменены вашими.If the data is not uniquely identified, you might inadvertently read the wrong data, or other data might be substituted for yours. Примеры пар основного и специального назначения: "счет" и "номер счета", "Подарочная карта" и "номер подарочного сертификата", "пароль" и строка URL-адреса.Examples of primary and specific purpose pairs are "invoice" and invoice number, "gift card" and gift card number, "password" and URL string.