Skip to content

EncryptionSession

class EncryptionSession(encryptionSession: MobileEncryptionSession)

An encryption session, with which you can then encrypt / decrypt multiple messages or files. This should not be instantiated directly, and should be either created with SealdSDK.createEncryptionSession, or retrieved with SealdSDK.retrieveEncryptionSession or SealdSDK.retrieveEncryptionSessionFromMessage.

Constructors

EncryptionSessionconstructor(encryptionSession: MobileEncryptionSession)

Properties

NameSummary
retrievalDetailsval retrievalDetails: EncryptionSessionRetrievalDetails
Details about how this session was retrieved: through a group, a proxy, or directly. Read-only.
sessionIdval sessionId: String
The ID of this encryptionSession. Read-only.

Functions

NameSummary
addProxySessionfun addProxySession(proxySessionId: String, rights: RecipientRights = RecipientRights())
Add a proxy session as a recipient of this session. Any recipient of the proxy session will also be able to retrieve this session. The current user has to be a direct recipient of the proxy session.
addProxySessionAsyncsuspend fun addProxySessionAsync(proxySessionId: String, rights: RecipientRights = RecipientRights())
Add a proxy session as a recipient of this session. Any recipient of the proxy session will also be able to retrieve this session. The current user has to be a direct recipient of the proxy session.
addRecipientsfun addRecipients(recipients: Array<RecipientWithRights>): Map<String, ActionStatus>
Add new recipients to this session. These recipients will be able to read all encrypted messages of this session.
addRecipientsAsyncsuspend fun addRecipientsAsync(recipients: Array<RecipientWithRights>): Map<String, ActionStatus>
Add new recipients to this session. These recipients will be able to read all encrypted messages of this session.
decryptFilefun decryptFile(encryptedFile: ByteArray): ClearFile
Decrypts an encrypted file into the corresponding clear-text file.
decryptFileAsyncsuspend fun decryptFileAsync(encryptedFile: ByteArray): ClearFile
Decrypts an encrypted file into the corresponding clear-text file.
decryptFileFromURIfun decryptFileFromURI(encryptedFileURI: String): String
Decrypts an encrypted file into the corresponding clear-text file.
decryptFileFromURIAsyncsuspend fun decryptFileFromURIAsync(encryptedFileURI: String): String
Decrypts an encrypted file into the corresponding clear-text file.
decryptMessagefun decryptMessage(encryptedMessage: String): String
Decrypt an encrypted message string into the corresponding clear-text string.
decryptMessageAsyncsuspend fun decryptMessageAsync(encryptedMessage: String): String
Decrypt an encrypted message string into the corresponding clear-text string.
encryptFilefun encryptFile(clearFile: ByteArray, filename: String): ByteArray
Encrypt a clear-text file into an encrypted file, for the recipients of this session.
encryptFileAsyncsuspend fun encryptFileAsync(clearFile: ByteArray, filename: String): ByteArray
Encrypt a clear-text file into an encrypted file, for the recipients of this session.
encryptFileFromURIfun encryptFileFromURI(clearFileURI: String): String
Encrypt a clear file into an encrypted file, for the recipients of this session.
encryptFileFromURIAsyncsuspend fun encryptFileFromURIAsync(clearFileURI: String): String
Encrypt a clear file into an encrypted file, for the recipients of this session.
encryptMessagefun encryptMessage(clearMessage: String): String
Encrypt a clear-text string into an encrypted message, for the recipients of this session.
encryptMessageAsyncsuspend fun encryptMessageAsync(clearMessage: String): String
Encrypt a clear-text string into an encrypted message, for the recipients of this session.
revokeAllfun revokeAll(): RevokeResult
Revoke this session entirely.
revokeAllAsyncsuspend fun revokeAllAsync(): RevokeResult
Revoke this session entirely.
revokeOthersfun revokeOthers(): RevokeResult
Revoke all recipients besides yourself from this session.
revokeOthersAsyncsuspend fun revokeOthersAsync(): RevokeResult
Revoke all recipients besides yourself from this session.
revokeRecipientsfun revokeRecipients(recipientsIds: Array<String>, proxySessionsIds: Array<String>): RevokeResult
Revoke some recipients or proxy sessions from this session. If you want to revoke all recipients, see revokeAll instead. If you want to revoke all recipients besides yourself, see revokeOthers.
revokeRecipientsAsyncsuspend fun revokeRecipientsAsync(recipientsIds: Array<String>, proxySessionsIds: Array<String>): RevokeResult
Revoke some recipients or proxy sessions from this session. If you want to revoke all recipients, see revokeAll instead. If you want to revoke all recipients besides yourself, see revokeOthers.