Share via


MSMutableProtectedData protectedDataInFile:withProtectionPolicy:completionBlock method

Protects the receiver's data and creates a new MSMutableProtectedData object with the protected data and its metadata.

Signature

- (void)protectedDataInFile:(NSString *)path
      originalFileExtension:(NSString *)originalFileExtension
       withProtectionPolicy:(MSUserPolicy *)userPolicy
            completionBlock:(void(^)(MSMutableProtectedData *data, NSError *error)
              )completionBlock;

Parameters

Name Datatype Notes
path
NSString *
Required. The path to the protected file.
originalFileExtension
NSString *
Required.
userPolicy
MSUserPolicy *
Required. The user policy to be used for protecting the receiver's data.
completionBlock
****void(^)(MSMutableProtectedData *data, NSError *error)
Required. Called with the following parameters when the method is completed:
data The protected data file object.
error If there is an error creating the data object, contains an NSError object that describes the problem.

Returns

Nothing.

Defined in

Supported Platforms

Minimum supported OS versions
iOS 7.0 and OS X 10.7

See also

MSMutableProtectedData