Class GroupSessionBuilder


  • public class GroupSessionBuilder
    extends java.lang.Object
    GroupSessionBuilder is responsible for setting up group SenderKey encrypted sessions. Once a session has been established, GroupCipher can be used to encrypt/decrypt messages in that session.

    The built sessions are unidirectional: they can be used either for sending or for receiving, but not both. Sessions are constructed per (senderName + deviceId) tuple, with sending additionally parameterized on a per-group distributionId. Remote logical users are identified by their senderName, and each logical user can have multiple physical devices. This class is not thread-safe.

    • Constructor Detail

      • GroupSessionBuilder

        public GroupSessionBuilder​(SenderKeyStore senderKeyStore)
    • Method Detail

      • process

        public void process​(SignalProtocolAddress sender,
                            SenderKeyDistributionMessage senderKeyDistributionMessage)
        Construct a group session for receiving messages from sender.
        Parameters:
        sender - The address of the device that sent the message.
        senderKeyDistributionMessage - A received SenderKeyDistributionMessage.
      • create

        public SenderKeyDistributionMessage create​(SignalProtocolAddress sender,
                                                   java.util.UUID distributionId)
        Construct a group session for sending messages.
        Parameters:
        sender - The address of the current client.
        distributionId - An opaque identifier that uniquely identifies the group (but isn't the group ID).
        Returns:
        A SenderKeyDistributionMessage that is individually distributed to each member of the group.