public class GroupCipher
extends java.lang.Object
GroupSessionBuilder
and a SenderKeyDistributionMessage has been
distributed to each member of the group, this class can be used for all subsequent encrypt/decrypt
operations within that session (ie: until group membership changes).| Constructor and Description |
|---|
GroupCipher(SenderKeyStore senderKeyStore,
SenderKeyName senderKeyId) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] senderKeyMessageBytes)
Decrypt a SenderKey group message.
|
byte[] |
decrypt(byte[] senderKeyMessageBytes,
DecryptionCallback callback)
Decrypt a SenderKey group message.
|
byte[] |
encrypt(byte[] paddedPlaintext)
Encrypt a message.
|
public GroupCipher(SenderKeyStore senderKeyStore, SenderKeyName senderKeyId)
public byte[] encrypt(byte[] paddedPlaintext)
throws NoSessionException
paddedPlaintext - The plaintext message bytes, optionally padded.NoSessionExceptionpublic byte[] decrypt(byte[] senderKeyMessageBytes)
throws LegacyMessageException,
DuplicateMessageException,
InvalidMessageException,
NoSessionException
senderKeyMessageBytes - The received ciphertext.LegacyMessageExceptionInvalidMessageExceptionDuplicateMessageExceptionNoSessionExceptionpublic byte[] decrypt(byte[] senderKeyMessageBytes,
DecryptionCallback callback)
throws LegacyMessageException,
InvalidMessageException,
DuplicateMessageException,
NoSessionException
senderKeyMessageBytes - The received ciphertext.callback - A callback that is triggered after decryption is complete,
but before the updated session state has been committed to the session
DB. This allows some implementations to store the committed plaintext
to a DB first, in case they are concerned with a crash happening between
the time the session state is updated but before they're able to store
the plaintext to disk.LegacyMessageExceptionInvalidMessageExceptionDuplicateMessageExceptionNoSessionException