Megosztás a következőn keresztül:


MSMutableProtectedData class

MSMutableProtectedData and its super-class MSProtectedData provide protected file data objects, object-oriented wrappers for files that are protected using the Microsoft Protected File format. Use MSProtectedData to read (and transparently decrypt) protected files in consumption scenarios and MSMutableProtectedData to write (and transparently encrypt) data to protected files in publishing scenarios.

Signature

@interface MSMutableProtectedData : MSProtectedData

Methods

Name Description
protectedDataWithPolicy
Asynchronously creates and returns an empty MSMutableProtectedData object that can be used to write and protect data to the specified file.
protectedDataInFile
Protects the receiver's data and creates a new MSMutableProtectedData object with the protected data and its metadata.
appendBytes
Appends the specified number of plaintext bytes from a given buffer to the receiver.
appendData
Appends the content of another plaintext object to the receiver.
updateData
Replaces the entire protected contents of the receiver with the contents of another data object.
close
Writes and finalizes the protection of any remaining data, smaller than the block size, that is left over from preceding append and update calls.
synchronizeFile
Causes all in-memory data and attributes of the file represented by the receiver to be written to persistent storage.

Defined in

MSMutableProtectedData.h

Supported Platforms

Minimum supported OS versions
iOS 7.0 and OS X 10.8

Remarks

The methods of the MSMutableProtectedData class that write data transparently encrypt the plaintext data.

MSProtectedData and MSMutableProtectedData are used to read and write files that are protected with the Microsoft Protected File format. To read and write data for files that are protected with a custom protected file format, use MSCustomProtectedData and MSMutableCustomProtectedData.

Thread Safety

Members of this class are not guaranteed to be thread safe.