UserDataProtectionManager Class
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.
Provides static methods to instantiate UserDataProtectionManager for the current or provided user. An instance of UserDataProtectionManager provides methods to protect / unprotect files and buffers.
public ref class UserDataProtectionManager sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 524288)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class UserDataProtectionManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 524288)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class UserDataProtectionManager
Public NotInheritable Class UserDataProtectionManager
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10, version 1903 (introduced in 10.0.18362.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v8.0)
|
Methods
GetStorageItemProtectionInfoAsync(IStorageItem) |
Gets the current protection information for a storage item. |
IsContinuedDataAvailabilityExpected(UserDataAvailability) |
Allows querying whether data protected to a specified availability will continue to stay available for a reasonable duration from now. |
ProtectBufferAsync(IBuffer, UserDataAvailability) |
Protects a buffer to a specified availability. |
ProtectStorageItemAsync(IStorageItem, UserDataAvailability) |
Protects a storage item to the specified availability. |
TryGetDefault() |
Returns a UserDataProtectionManager instance for the current or default user. Caller must check if the returned object is null. If a null object is returned, UserDataProtectionManager is not supported on the system. |
TryGetForUser(User) |
Returns a UserDataProtectionManager instance for the specified user object. Windows.System.User.FindAllAsync() can be used to find users on the system. Caller must check if the returned object is null. If it null, UserDataProtectionManager is not supported on the system. |
UnprotectBufferAsync(IBuffer) |
Unprotect a buffer that has been protected using 'ProtectBufferAsync'. |
Events
DataAvailabilityStateChanged |
This event invokes listeners when the state of data availability has changed. For example, when the device locks, data protected to the 'WhileUnlocked' UserDataAvailability becomes unavailable. This state change can be listened to by subscribing to this event. |