Sdílet prostřednictvím


DataProtectionProvider Constructors

Definition

Overloads

DataProtectionProvider()

Constructor used for decryption operations. Use this constructor before calling the UnprotectAsync or UnprotectStreamAsync methods.

DataProtectionProvider(String)

Constructor used for encryption operations. Use this constructor before calling the ProtectAsync or ProtectStreamAsync methods.

DataProtectionProvider()

Constructor used for decryption operations. Use this constructor before calling the UnprotectAsync or UnprotectStreamAsync methods.

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

Remarks

Use this constructor before starting a decryption operation. Do not use this constructor before starting an encryption operation. Use the DataProtectionProvider(String) method instead.

For security descriptors and SDDL strings, you must set the enterprise authentication capability in the manifest. The enterprise authentication capability is restricted to UWP app built with company accounts, and is subject to additional onboarding validation. You should avoid the enterprise authentication capability unless it is absolutely necessary. For more information, see Registering for a developer account. For example, the following SID and SDDL providers require the enterprise authentication capability:

  • "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)"

These providers do not require the enterprise authentication capability:

  • "LOCAL=user"
  • "LOCAL=machine"
  • "WEBCREDENTIALS=MyPasswordName"
  • "WEBCREDENTIALS=MyPasswordName,myweb.com"

See also

Applies to

DataProtectionProvider(String)

Constructor used for encryption operations. Use this constructor before calling the ProtectAsync or ProtectStreamAsync methods.

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

Parameters

protectionDescriptor
String

Platform::String

winrt::hstring

Contains the protection descriptor that determines the entity to which the data will be encrypted. For more information, see Remarks.

Remarks

Do not use this constructor before starting a decryption operation. You must use the DataProtectionProvider() constructor instead.

For security descriptors and SDDL strings, you must set the enterprise authentication capability in the manifest. The enterprise authentication capability is restricted to apps built with company accounts, and is subject to additional onboarding validation. You should avoid the enterprise authentication capability unless it is absolutely necessary. For example, the following SID and SDDL providers require the enterprise authentication capability:

  • "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)"

These providers do not require the enterprise authentication capability on either platform:

  • "LOCAL=user"
  • "LOCAL=machine"

These providers do not require the enterprise authentication capability on Windows:

  • "WEBCREDENTIALS=MyPasswordName"
  • "WEBCREDENTIALS=MyPasswordName,myweb.com"

See also

Applies to