class SealdEncryptionSession
@interface SealdEncryptionSession : NSObject
An encryption session, with which you can then encrypt / decrypt multiple messages. This should not be created directly, and should be retrieved with retrieveEncryptionSessionWithSessionId:useCache:error: (SealdSdk) or retrieveEncryptionSessionFromMessage:useCache:error: (SealdSdk).
Members | Descriptions |
---|---|
sessionId | The ID of this encryptionSession. Read-only. |
addRecipients:error: | Add new recipients to this session. These recipients will be able to read all encrypted messages of this session. |
addRecipientsAsync:completionHandler: | Add new recipients to this session. These recipients will be able to read all encrypted messages of this session. |
revokeRecipients:error: | Revoke some recipients from this session. If you want to revoke all recipients, see revokeAll: instead. If you want to revoke all recipients besides yourself, see revokeOthers:. |
revokeRecipientsAsync:completionHandler: | Revoke some recipients from this session. If you want to revoke all recipients, see revokeAll: instead. If you want to revoke all recipients besides yourself, see revokeOthers:. |
revokeAll: | Revoke this session entirely. |
revokeAllAsyncWithCompletionHandler: | Revoke this session entirely. |
revokeOthers: | Revoke all recipients besides yourself from this session. |
revokeOthersAsyncWithCompletionHandler: | Revoke all recipients besides yourself from this session. |
encryptMessage:error: | Encrypt a clear-text string into an encrypted message, for the recipients of this session. |
encryptMessageAsync:completionHandler: | Encrypt a clear-text string into an encrypted message, for the recipients of this session. |
decryptMessage:error: | Decrypt an encrypted message string into the corresponding clear-text string. |
decryptMessageAsync:completionHandler: | Decrypt an encrypted message string into the corresponding clear-text string. |
encryptFile:filename:error: | Encrypt a clear-text file into an encrypted file, for the recipients of this session. |
encryptFileAsync:filename:completionHandler: | Encrypt a clear-text file into an encrypted file, for the recipients of this session. |
decryptFile:error: | Decrypts an encrypted file into the corresponding clear-text file. |
decryptFileAsync:completionHandler: | Decrypts an encrypted file into the corresponding clear-text file. |
encryptFileFromURI:error: | Encrypt a clear-text file into an encrypted file, for the recipients of this session. |
encryptFileAsyncFromURI:completionHandler: | Encrypt a clear-text file into an encrypted file, for the recipients of this session. |
decryptFileFromURI:error: | Decrypts an encrypted file into the corresponding clear-text file. |
decryptFileAsyncFromURI:completionHandler: | Decrypts an encrypted file into the corresponding clear-text file. |
sessionId
@property (assign, readonly) NSString * sessionId;
The ID of this encryptionSession. Read-only.
addRecipients:error:
- (NSDictionary< NSString *, SealdActionStatus * > *) addRecipients:(const NSArray< NSString * > *)recipients
error:(NSError *_Nullable *)error;
Add new recipients to this session. These recipients will be able to read all encrypted messages of this session.
Parameters
recipients
The Seald IDs of users to add to this session.error
The error that occurred while adding the recipients, if any.
Returns
A [NSMutableDictionary<NSString*, SealdActionStatus*>*] instance.
addRecipientsAsync:completionHandler:
- (void) addRecipientsAsync:(const NSArray< NSString * > *)recipients
completionHandler:(void(^)(NSDictionary< NSString *, SealdActionStatus * > *result, NSError *_Nullable error))completionHandler;
Add new recipients to this session. These recipients will be able to read all encrypted messages of this session.
Parameters
recipients
The Seald IDs of users to add to this session.completionHandler
A callback called after function execution. This callback take two arguments, a [NSMutableDictionary<NSString*, SealdActionStatus*>*] instance. and aNSError*
that indicates if any error occurred.
revokeRecipients:error:
- (NSDictionary< NSString *, SealdActionStatus * > *) revokeRecipients:(const NSArray< NSString * > *)recipients
error:(NSError *_Nullable *)error;
Revoke some recipients from this session. If you want to revoke all recipients, see revokeAll: instead. If you want to revoke all recipients besides yourself, see revokeOthers:.
Parameters
recipients
The Seald IDs of users to revoke from this session.error
The error that occurred while revoking, if any.
Returns
A [NSMutableDictionary<NSString*, SealdActionStatus*>*] instance.
revokeRecipientsAsync:completionHandler:
- (void) revokeRecipientsAsync:(const NSArray< NSString * > *)recipients
completionHandler:(void(^)(NSDictionary< NSString *, SealdActionStatus * > *result, NSError *_Nullable error))completionHandler;
Revoke some recipients from this session. If you want to revoke all recipients, see revokeAll: instead. If you want to revoke all recipients besides yourself, see revokeOthers:.
Parameters
recipients
The Seald IDs of users to revoke from this session.completionHandler
A callback called after function execution. This callback take two arguments, a [NSMutableDictionary<NSString*, SealdActionStatus*>*] instance. and aNSError*
that indicates if any error occurred.
revokeAll:
- (NSDictionary< NSString *, SealdActionStatus * > *) revokeAll:(NSError *_Nullable *)error;
Revoke this session entirely.
Parameters
error
The error that occurred while revoking, if any.
Returns
A [NSMutableDictionary<NSString*, SealdActionStatus*>*] instance.
revokeAllAsyncWithCompletionHandler:
- (void) revokeAllAsyncWithCompletionHandler:(void(^)(NSDictionary< NSString *, SealdActionStatus * > *result, NSError *_Nullable error))completionHandler;
Revoke this session entirely.
Parameters
completionHandler
A callback called after function execution. This callback take two arguments, a [NSMutableDictionary<NSString*, SealdActionStatus*>*] instance. and aNSError*
that indicates if any error occurred.
revokeOthers:
- (NSDictionary< NSString *, SealdActionStatus * > *) revokeOthers:(NSError *_Nullable *)error;
Revoke all recipients besides yourself from this session.
Parameters
error
The error that occurred while revoking, if any.
Returns
A [NSMutableDictionary<NSString*, SealdActionStatus*>*] instance.
revokeOthersAsyncWithCompletionHandler:
- (void) revokeOthersAsyncWithCompletionHandler:(void(^)(NSDictionary< NSString *, SealdActionStatus * > *result, NSError *_Nullable error))completionHandler;
Revoke all recipients besides yourself from this session.
Parameters
completionHandler
A callback called after function execution. This callback take two arguments, a [NSMutableDictionary<NSString*, SealdActionStatus*>*] instance. and aNSError*
that indicates if any error occurred.
encryptMessage:error:
- (NSString *) encryptMessage:(const NSString *)clearMessage
error:(NSError *_Nullable *)error;
Encrypt a clear-text string into an encrypted message, for the recipients of this session.
Parameters
clearMessage
The message to encrypt.error
The error that occurred while encrypting the message, if any.
Returns
The encrypted message
encryptMessageAsync:completionHandler:
- (void) encryptMessageAsync:(const NSString *)clearMessage
completionHandler:(void(^)(NSString *encryptedString, NSError *_Nullable error))completionHandler;
Encrypt a clear-text string into an encrypted message, for the recipients of this session.
Parameters
completionHandler
A callback called after function execution. This callback take two arguments, a NSString* containing the encrypted string, and aNSError*
that indicates if any error occurred.
decryptMessage:error:
- (NSString *) decryptMessage:(const NSString *)encryptedMessage
error:(NSError *_Nullable *)error;
Decrypt an encrypted message string into the corresponding clear-text string.
Parameters
encryptedMessage
The encrypted message to decrypt.error
The error that occurred while decrypting the message, if any.
Returns
The decrypted clear-text message.
decryptMessageAsync:completionHandler:
- (void) decryptMessageAsync:(const NSString *)encryptedMessage
completionHandler:(void(^)(NSString *decryptedString, NSError *_Nullable error))completionHandler;
Decrypt an encrypted message string into the corresponding clear-text string.
Parameters
encryptedMessage
The encrypted message to decrypt.completionHandler
A callback called after function execution. This callback take two arguments, a NSString* containing the decrypted string, and aNSError*
that indicates if any error occurred.
encryptFile:filename:error:
- (NSData *) encryptFile:(const NSData *)clearFile
filename:(const NSString *)filename
error:(NSError *_Nullable *)error;
Encrypt a clear-text file into an encrypted file, for the recipients of this session.
Parameters
clearFile
ANSData*
of the clear-text content of the file to encrypt.filename
The name of the file to encrypt.error
The error that occurred while encrypting the file, if any.
Returns
A NSData*
of the content of the encrypted file.
encryptFileAsync:filename:completionHandler:
- (void) encryptFileAsync:(const NSData *)clearFile
filename:(const NSString *)filename
completionHandler:(void(^)(NSData *encryptedFile, NSError *_Nullable error))completionHandler;
Encrypt a clear-text file into an encrypted file, for the recipients of this session.
Parameters
clearFile
ANSData*
of the clear-text content of the file to encrypt.filename
The name of the file to encrypt.completionHandler
A callback called after function execution. This callback take two arguments, a NSData containing the encrypted file, and aNSError*
that indicates if any error occurred.
decryptFile:error:
- (SealdClearFile *) decryptFile:(const NSData *)encryptedFile
error:(NSError *_Nullable *)error;
Decrypts an encrypted file into the corresponding clear-text file.
Parameters
encryptedFile
ANSData*
of the content of the encrypted file to decrypt.error
The error that occurred while decrypting the file, if any.
Returns
A SealdClearFile instance, containing the filename and the fileContent of the decrypted file.
decryptFileAsync:completionHandler:
- (void) decryptFileAsync:(const NSData *)encryptedFile
completionHandler:(void(^)(SealdClearFile *clearFile, NSError *_Nullable error))completionHandler;
Decrypts an encrypted file into the corresponding clear-text file.
Parameters
encryptedFile
ANSData*
of the content of the encrypted file to decrypt.completionHandler
A callback called after function execution. This callback take two arguments, a NSData containing the decrypted file, and aNSError*
that indicates if any error occurred.
encryptFileFromURI:error:
- (NSString *) encryptFileFromURI:(const NSString *)clearFileURI
error:(NSError *_Nullable *)error;
Encrypt a clear-text file into an encrypted file, for the recipients of this session.
Parameters
clearFileURI
ANSString*
of an URI of the file to encrypt.error
The error that occurred while encrypting the file, if any.
Returns
A NSString*
of the URI of the encrypted file.
encryptFileAsyncFromURI:completionHandler:
- (void) encryptFileAsyncFromURI:(const NSString *)clearFileURI
completionHandler:(void(^)(NSString *encryptedFileURI, NSError *_Nullable error))completionHandler;
Encrypt a clear-text file into an encrypted file, for the recipients of this session.
Parameters
clearFileURI
ANSString*
of an URI of the file to encrypt.completionHandler
A callback called after function execution. This callback take two arguments, a NSString containing the URI of the encrypted file, and aNSError*
that indicates if any error occurred.
decryptFileFromURI:error:
- (NSString *) decryptFileFromURI:(const NSString *)encryptedFileURI
error:(NSError *_Nullable *)error;
Decrypts an encrypted file into the corresponding clear-text file.
Parameters
encryptedFileURI
ANSString*
of an URI of the encrypted file to decrypt.error
The error that occurred while decrypting the file, if any.
Returns
A NSString*
of the URI of the decrypted file.
decryptFileAsyncFromURI:completionHandler:
- (void) decryptFileAsyncFromURI:(const NSString *)encryptedFileURI
completionHandler:(void(^)(NSString *clearFileURI, NSError *_Nullable error))completionHandler;
Decrypts an encrypted file into the corresponding clear-text file.
Parameters
encryptedFileURI
ANSString*
of an URI of the encrypted file to decrypt.completionHandler
A callback called after function execution. This callback take two arguments, a NSString containing the URI of the decrypted file, and aNSError*
that indicates if any error occurred.