FileProtectionStatus enumeration

Describes the selective wipe protection state of a file or folder.

Syntax


var value = Windows.Security.EnterpriseData.FileProtectionStatus.undetermined;

Attributes

[Version(0x06030000)]

Members

The FileProtectionStatus enumeration has these members.

MemberValueDescription
Undetermined | undetermined0

The item is either encrypting or decrypting and the selective wipe status cannot be determined. Check again later.

Unprotected | unprotected1

The item is not protected using selective wipe.

Revoked | revoked2

The item has been revoked using selective wipe.

Protected | protected3

The item is protected using selective wipe.

ProtectedByOtherUser | protectedByOtherUser4

Another user has protected the item using selective wipe.

ProtectedToOtherEnterprise | protectedToOtherEnterprise5

The item is protected for another enterprise id using selective wipe.

NotProtectable | notProtectable6

The item is encrypted or is a system file and cannot be protected using selective wipe.

Remarks


ApplicationData appRootFolder = ApplicationData.Current;
string enterpriseIdentity = "example.com";
int AccessDeniedHResult = -2147024891;  // Access Denied (0x80070005)



var appRootFolder = Windows.Storage.ApplicationData.current;
var enterpriseIdentity = "example.com";
var accessDeniedHResult = -2147024891;  // Access Denied (0x80070005)



function getFileContents(filePath) {
    var stream;
    var file;

    Windows.Storage.StorageFile.getFileFromPathAsync(filePath).then(
        function (f) {
            file = f;
            file.openReadAsync().then(
                function (s) {
                    stream = s;
                    return stream;
                },
                function (err) {
                    if (err.number == accessDeniedHResult) {
                        // Delete file if it has been revoked.
                        selectiveWipeCleanup(file);
                    }
                });
        });

    return null;
}

// Delete items revoked by Selective Wipe.
function selectiveWipeCleanup(file) {
    Windows.Security.EnterpriseData.FileRevocationManager.
        getStatusAsync(file).then(
            function (status) {
                if (status == 
                    Windows.Security.EnterpriseData.FileProtectionStatus.revoked) {
                        file.deleteAsync();
                }
        });

}


Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Security.EnterpriseData
Windows::Security::EnterpriseData [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

None supported

Namespace

Windows.Security.EnterpriseData
Windows::Security::EnterpriseData [C++]

Metadata

Windows.winmd

See also

FileRevocationManager
FileRevocationManager sample
How to protect files with Selective Wipe (C#/VB/C++)
How to protect files with Selective Wipe (JavaScript)

 

 

Show:
© 2015 Microsoft