Freigeben über


MSProtectedData protectedDataWithProtectedFile:completionBlock method

Asynchronously creates and returns a protected file data object that can be used to read (and decrypt) data from the specified file, which is protected to Microsoft Protected File format.

Signature

+ (MSAsyncControl *)protectedDataWithProtectedFile:(NSString *)path
                                            userId:(NSString *)userId
                            authenticationCallback:(id<MSAuthenticationCallback>)authenticationCallback
                                   consentCallback:(id<MSConsentCallback>)consentCallback
                                           options:(MSPolicyAcquisitionOptions)options
                                   completionBlock:(void(^)(MSProtectedData *data, NSError *error))completionBlock;

Parameters

Name Datatype Notes
path
NSString *
Required. The absolute path of the protected file from which to read data.
userId
NSString *
authenticationCallback
id<[MSAuthenticationCallback](msauthenticationcallback-protocol-objc.md)>
consentCallback
id<[MSConsentCallback](./msconsentcallback-protocol-objc.md)>
options
[MSPolicyAcquisitionOptions](mspolicyacquisitionoptions-enum-objc.md)
completionBlock
void(^)([MSProtectedData](msprotecteddata-interface-objc.md) *data, NSError *error))
Required. Called when the method is completed with the following parameters:
data The protected file data object.
error If there is an error creating the data object, contains an NSError object that describes the problem.
[!Note]
If the user cancels the operation, both the data and error parameters will be NIL.

Returns

Returns an MSAsyncControl object allowing you to cancel asynchronous SDK operations including closing all opened UI.

Defined in

MSProtectedData.h

Supported Platforms

Minimum supported OS versions
iOS 7.0 and OS X 10.8

Remarks

The userPolicy property is set based on the policy that applies to the specified file.