Skip to content

AnonymousEncryptionSession

class AnonymousEncryptionSession(encryptionSession: MobileAnonymousEncryptionSession)

An anonymous encryption session, with which you can then encrypt / decrypt multiple messages or files. This should not be instantiated directly, and should be created with AnonymousSealdSDK.createAnonymousEncryptionSession.

Constructors

AnonymousEncryptionSessionconstructor(encryptionSession: MobileAnonymousEncryptionSession)

Properties

NameSummary
sessionIdval sessionId: String
The ID of this encryptionSession. Read-only.

Functions

NameSummary
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.
serializefun serialize(): String
Serialize the AnonymousEncryptionSession to a string. This is for advanced use. May be used to keep sessions in a cache. WARNING: a user could use this cache to work around being revoked. Use with caution. WARNING: if the cache is accessible to another user, they could use it to decrypt messages they are not supposed to have access to. Make sure only the current user in question can access this cache, for example by encrypting it.