Class OmemoConfiguration

    • Method Detail

      • setMaxReadOnlyMessageCount

        public static void setMaxReadOnlyMessageCount​(int maxReadOnlyMessageCount)
        Set the maximum amount of messages that the client is allowed to send to a read-only device without getting a response. Once the message counter of a device reaches that value, the client will stop encrypting messages for the device (given that getIgnoreReadOnlyDevices() is true). This threshold is used to prevent read-only devices from weakening forward secrecy.
        Parameters:
        maxReadOnlyMessageCount - maximum number of allowed messages to a read-only device.
        See Also:
        Blog Post explaining the danger of read-only devices.
      • getMaxReadOnlyMessageCount

        public static int getMaxReadOnlyMessageCount()
        Get the maximum amount of messages that the client is allowed to send to a read-only device without getting a response. Once the message counter of a device reaches that value, the client will stop encrypting messages for the device (given that getIgnoreReadOnlyDevices() is true). This threshold is used to prevent read-only devices from weakening forward secrecy.
        Returns:
        maximum number of allowed messages to a read-only device.
        See Also:
        Blog Post explaining the danger of read-only devices.
      • setRenewOldSignedPreKeys

        public static void setRenewOldSignedPreKeys​(boolean renew)
        Decide, whether signed preKeys are automatically rotated or not. It is highly recommended to rotate signed preKeys to preserve forward secrecy.
        Parameters:
        renew - automatically rotate signed preKeys?
      • getRenewOldSignedPreKeys

        public static boolean getRenewOldSignedPreKeys()
        Determine, whether signed preKeys are automatically rotated or not.
        Returns:
        auto-rotate signed preKeys?
      • setRenewOldSignedPreKeysAfterHours

        public static void setRenewOldSignedPreKeysAfterHours​(int hours)
        Set the interval in hours, after which the published signed preKey should be renewed. This value should be between one or two weeks.
        Parameters:
        hours - hours after which signed preKeys should be rotated.
      • getRenewOldSignedPreKeysAfterHours

        public static int getRenewOldSignedPreKeysAfterHours()
        Get the interval in hours, after which the published signed preKey should be renewed. This value should be between one or two weeks.
        Returns:
        hours after which signed preKeys should be rotated.
      • setMaxNumberOfStoredSignedPreKeys

        public static void setMaxNumberOfStoredSignedPreKeys​(int number)
        Set the maximum number of signed preKeys that are cached until the oldest one gets deleted. This number should not be too small in order to prevent message loss, but also not too big to preserve forward secrecy.
        Parameters:
        number - number of cached signed preKeys.
      • getMaxNumberOfStoredSignedPreKeys

        public static int getMaxNumberOfStoredSignedPreKeys()
        Return the maximum number of signed preKeys that are cached until the oldest one gets deleted.
        Returns:
        max number of cached signed preKeys.
      • setAddOmemoHintBody

        public static void setAddOmemoHintBody​(boolean addHint)
        Decide, whether an OMEMO message should carry a plaintext hint about OMEMO encryption. Eg. "I sent you an OMEMO encrypted message..."
        Parameters:
        addHint - shall we add a hint?
      • getAddOmemoHintBody

        public static boolean getAddOmemoHintBody()
        Determine, whether an OMEMO message should carry a plaintext hint about OMEMO encryption.
        Returns:
        true, if a hint is added to the message.
      • getRepairBrokenSessionsWithPreKeyMessages

        public static boolean getRepairBrokenSessionsWithPreKeyMessages()
        Determine, whether incoming messages, which have broken sessions should automatically be answered by an empty preKeyMessage in order to establish a new session.
        Returns:
        true if session should be repaired automatically.
      • setRepairBrokenSessionsWithPrekeyMessages

        public static void setRepairBrokenSessionsWithPrekeyMessages​(boolean repair)
        Decide, whether incoming messages, which have broken sessions should automatically be answered by an empty preKeyMessage in order to establish a new session.
        Parameters:
        repair - repair sessions?
      • getCompleteSessionWithEmptyMessage

        public static boolean getCompleteSessionWithEmptyMessage()
        Determine, whether incoming preKeyMessages should automatically be answered by an empty message in order to complete the session.
        Returns:
        true if sessions should be completed.
      • setCompleteSessionWithEmptyMessage

        public static void setCompleteSessionWithEmptyMessage​(boolean complete)
        Decide, whether incoming preKeyMessages should automatically be answered by an empty message in order to complete the session.
        Parameters:
        complete - complete the session or not