Class EncryptionSession
-
- All Implemented Interfaces:
public final class EncryptionSessionAn 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.
-
-
Field Summary
Fields Modifier and Type Field Description private final EncryptionSessionRetrievalDetailsretrievalDetailsprivate final StringsessionId
-
Constructor Summary
Constructors Constructor Description EncryptionSession(MobileEncryptionSession encryptionSession)
-
Method Summary
Modifier and Type Method Description final EncryptionSessionRetrievalDetailsgetRetrievalDetails()Details about how this session was retrieved: through a group, a proxy, or directly. final StringgetSessionId()final Map<String, ActionStatus>addRecipients(Array<RecipientWithRights> recipients)Add new recipients to this session. final Map<String, ActionStatus>addRecipientsAsync(Array<RecipientWithRights> recipients)Add new recipients to this session. final UnitaddProxySession(String proxySessionId, RecipientRights rights)Add a proxy session as a recipient of this session. final UnitaddProxySessionAsync(String proxySessionId, RecipientRights rights)Add a proxy session as a recipient of this session. final RevokeResultrevokeRecipients(Array<String> recipientsIds, Array<String> proxySessionsIds)Revoke some recipients or proxy sessions from this session. final RevokeResultrevokeRecipientsAsync(Array<String> recipientsIds, Array<String> proxySessionsIds)Revoke some recipients or proxy sessions from this session. final RevokeResultrevokeAll()Revoke this session entirely. final RevokeResultrevokeAllAsync()Revoke this session entirely. final RevokeResultrevokeOthers()Revoke all recipients besides yourself from this session. final RevokeResultrevokeOthersAsync()Revoke all recipients besides yourself from this session. final StringencryptMessage(String clearMessage)Encrypt a clear-text string into an encrypted message, for the recipients of this session. final StringencryptMessageAsync(String clearMessage)Encrypt a clear-text string into an encrypted message, for the recipients of this session. final StringdecryptMessage(String encryptedMessage)Decrypt an encrypted message string into the corresponding clear-text string. final StringdecryptMessageAsync(String encryptedMessage)Decrypt an encrypted message string into the corresponding clear-text string. final ByteArrayencryptFile(ByteArray clearFile, String filename)Encrypt a clear-text file into an encrypted file, for the recipients of this session. final ByteArrayencryptFileAsync(ByteArray clearFile, String filename)Encrypt a clear-text file into an encrypted file, for the recipients of this session. final ClearFiledecryptFile(ByteArray encryptedFile)Decrypts an encrypted file into the corresponding clear-text file. final ClearFiledecryptFileAsync(ByteArray encryptedFile)Decrypts an encrypted file into the corresponding clear-text file. final StringencryptFileFromURI(String clearFileURI)Encrypt a clear file into an encrypted file, for the recipients of this session. final StringencryptFileFromURIAsync(String clearFileURI)Encrypt a clear file into an encrypted file, for the recipients of this session. final StringdecryptFileFromURI(String encryptedFileURI)Decrypts an encrypted file into the corresponding clear-text file. final StringdecryptFileFromURIAsync(String encryptedFileURI)Decrypts an encrypted file into the corresponding clear-text file. final StringaddTmrAccess(TmrRecipientWithRights recipient)Add a TMR access to this session for the given authentication factor. final StringaddTmrAccessAsync(TmrRecipientWithRights recipient)Add a TMR access to this session for the given authentication factor. final Map<String, ActionStatus>addMultipleTmrAccesses(Array<TmrRecipientWithRights> recipients)Add multiple TMR accesses to this session for the given authentication factors. final Map<String, ActionStatus>addMultipleTmrAccessesAsync(Array<TmrRecipientWithRights> recipients)Add multiple TMR accesses to this session for the given authentication factors. -
-
Method Detail
-
getRetrievalDetails
final EncryptionSessionRetrievalDetails getRetrievalDetails()
Details about how this session was retrieved: through a group, a proxy, or directly. Read-only.
-
getSessionId
final String getSessionId()
-
addRecipients
final Map<String, ActionStatus> addRecipients(Array<RecipientWithRights> recipients)
Add new recipients to this session. These recipients will be able to read all encrypted messages of this session.
- Parameters:
recipients- RecipientWithRights The Seald IDs with the associated rights of users to add to this session.
-
addRecipientsAsync
final Map<String, ActionStatus> addRecipientsAsync(Array<RecipientWithRights> recipients)
Add new recipients to this session. These recipients will be able to read all encrypted messages of this session.
- Parameters:
recipients- The Seald IDs with the associated rights of users to add to this session.
-
addProxySession
final Unit addProxySession(String proxySessionId, RecipientRights rights)
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.
- Parameters:
proxySessionId- The ID of the session to add as proxy.rights- The rights to assign to this proxy.
-
addProxySessionAsync
final Unit addProxySessionAsync(String proxySessionId, RecipientRights rights)
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.
- Parameters:
proxySessionId- The ID of the session to add as proxy.rights- The ID of the session to add as proxy.
-
revokeRecipients
final RevokeResult revokeRecipients(Array<String> recipientsIds, Array<String> proxySessionsIds)
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.
- Parameters:
recipientsIds- The Seald IDs of users to revoke from this session.proxySessionsIds- The IDs of proxy sessions to revoke from this session.
-
revokeRecipientsAsync
final RevokeResult revokeRecipientsAsync(Array<String> recipientsIds, Array<String> proxySessionsIds)
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.
- Parameters:
recipientsIds- The Seald IDs of users to revoke from this session.proxySessionsIds- The IDs of proxy sessions to revoke from this session.
-
revokeAll
final RevokeResult revokeAll()
Revoke this session entirely.
-
revokeAllAsync
final RevokeResult revokeAllAsync()
Revoke this session entirely.
-
revokeOthers
final RevokeResult revokeOthers()
Revoke all recipients besides yourself from this session.
-
revokeOthersAsync
final RevokeResult revokeOthersAsync()
Revoke all recipients besides yourself from this session.
-
encryptMessage
final String encryptMessage(String clearMessage)
Encrypt a clear-text string into an encrypted message, for the recipients of this session.
- Parameters:
clearMessage- The message to encrypt.
-
encryptMessageAsync
final String encryptMessageAsync(String clearMessage)
Encrypt a clear-text string into an encrypted message, for the recipients of this session.
- Parameters:
clearMessage- The message to encrypt.
-
decryptMessage
final String decryptMessage(String encryptedMessage)
Decrypt an encrypted message string into the corresponding clear-text string.
- Parameters:
encryptedMessage- The encrypted message to decrypt.
-
decryptMessageAsync
final String decryptMessageAsync(String encryptedMessage)
Decrypt an encrypted message string into the corresponding clear-text string.
- Parameters:
encryptedMessage- The encrypted message to decrypt.
-
encryptFile
final ByteArray encryptFile(ByteArray clearFile, String filename)
Encrypt a clear-text file into an encrypted file, for the recipients of this session.
- Parameters:
clearFile- A ByteArray of the clear-text content of the file to encrypt.filename- The name of the file to encrypt.
-
encryptFileAsync
final ByteArray encryptFileAsync(ByteArray clearFile, String filename)
Encrypt a clear-text file into an encrypted file, for the recipients of this session.
- Parameters:
clearFile- A ByteArray of the clear-text content of the file to encrypt.filename- The name of the file to encrypt.
-
decryptFile
final ClearFile decryptFile(ByteArray encryptedFile)
Decrypts an encrypted file into the corresponding clear-text file.
- Parameters:
encryptedFile- A ByteArray of the content of the encrypted file to decrypt.
-
decryptFileAsync
final ClearFile decryptFileAsync(ByteArray encryptedFile)
Decrypts an encrypted file into the corresponding clear-text file.
- Parameters:
encryptedFile- A ByteArray of the content of the encrypted file to decrypt.
-
encryptFileFromURI
final String encryptFileFromURI(String clearFileURI)
Encrypt a clear file into an encrypted file, for the recipients of this session.
- Parameters:
clearFileURI- A String URI of the file to encrypt.
-
encryptFileFromURIAsync
final String encryptFileFromURIAsync(String clearFileURI)
Encrypt a clear file into an encrypted file, for the recipients of this session.
- Parameters:
clearFileURI- A String URI of the file to encrypt.
-
decryptFileFromURI
final String decryptFileFromURI(String encryptedFileURI)
Decrypts an encrypted file into the corresponding clear-text file.
- Parameters:
encryptedFileURI- A String URI of the encrypted file to decrypt.
-
decryptFileFromURIAsync
final String decryptFileFromURIAsync(String encryptedFileURI)
Decrypts an encrypted file into the corresponding clear-text file.
- Parameters:
encryptedFileURI- A String URI of the encrypted file to decrypt.
-
addTmrAccess
final String addTmrAccess(TmrRecipientWithRights recipient)
Add a TMR access to this session for the given authentication factor.
- Parameters:
recipient- A TMR recipient with its associated rights.
-
addTmrAccessAsync
final String addTmrAccessAsync(TmrRecipientWithRights recipient)
Add a TMR access to this session for the given authentication factor.
- Parameters:
recipient- A TMR recipient with its associated rights.
-
addMultipleTmrAccesses
final Map<String, ActionStatus> addMultipleTmrAccesses(Array<TmrRecipientWithRights> recipients)
Add multiple TMR accesses to this session for the given authentication factors.
- Parameters:
recipients- The TMR recipients with their associated rights.
-
addMultipleTmrAccessesAsync
final Map<String, ActionStatus> addMultipleTmrAccessesAsync(Array<TmrRecipientWithRights> recipients)
Add multiple TMR accesses to this session for the given authentication factors.
- Parameters:
recipients- The TMR recipients with their associated rights.
-
-
-
-