ASEarUtils
@interface ASEarUtils : NSObject
Decrypt files or directories encrypted by fasp via the EAR (encryption at rest) feature
-
Files that were encrypted-at-rest may be decoded client-side as they are written to disk, or they may be written to disk still encrypted (in this case they will have the suffix
aspera-env
). In the latter case this method may be used to decrypt the files after the transfer has completed. A file that is decrypted will be placed next to the original encrypted file (without theaspera-env
suffix) and, upon success, the original encrypted file will be deleted. If a directory is passed its contents are processed recursively and each file will be decrypted (subdirectories are also traversed). The method calls didDecryptBlock with the original encrypted filename for each decrypted file and will stop after its first failure or after all encrypted files have been decrypted.Declaration
Objective-C
+ (BOOL)decryptPath:(NSString *)src passphrase:(NSString *)passphrase error:(NSError **)err didDecryptBlock:(void (^)(NSString *))didDecrypt;
Swift
class func decryptPath(src: String!, passphrase: String!, didDecryptBlock didDecrypt: ((String!) -> Void)!) throws
-
Returns YES if the given path contains encrypyed files (files for which fileIsEncryptedContent: returns YES) and NO otherwise
Declaration
Objective-C
+ (BOOL)directoryHasEncryptedContent:(NSString *)path;
Swift
class func directoryHasEncryptedContent(path: String!) -> Bool
-
Returns YES if the given file has been encrypted using FASP’s EAR mechanism. A file is judged to be encrypted if it ends in
.aspera-env
and no corresponding un-encrypted file exists (with the same name minus the extensionaspera-env
).Declaration
Objective-C
+ (BOOL)fileIsEncryptedContent:(NSString *)filename;
Swift
class func fileIsEncryptedContent(filename: String!) -> Bool