A singleton class that provides convenience methods for encrypting and decrypting locally stored files.
More...
Inherits NSObject.
A singleton class that provides convenience methods for encrypting and decrypting locally stored files.
- Note
- Encryption keys are generated per user, so the user must be locally authenticated to perform these operations. If the user is not locally authenticated an error is returned with error code
VEVCryptUserLoggedOutError
.
◆ encryptFileAtPath:attributes:handler:()
- (void) encryptFileAtPath: |
|
(NSString *) |
path |
attributes: |
|
(nullable NSDictionary< NSString *, id > *) |
attributes |
handler: |
|
(VEVVaultCryptResultHandler) |
handler |
|
|
| |
Encrypts contents at path
.
- Parameters
-
path | The file path to encrypt. |
attributes | The file attributes. |
handler | The callback to invoke when complete. |
◆ createEncryptedFileAtPath:contents:attributes:error:()
- (BOOL) createEncryptedFileAtPath: |
|
(NSString *) |
path |
contents: |
|
(NSData *) |
contents |
attributes: |
|
(nullable NSDictionary< NSString *, id > *) |
attributes |
error: |
|
(NSError *_Nullable __autoreleasing *) |
error |
|
|
| |
Writes contents to disk after first encrypting them. This method is meant to mirror NSFileManager:createFileAtAtPath:contents:attributes:
but with the addition of encryption.
- Parameters
-
path | The file path to write the new file to. |
contents | The data to encrypt and write. |
attributes | The file attributes. |
error | The error object in the event an error occurs writing the contents to disk. |
- See also
- VEVVaultAuth
-
NSFileManager:createFileAtPath:contents:attributes:.
◆ streamFromEncryptedFileAtPath:()
- (nullable NSInputStream*) streamFromEncryptedFileAtPath: |
|
(NSString *) |
srcPath |
|
Returns an NSInputStream
that decrypts the contents as they are read.
- Parameters
-
srcPath | The file path with the encrypted contents to decrypt. |
- Returns
- The decrypting NSInputStream.
◆ decryptContentsAtPath:error:()
- (nullable NSData*) decryptContentsAtPath: |
|
(NSString *) |
path |
error: |
|
(NSError *_Nullable __autoreleasing *) |
error |
|
|
| |
Returns the contents at path after first decrypting them. This method is meant to mirror NSFileManager:contentsAtPath:
but with the addition of decryption.
- Parameters
-
path | The local file path of the file to read. |
error | The error object in the event an error occurs reading the contents from disk. |
- Returns
- The encrypted contents.
- See also
- VEVVautlCrypt::streamFromEncryptedFileAtPath:
-
VEVVaultAuth
-
NSFileManager:contentsAtPath:.
The documentation for this class was generated from the following file: