DataProtectionProvider 建構函式

定義

多載

DataProtectionProvider()

用於解密作業的建構函式。 在呼叫 UnprotectAsyncUnprotectStreamAsync 方法之前,請先使用此建構函式。

DataProtectionProvider(String)

用於加密作業的建構函式。 在呼叫 ProtectAsyncProtectStreamAsync 方法之前,請先使用此建構函式。

DataProtectionProvider()

用於解密作業的建構函式。 在呼叫 UnprotectAsyncUnprotectStreamAsync 方法之前,請先使用此建構函式。

public:
 DataProtectionProvider();
 DataProtectionProvider();
public DataProtectionProvider();
function DataProtectionProvider()
Public Sub New ()

備註

啟動解密作業之前,請先使用此建構函式。 啟動加密作業之前,請勿使用此建構函式。 請改用 DataProtectionProvider (String) 方法。

針對安全性描述項和 SDDL 字串,您必須在資訊清單中設定企業驗證功能。 企業驗證功能僅限於使用公司帳戶建置的 UWP 應用程式,而且受限於額外的上線驗證。 除非絕對必要,否則您應該避免企業驗證功能。 如需詳細資訊,請參閱 註冊開發人員帳戶。 例如,下列 SID 和 SDDL 提供者需要企業驗證功能:

  • 「SID=S-1-5-21-4392301 AND SID=S-1-5-21-3101812」
  • 「SDDL=O:S-1-5-5-0-290724G:SYD: (A;;CCDC;;;S-1-5-5-0-290724) (A;;DC;;;WD) 」

這些提供者不需要企業驗證功能:

  • 「LOCAL=user」
  • 「LOCAL=machine」
  • 「WEBCREDENTIALS=MyPasswordName」
  • 「WEBCREDENTIALS=MyPasswordName,myweb.com」

另請參閱

適用於

DataProtectionProvider(String)

用於加密作業的建構函式。 在呼叫 ProtectAsyncProtectStreamAsync 方法之前,請先使用此建構函式。

public:
 DataProtectionProvider(Platform::String ^ protectionDescriptor);
 DataProtectionProvider(winrt::hstring const& protectionDescriptor);
public DataProtectionProvider(string protectionDescriptor);
function DataProtectionProvider(protectionDescriptor)
Public Sub New (protectionDescriptor As String)

參數

protectionDescriptor
String

Platform::String

winrt::hstring

包含保護描述項,決定要加密資料的實體。 如需詳細資訊,請參閱<備註>。

備註

啟動解密作業之前,請勿使用此建構函式。 您必須改用 DataProtectionProvider () 建構函式。

針對安全性描述項和 SDDL 字串,您必須在資訊清單中設定企業驗證功能。 企業驗證功能僅限於使用公司帳戶建置的應用程式,而且受限於額外的上線驗證。 除非絕對必要,否則您應該避免企業驗證功能。 例如,下列 SID 和 SDDL 提供者需要企業驗證功能:

  • 「SID=S-1-5-21-4392301 AND SID=S-1-5-21-3101812」
  • 「SDDL=O:S-1-5-5-0-290724G:SYD: (A;;CCDC;;;S-1-5-5-0-290724) (A;;DC;;;WD) 」

這些提供者不需要任一平臺上的企業驗證功能:

  • 「LOCAL=user」
  • 「LOCAL=machine」

這些提供者不需要 Windows 上的企業驗證功能:

  • 「WEBCREDENTIALS=MyPasswordName」
  • 「WEBCREDENTIALS=MyPasswordName,myweb.com」

另請參閱

適用於