Package org.jivesoftware.smackx.omemo
Class OmemoConfiguration
java.lang.Object
org.jivesoftware.smackx.omemo.OmemoConfiguration
Contains OMEMO related configuration options.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Determine, whether an OMEMO message should carry a plaintext hint about OMEMO encryption.static boolean
Determine, whether incoming preKeyMessages should automatically be answered by an empty message in order to complete the session.static boolean
static int
static boolean
Return true, if the client should stop encrypting messages to a read-only device.static int
Return the maximum number of signed preKeys that are cached until the oldest one gets deleted.static int
Get the maximum amount of messages that the client is allowed to send to a read-only device without getting a response.static boolean
Determine, whether signed preKeys are automatically rotated or not.static int
Get the interval in hours, after which the published signed preKey should be renewed.static boolean
Determine, whether incoming messages, which have broken sessions should automatically be answered by an empty preKeyMessage in order to establish a new session.static void
setAddOmemoHintBody
(boolean addHint) Decide, whether an OMEMO message should carry a plaintext hint about OMEMO encryption.static void
setCompleteSessionWithEmptyMessage
(boolean complete) Decide, whether incoming preKeyMessages should automatically be answered by an empty message in order to complete the session.static void
setDeleteStaleDevices
(boolean delete) static void
setDeleteStaleDevicesAfterHours
(int hours) static void
setIgnoreReadOnlyDevices
(boolean ignore) Set to true, in order to ignore read-only devices.static void
setMaxNumberOfStoredSignedPreKeys
(int number) Set the maximum number of signed preKeys that are cached until the oldest one gets deleted.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.static void
setRenewOldSignedPreKeys
(boolean renew) Decide, whether signed preKeys are automatically rotated or not.static void
setRenewOldSignedPreKeysAfterHours
(int hours) Set the interval in hours, after which the published signed preKey should be renewed.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.
-
Constructor Details
-
OmemoConfiguration
public OmemoConfiguration()
-
-
Method Details
-
setIgnoreReadOnlyDevices
Set to true, in order to ignore read-only devices.- Parameters:
ignore
- ignore read-only devices- See Also:
-
getIgnoreReadOnlyDevices
Return true, if the client should stop encrypting messages to a read-only device.- Returns:
- true if read-only devices should get ignored after a certain amount of unanswered messages.
- See Also:
-
setMaxReadOnlyMessageCount
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 thatgetIgnoreReadOnlyDevices()
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:
-
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 thatgetIgnoreReadOnlyDevices()
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:
-
setDeleteStaleDevices
-
getDeleteStaleDevices
-
setDeleteStaleDevicesAfterHours
-
getDeleteStaleDevicesAfterHours
-
setRenewOldSignedPreKeys
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
Determine, whether signed preKeys are automatically rotated or not.- Returns:
- auto-rotate signed preKeys?
-
setRenewOldSignedPreKeysAfterHours
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
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
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
Return the maximum number of signed preKeys that are cached until the oldest one gets deleted.- Returns:
- max number of cached signed preKeys.
-
setAddOmemoHintBody
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
Determine, whether an OMEMO message should carry a plaintext hint about OMEMO encryption.- Returns:
- true, if a hint is added to the message.
-
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
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
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
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
-